Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compare a road network to OpenStreetMap
wget http://download.openstreetmap.fr/extracts/oceania/australia/new_south_wales.osm.pbf
osmium tags-filter new_south_wales.osm.pbf w/highway -o nsw-roads.osm.pbf
osmium export -o nsw-roads.geojson nsw-roads.osm.pbf
ogr2ogr -f GPKG nsw-roads.gpkg nsw-roads.geojson
ogr2ogr -dialect OGRSQL -sql "SELECT geom FROM \"nsw-roads\" WHERE OGR_GEOMETRY='LineString'" nsw-roads.shp nsw-roads.gpkg

# in QGIS
# Vector > Geoprocessing Tools > Buffer
# buffer distance 0.0005

# Vector > Geoprocessing Tools > Difference
# Input Layer: AMS_Roads
# Overlay Layer: Buffered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.