Skip to content

Instantly share code, notes, and snippets.

@olafveerman
Created March 19, 2019 00:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olafveerman/7c0127261958af5e5c07b78ccf819e5c to your computer and use it in GitHub Desktop.
Save olafveerman/7c0127261958af5e5c07b78ccf819e5c to your computer and use it in GitHub Desktop.
Extract road network for QXN

1. Get the extract

Note, this is 6.7GB.

wget http://download.geofabrik.de/asia-latest.osm.pbf

2. Reduce to bounding box

docker run \
  -w /work \
  -v $(pwd):/work \
  --name osm-extract-qxn \
  olafveerman/osmium-tool \
  osmium extract ./data/asia-latest.osm.pbf \
  -b 104.3,24.5,106.8,26.34 \
  -o ./output/qxn-latest.osm.pbf \
  -f pbf,add_metadata=false

3. Filter highways

docker run \
  -w /work \
  -v $(pwd):/work \
  --name osm-tags-filter \
  olafveerman/osmium-tool \
  osmium tags-filter ./output/qxn-latest.osm.pbf w/ highway \
  -o ./output/qxn-latest-roads.osm.xml \
  -f osm,add_metadata=false   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment