11

I'm creating a routing application using OpenStreetMap. Currently, my task is to convert the data from an OSM file to PostgreSQL.

I read about osm2pgsql, but the problem is it says there that osm2pgsql is not suited for routing. I read about Osmosis too, but there is something about rails port, which I think means I need to learn Ruby in Rails. I tried studying RoR in the past and I found it too difficult for me to learn.

I'm using PHP for my application. How can I able to extract the data from the OSM file and export it to my PostgreSQL. I know I might be missing something here, but I'm a newbie when it comes to mapping application. I hope someone can help me. Thanks! :D

underdark
84.9k22 gold badges237 silver badges419 bronze badges
asked Sep 7, 2010 at 9:49
0

2 Answers 2

11

Routing in Postgres / PostGIS is handled by the pgRouting library from http://pgrouting.org

It looks like a script has already been written to handle osm straight into pgRouting at http://www.pgrouting.org/docs/tools/osm2pgrouting.html

You will need to install pgRouting within Postgres before running the osm2pgrouting script.

cengel
3,2742 gold badges20 silver badges30 bronze badges
answered Sep 7, 2010 at 23:18
2
  • The link is now: pgrouting.org/docs/tools/osm2pgrouting.html Commented Jul 28, 2011 at 7:05
  • thanks, have edited my original answer to reflect this update. I could not find the fully worked example, so I have removed this link. Commented Jul 28, 2011 at 23:14
3

Also pay your attention to osm2po (http://osm2po.de) - it could generate sql scripts compatible with pgRouting and in some cases it easier to use than osm2pgrouting (for example on MS Windows platform as osm2po is written in Java).

answered Mar 6, 2013 at 7:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.