[OSM-dev] Routing over OSM data

Sven Braun sven.braun at gmx.de
Mon Oct 22 21:51:18 BST 2007

that looks really good.
As you has seen i try the same, but with less success :-(

Here I create an similar Routing page.

My way was to create a postgis Database with pgrouting on top.
First I pick the next Roads from the selected start and end point and
then do the routing.

This could work very fine but i have a problem with the data.

I tried to convert the data in two ways with the same problem:
    1. With osm2pgsql
    2. With osm2shp and shp2pgsql

The problem is the following:
The roads are stored in the geometrie table as linestring or 
multilinestring - thats okay.
Now I want to execute the assign_vertex_id function to create the source 
and target fields.
But at this point i have the problem.

Lets consider to have the following 2 roads.

Road A:    LINESTRING (0 2, 10 2)
Road B:    LINESTRING (5 2, 5 0)

Here the assign_vertex_id function doesn't connect both roads.

So I need the segments of the roads like:

Road A1:    LINESTRING (0 2, 5 2)
Road A2:    LINESTRING (5 2, 10 2)
Road B:    LINESTRING (5 2, 5 0)

So I could get an perfect Graph with an very fast routing.

Has someone an idea to create these segments in an easy way from the 
actual planet.osm ?
Or is my intention wrong ?


Christopher Schmidt schrieb:
> http://crschmidt.net/osm/routing-demo.html
>    1. Click "Set Start Point"
>    2. Click on the map
>    3. Click "Set Stop Point"
>    4. Click on the Map, and without letting go, drag around.
> (May take some time to get started the first time, since the machine
> it's running on is somewhat... overused, given the current load average
> of 3/4.)
> Uses http://graphserver.sourceforge.net/ with some hacks on top to load
> the small OSM file at http://crschmidt.net/osm/cambridgeport.osm .
> Currently not entirely scalable, but that's a project for next weekend
> -- this weekend was to just get it working :)
> Brandon has tested Graphserver with OSM graphs of ~20MB and had good
> success -- now I just have to make the rest of the code scale similarly
> :)  
> This is also, for the record, showing the use of OpenLayers reprojection
> support (not in trunk yet) -- you'll notice that it's using the standard
> OSM tiles, but the mouse possition, permalink, etc. are in lat/lon.
> (This is the part that doesn't work in IE, for the record.) This support
> should go into trunk in the next release.   
> Regards,

More information about the dev mailing list