Skip to content
Ben Abelshausen edited this page Jan 3, 2016 · 33 revisions

ODP is a simple tool that exposes some of OsmSharp's functionality to act as a CLI tool to process OpenSteetMap-data.

Basic supported features are:

  • Reading/writing OSM-XML (.osm).
  • Reading/writing OSM-PBF (.osm.pbf).
  • Merging multiple sources.
  • Creating and writing OsmSharp-routing format file.
  • Creating routable shapefiles based on OSM-data.

Usage by example

Basic example converting from OSM-PBF to OSM-XML:

odp --read-pbf somefile.xml.pbf --write-xml somefile.osm

Merge two files together:

odp --read-pbf somefile1.osm.pbf --read-xml somefile2.osm --merge --write-pbf somefilemerged.osm.pbf

Create OsmSharp-routing file from an OSM-XML file, in this case for cars only:

odp --read-pbf someregion.osm.pbf --create-routerdb vehicles=car --contract car --write-routerdb someregion.c.cf.routing

Download

Download the latest release from the release page in this repo or download the daily build here.

Reference

All supported switches and options are documented here. A switch basically has an input type and output type. Types can be an input or output file, OSM-data or a router db.

Read/write OSM data

--read-xml

Reads an OSM-XML file and converts to to an OSM-data stream.

  • (default): The path to the OSM-XML file to read from.

Example: --read-xml somefile.osm ...

--write-xml

Write an OSM-data stream to and OSM-XML file.

  • (default): The path to the OSM-XML file to write to.

Example: ... --write-xml somefile.osm

--read-pbf

Reads an OSM-PBF file and converts to to an OSM-data stream.

  • (default): The path to the OSM-PBF file to read from.

Example: --read-pbf somefile.osm.pbf ...

--write-pbf

Write an OSM-data stream to and OSM-PBF file.

  • (default): The path to the OSM-PBF file to write to.

Example: ... --write-pbf somefile.osm.pbf

Read/write/create routing data

--create-routerdb

Creates a routerdb using the current OSM-data stream for the given vehicles.

  • vehicles: The vehicles to create the router db for. Any comma-seperated list of vehicles is acceptable in addition to some helpers like motorvehicles and all.

Example: ... --create-routerdb vehicles=all

--write-routerdb

Writes a routerdb to disk in a format that can be loaded later by OsmSharp or by using --read-routerdb.

  • (default): The file to write the routerdb to.

Example: ... --write-routerdb somefile.routing

--read-routerdb

Reads a routerdb from disk.

  • (default): The file to read the routerdb from.

Example: --read-routerdb somefile.routing ...

Clone this wiki locally