OSM on Paper/Printing via Maperitive, Inkscape, and Osmosis/Sample Osmosis Scripts

From OpenStreetMap Wiki
Jump to navigation Jump to search

The following Osmosis scripts are samples of those used to extract data from an OSM XML download. Mappers are encouraged to modify them as needed to meet their needs. These are merely examples of files that have worked for others.

Script for extracting major highways, waterways, and railways

"D:\Program Files (x86)\Osmosis\bin\osmosis.bat" --read-xml D:\Downloads\OSM\190113_TKM.osm --way-key-value keyValueList="highway.trunk,highway.primary,highway.secondary,highway.tertiary, waterway.*,railway.rail" --used-node --write-xml D:\Downloads\OSM\highways.osm

Script for extracting administrative boundaries

"D:\Program Files (x86)\Osmosis\bin\osmosis.bat" --read-xml D:\Downloads\OSM\190113_TKM.osm --way-key-value keyValueList="admin_level.1,admin_level.2,admin_level.3,admin_level.4,admin_level.5,admin_level.8,admin_level.9,natural.coastline,boundary.administrative" --used-node --write-xml D:\Downloads\OSM\boundaries.osm

Script for extracting municipality nodes and gas stations mapped as nodes

"D:\Program Files (x86)\Osmosis\bin\osmosis.bat" --read-xml D:\Downloads\OSM\190113_TKM.osm --bounding-polygon file=D:\Downloads\OSM\TKM-polygon.txt --node-key-value keyValueList="place.city,place.town,place.village,place.borough,amenity.fuel" --write-xml D:\Downloads\OSM\municipalities.osm

Script for extracting gas stations mapped as ways

"D:\Program Files (x86)\Osmosis\bin\osmosis.bat" --read-xml D:\Downloads\OSM\190113_TKM.osm --bounding-polygon file=D:\Downloads\OSM\TKM-polygon.txt --tf accept-ways amenity=fuel --used-node --write-xml D:\Downloads\OSM\fuel-way.osm

Script for extracting border crossings

"D:\Program Files (x86)\Osmosis\bin\osmosis.bat" --read-xml D:\Downloads\OSM\190113_TKM.osm --bounding-polygon file=D:\Downloads\OSM\TKM-polygon.txt --tf reject-relations --tf accept-ways military=checkpoint --used-node --write-xml D:\Downloads\OSM\border-checkpoint-way.osm