-
Notifications
You must be signed in to change notification settings - Fork 2
Home
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.
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
This documentation is for the latest beta-release
Download the latest daily build here.
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.
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 ...
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
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 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
Writes progress information to the console containing the #nodes/ways/relations begin streamed per second.
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.
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.
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
andall
. - 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
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
Reads a routerdb from disk.
- (default): The file to read the routerdb from.
Example: --read-routerdb somefile.routing ...
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 ...
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 ...