This is just a simple question but I could not find the information in the documentation. If I have an existing pgrouting database table named routing, can I add additional OpenStreetMap data to this table through the osm2pgrouting software? I have some data in the database for Syria roads and I wanted to add additional road information for Turkey, Jordan, and Lebanon. I was not sure if I can just add these osm files to the existing database table, or if I need to drop and load some large osm file that has all of the countries I want.

Note that I did try using the osm2pgrouting tool on a subsequent osm file. The tool seems to have completed okay, though there were some errors on creating some of the relationships and keys, etc. (because they already existed). However, I was not sure if this approach was the right way to go. With so much data added, it would be nice to have a diagnostic to check whether the routing is correct. According to the osm2pgrouting workshop, the osm2pgrouting tool can produce certain types of errors if you are not careful.

1 Answer 1


Adding next countries to existing table is not a good idea, because added data will not be joined with existing one topologically. Although PGRouting provides some functions for creating topology in my opinion there'll be simplest and quickest way to load a new data.

Osmosis will do a good job with joining few countries extracts into one file

osmosis --rx country1.osm --rx country2.osm --merge --wx merged.osm

I'm also suggesting to use osm2po insted of osm2pgrouting since it's quicker and it can process large files with low RAM consumption. In this case here is great quickstart tutorial written by Anita Graser

  • Oh this is an excellent post. I am downloading these softwares now and going to try your suggestions. Thanks for letting me know about the joining issue with new data--that is exactly what I thought might happen.
    – krishnab
    May 8, 2014 at 0:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.