Routing/Travel Time Analysis/OSM2Routing

From OpenStreetMap Wiki
Jump to navigation Jump to search

About

Comparision of the OSM map and the routable map

OSM2Routing utility converts the OSM file into a mapmatching/routing-friendly format.

It extracts defined road types from the OSM map and splits them at crossroads.




Usage

 osm2routing [OPTIONS]+
 Options:
       --osm=VALUE        path to the OSM file (required)         
   -c, --config=VALUE     path to the config file (required)          
   -o, --output=VALUE     path to the output file (required)       
   -h, -?, --help

Config file defines accepted road types (OSM ways with specific tags) and their parameters.

Ways, that don't match accepted road types, relations and unused nodes are discarded. Values of oneway and maxspeed tags from the OSM file take precedence over default values from the config file.

OSM2Routing reguires .NET framework runtime or MONO runtime installed on the computer.

Samples

Sample config file (with typical road types): [1]

Sample config file:

 <?xml version="1.0" encoding="utf-8"?>
 <routing-config version="1.0">
   <route-type name="road" speed="50">
     <required-tag key="highway" value="*" />
   </route-type>
 </routing-config>

Sample output:

 <?xml version="1.0" encoding="utf-8"?>
 <osm version="0.5" generator="OSMUtils">
   <node id="15389886" visible="true" lat="54.7308926" lon="25.2397644" />
   <node id="15389895" visible="true" lat="54.7321415" lon="25.2437813" />
   
   ...
   
   <node id="15389899" visible="true" lat="54.7351949" lon="25.2468095" />
   <way id="-2" visible="true">
     <nd ref="41629304" />
     <nd ref="41629457" />
     <tag k="way-id" v="3412414" />
     <tag k="speed" v="50" />
     <tag k="accessible" v="yes" />
     <tag k="accessible-reverse" v="yes" />
   </way>
 </osm>

Details

TTA OSM2Routing.png