Skip to content
Ben Abelshausen edited this page Feb 1, 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.osm.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

This documentation is for the latest beta-release

Download the latest 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

Writes 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

--pr

Writes progress information to the console containing the #nodes/ways/relations begin streamed per second.

--bounding-polygon

Filters the OSM-data by polygon and keeps all nodes inside the given polygon, all ways that have at least one node inside and all relations that have at least one member inside or way with a used node.

  • (default): The .poly file to use for filtering.

--bounding-geojson

Filters the OSM-data by polygon and keeps all nodes inside the polygon found in the given GeoJSON file, all ways that have at least one node inside and all relations that have at least one member inside or way with a used node.

  • (default): The GeoJSON file to use for filtering.

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.
  • allcore:
    • false (default): Only nodes that are relevant will be converted to vertices.
    • true: All nodes in a routable way will be converted to vertices.

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 ...

--optimize

Optimizes the current routerdb by:

  • Removing edges with length 0.
  • Removing vertices with only two neighbours when it doesn't change the meaning of the network.

This options is only useful when using the allcore=true option in --create-routerdb. Otherwise these optimizations are already done while creating the router db.

Example: ... --optimize ...

--contract

Adds a contracted version of the routing network to the router db.

  • (default): The vehicle to contract for. Only one individual vehicle is allowed.

Example: ... --contract car ...