-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Oleksandr Shyshatskyi
committed
Aug 10, 2020
1 parent
11c6eb6
commit c91a9d6
Showing
2 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
|
||
wget https://download.geofabrik.de/europe/ukraine-latest.osm.pbf -O ukraine-latest-new-crimea.osm.pbf | ||
rm -f /bin/osmconvert64 \ | ||
&& wget http://m.m.i24.cc/osmconvert64 -O /bin/osmconvert64 \ | ||
&& chmod +x /bin/osmconvert64 | ||
rm -f /bin/osmfilter64 \ | ||
&& wget http://m.m.i24.cc/osmfilter64 -O /bin/osmfilter64 \ | ||
&& chmod +x /bin/osmfilter64 | ||
|
||
# crop downloaded polygon by borders | ||
osmconvert64 ukraine-latest-new-crimea.osm.pbf -B=ukraine.poly -o=ukraine-latest-no-crimea.osm | ||
osmconvert64 ukraine-latest-no-crimea.osm crimea.osm --out-pbf > output/ukraine-latest-fixed-crimea.osm.pbf | ||
# drop relations to Russia | ||
osmfilter64 ukraine-latest-no-crimea.osm --verbose \ | ||
--drop-relations="@id=1059500 or @id=3560388 or @id=3563652 or @id=3564042 or @id=3788824 or @id=3795586 or @id=30189 or @id=3826845 or @id=60189 @id=2800681 or @id=2858674 or @id=3805584" \ | ||
-o=ukraine-latest-no-crimea-no-russia.osm | ||
# combine and convert to pbf again | ||
osmconvert64 ukraine-latest-no-crimea-no-russia.osm crimea_fixed.osm --out-pbf > output/ukraine-latest-fixed-crimea.osm.pbf |