From OpenStreetMap Wiki
Jump to navigation Jump to search
Pyroute in cycle mode, avoiding big roads and giving a quiet cycle route through back-streets and cycle paths (see image description for more details)
Shown with tiles@home images in the background

This page is about running pyroute from the command-line, or using it as a library from Python programs. For the graphical interface, see Pyroute

Background info

See the original web page:

Download and installing it

Source code:

Installing goes very simple on Linux run the command

 svn co

An alternative repository which supports Python 3 and the new v0.6 API (using osmapi package) can be found at Install using:

 git clone

Running the program

Simple routing

Run the command: osmfile.osm startnode endnode transportType

To get a list of nodes

Route to OSM or GPX file

To produce an OSM XML file containing the route (for loading into JOSM, or rendering using osmarender etc: osmfile.osm startnode endnode transportType description

To get a GPX XML file, that you can upload to your GPS: osmfile.osm startnode endnode transportType description

Test if an OSM file is compatible

To test if it can load an OSM file, and how long it takes: dataFile.osm transportType

Original-style pyroute

Will generate a PNG image showing all the streets, the route, and highlighting the roads and nodes that it considered routing along (good debug tool for routing algorithms) dataFile.osm node1 node2