[pgrouting-users] dijkstra_sp result order

Julien-Samuel Lacroix jlacroix at mapgears.com
Fri Nov 13 15:17:39 EST 2009


Hi,

I'm trying to use the wrapper functions dijkstra_sp and astar_sp to find 
the shortest path between to points. However the order of the output 
seems to be wrong.
The following:

   SELECT * FROM astar_sp( 'fcmqrouting19', 80, 3667)

returns an un-ordered list of feature (The first line segment in my path 
come in third place in the result set for example):

id; gid; the_geom
1;  617; "010...4640"
2;  513; "010...640"
3;  121; "010...4640"
4;  618; "0102...640"
5;  2;   "01020...40"
6;  4581;"0102...640"

If I use shortest_path (both astar or dijkstra) functions the order of 
gid returned is:
121, 513, 617, 2, 618, 4581

My questions are:
Is this a known bug?
Is there a way to keep the order of my results and still have the "id" 
column containing the row number (from 1 to 6 in my example)?

Best regards,
Julien

-- 
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/



More information about the Pgrouting-users mailing list