[Routing] Having problems with osm data structure

Frederik Ramm frederik at remote.org
Wed Jul 8 11:43:50 BST 2009


Hi,

IbrahimB22 wrote:
> I downloaded the osm file for Belgium, and then I converted it to a postgis
> database using osm2pgsql.

This converts roads into linestrings and removes topology information, 
i.e. it becomes hard work to reverse-engineer a routing graph from that. 
Don't use osm2pgsql as a basis for routing. There's a tool called 
osm2pgrouting somewhere which you should try if you want to do pgrouting 
(unsure how current the tool is though), or build your own structure 
based on an "osmosis" data import. You will find that OSM stores roads 
not as typical GIS geometries but as a sequence of referenced nodes and 
calls this a "way". A way is basically an edge for your routing graph, 
note that you can remove those nodes from the graph that have only two 
neighbours.

> All in all, I have to say, is that I'm really confused by this.

Writing a thesis ought require a bit of dealing with confusing 
situations otherwise everybody would do it ;-)

Bye
Frederik





More information about the Routing mailing list