I am trying to get multiple shortest path using A* Algorithm available in PgRouting.
I referred Solution given by UnderDark ( Link of the Stakoverflow Post ) . But it is not giving me proper Output.
MY Query (Simple Query - Without Multiple Path Detection)
SELECT * FROM shortest_path_astar(' SELECT gid as id, source::integer, target::integer, length(the_geom)::double precision as cost, x1, y1, x2, y2 FROM connectivity', 110, 111, false, false);Output of this Query:
vetex_id | edge_id | cost110 | 1 | 0.01235111 | -1 | 0Now Query as suggested by Underdark on Given link:
SELECT source, target,(SELECT SUM(cost) FROM ( --- Complete Above Query Here ) ) AS foo ) AS costFROM connectivity;Output of this Query:
source | target | cost9 | 8 | 0.01235... |... | ...(More 211 records ) Note: In my test table (connectivity) I have 212 Records
So this query is giving me all the records as output without any path relativity.
I do not know where I am doing wrong. any help / suggestion will be helpful for me.
أكثر...
I referred Solution given by UnderDark ( Link of the Stakoverflow Post ) . But it is not giving me proper Output.
MY Query (Simple Query - Without Multiple Path Detection)
SELECT * FROM shortest_path_astar(' SELECT gid as id, source::integer, target::integer, length(the_geom)::double precision as cost, x1, y1, x2, y2 FROM connectivity', 110, 111, false, false);Output of this Query:
vetex_id | edge_id | cost110 | 1 | 0.01235111 | -1 | 0Now Query as suggested by Underdark on Given link:
SELECT source, target,(SELECT SUM(cost) FROM ( --- Complete Above Query Here ) ) AS foo ) AS costFROM connectivity;Output of this Query:
source | target | cost9 | 8 | 0.01235... |... | ...(More 211 records ) Note: In my test table (connectivity) I have 212 Records
So this query is giving me all the records as output without any path relativity.
I do not know where I am doing wrong. any help / suggestion will be helpful for me.
أكثر...