[osmosis-dev] Optimizing filtering of administative boundaries with Osmosis

Steijn van den Toorn steijnvdt at gmail.com
Sat Feb 6 01:59:35 UTC 2016


Hi,

after spending some days of trial and error I developed the following
3-step method to retrieve administrative borders of admin_level 2 (national
borders). I use Portugal as an example as it is a rather small country (the
chevrons allow to feed multiple lines into the Windows Command Prompt), but
I plan to use it more often and on entire Europe and on various
admin_levels:

Step 1:
osmosis ^
  --read-pbf-fast workers=2 "D:/GIS Data/Tijdelijk/portugal-latest.osm.pbf"
^
  --tf accept-relations boundary=administrative ^
  --tf accept-relations admin_level=2 ^
  --write-pbf file="D:/GIS Data/Tijdelijk/step1.osm.pbf"

Step 2:
osmosis ^
  --read-pbf-fast workers=2 "D:/GIS Data/Tijdelijk/step1.osm.pbf" ^
  --used-way ^
  --write-pbf file="D:/GIS Data/Tijdelijk/step2.osm.pbf"

Step 3:
osmosis ^
  --read-pbf-fast workers=2 "D:/GIS Data/Tijdelijk/step2.osm.pbf" ^
  --used-node ^
  --write-pbf file="D:/GIS Data/Tijdelijk/final.osm.pbf"

I read the Osmosis manual thoroughly, but it doesn't get clear to me how I
can merge, and possibly optimize, these three seperate steps. Any help?

Thanks,
 Steijn.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osmosis-dev/attachments/20160206/f036c294/attachment.html>


More information about the osmosis-dev mailing list