[pgrouting-users] Different result from tutorial

Jose Carlos Martinez jomarlla at cgf.upv.es
Thu Dec 1 06:58:24 EST 2011


Hi List, this is my first post in this list so first of all I want to 
say thanks to the pgrouting team for this project.
Now the question:

I followed an example from the tutorial wrote by David Techer. With a 
previous version of pgrouting everything was fine (I tried it a couple 
of years ago) but now I have
ubuntu maverick plus pgrouting 1.05 from georepublic repository and im 
getting weird  results.

This path is traversing the roundabout in opposite direction (6,5,4 
edges instead of 1,2,3 edges) . (Im using the original file 
pgrouting_wr.sql from the tutorial so it was expected to get the same 
result).

routing2=# select * from shortest_path_shooting_star ('select gid as id, 
source, target, cost, reverse_cost,x1,y1,x2,y2, to_cost, rule from wr', 
20, 8, true, true);
  vertex_id | edge_id |       cost
-----------+---------+------------------
         15 |      20 | 48.3246366252935
         16 |      18 | 38.0005743220152
         13 |      17 | 39.2224758594282
         14 |      15 | 39.4286821133412
         11 |      16 | 29.9822270236865
         12 |      13 | 38.6094358307609
         10 |      12 | 25.9044654619518
          8 |      11 |               60
          2 |       9 |               40
          1 |       7 | 53.8753258085636
          4 |       6 | 12.8311604873812
         29 |       5 | 10.6864968606796
         27 |       4 | 14.2572101668807
          6 |       8 | 62.5380849791951



If I exchange the starting and end node the I get the same result!! 
(4,5,6 edges)


routing2=# select * from shortest_path_shooting_star ('select gid as id, 
source, target, cost, reverse_cost,x1,y1,x2,y2, to_cost, rule from wr', 
8, 20, true, true);
  vertex_id | edge_id |       cost
-----------+---------+------------------
          5 |       8 | 62.5380849791951
          6 |       4 | 14.2572101668807
         27 |       5 | 10.6864968606796
         29 |       6 | 12.8311604873812
          4 |       7 | 53.8753258085636
          1 |       9 |               40
          2 |      10 | 33.4201752293529
         12 |      13 | 38.6094358307609
         10 |      14 | 29.5829181472758
         14 |      17 | 39.2224758594282
         13 |      18 | 38.0005743220152
         16 |      20 | 48.3246366252935

Im getting strange results with Dijkstra too like pgrouting is choosing 
cost with 10000 values

Definitely Im doing something wrong but dont know what.
Any help would be very appreciated.
Best,
Jose




More information about the Pgrouting-users mailing list