[pgrouting-users] PgRouting-Problems with own OSM-data

Stephen Woodbridge woodbri at swoodbridge.com
Sat Apr 11 13:11:05 EDT 2009


Kai Behncke wrote:
> Dear users,
> 
> I try to use own osm-geodata for routing. I took them as an shapefile-extract and brought
> them to PostgreSQL/PostGIS (so I thought they would have a correct topology) but it doesn`t seem so.
> 
> Problem one:
> 
> 
> The most time I try to get a result I don`t get anything.
> You can see in the following picture:
> 
> Screenshot 1:
> http://www.selbstverwaltung-bundesweit.de/no_result.png

This problem may be because the start and stop point are almost vertical 
and the code uses these two points to construct a bounding box to select 
street segments from to run the analysis. It adds a buffer to the bbox 
but it might not be enough to capture all the segments need for a 
solution. You can change the buffer size in pgpsql code. ou might want 
to use and algorithm like if the bbox is nearly horizontal or vertical 
then make is square based on the larger dimension. This is have a small 
performance penalty but you will get less failures.

> The xml-result then is:
> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
> 
> <route>
> 
> </route> 
> 
> Problem 2:
> 
> 
> If I get a result it`s mostly wrong, as you can see here:
> 
> 
> Screenshot 2:
> http://www.selbstverwaltung-bundesweit.de/too_long.png
> 
> The route is far too long.
> 
> How can this be?

This might depend on which analysis you requested. The shooting star 
evaluates based on edges and I do not think it trims the edges. Where 
the dijkstra's evaluates nodes and adds the start and stop node. I had 
to modify the code to trim segments, unfortunately those changes are 
mixed in with a bunch of other changes that I made and not easy to extract.

> In the victoria-example it works nice:
> 
> Screenshot 3:
> http://www.selbstverwaltung-bundesweit.de/correct.PNG
> 
> 
> I changed the code from the tutorial (foss4g2007) a bit to adapt the example to OpenLayers 2.7, so I don`t use
> <script src="./OpenLayers-google/lib/OpenLayers.js">
> 
> but 
> 
> <script src="../../lib/OpenLayers.js">
> 
> ...but I think this shouldn`t create the problem.
> I guess it`s more a geodata-problem?
> 
> Problem 2 could be occur because the edges of the geometry are too long, right?
> But does it mean in the victoria-data e.g. that a road is separated into many,many short edges? I wonder why in sreenshot 3 the route ends at the red point (and not at the end of the road, what would be the case with my data).
> 
> 
> I really don`t understand problem 1 because the geodata exist where I put start and finalpoint. Has anybody an explanation for that?
> 
> Thank you very much, Kai

hope this explains it.

-Steve



More information about the Pgrouting-users mailing list