Easily import OpenStreetMap data into a pgRouting database using osm2pgrouting tool.
osm2pgrouting was primarily written by Daniel Wendt and is now hosted on the pgRouting project site.
osm2pgrouting Features
- Uses XML configuration file to select road types and classes to import
- Creates types and classes tables, which can help to create sophisticated cost functions
Requirements
If you already installed pgRouting, you should have all required libraries/packages.
- PostgreSQL
- PostGIS
- pgRouting
Currently osm2pgrouting is only tested on Linux distributions.
How to install osm2pgrouting
Get the latest version from SVN:
svn checkout http://pgrouting.postlbs.org/svn/pgrouting/tools/osm2pgrouting/trunk osm2pgrouting
Then compile it:
make
How to use osm2pgrouting
Start the program like this:
./osm2pgrouting -file your-OSM-XML-File.osm -conf mapconfig.xml -dbname routing -user postgres -clean
all available parameters are:
required: -file <file> -- name of your osm xml file -dbname <dbname> -- name of your database -user <user> -- name of the user, which have write access to the database -conf <file> -- name of your configuration xml file optional: -host <host> -- host of your postgresql database (default: 127.0.0.1) -port <port> -- port of your database (default: 5432) -passwd <passwd> -- password for database access -clean -- drop peviously created tables

