[Cartoweb-users] dijkstra - miss up node ID
Fay Du
fay.du at versaterm.com
Wed Jan 11 16:36:04 EST 2006
I believe there is ID miss up.
If you run sample data step by step, there are 3 tables roads,
roads_edges, and roads_ vertices.
In table roads, souce_id and target_id are different with roads_edges.
But the two ids (same node, but it has two different ID in table roads
and roads_edges) are connected by table roads_ vertices. In roads_
vertices, id is the source/target used in roads-edges, and gid is the id
of same node used in tables roads.
Shortest_path asks for id from roads_edges. What you passed are node ID
from Table roads. It is why program cannot find the path.
Fay
-----Original Message-----
From: cartoweb-users-bounces at lists.maptools.org
[mailto:cartoweb-users-bounces at lists.maptools.org] On Behalf Of
Eggenschwiler Raphael
Sent: Tuesday, January 10, 2006 9:10 AM
To: cartoweb-users at lists.maptools.org
Subject: [Cartoweb-users] dijkstra
Hi everyone !
I try to use this pgdijkstra on my data with :
SELECT arc_num_nod_src as "source",arc_num as "id",arc_num_nod_des as
"target",arc_cost as "cost" FROM TAB_ARC;
source id target cost
0 6259 4769 0
4769 6260 4770 0
4770 6261 4771 0
4771 6262 4772 0
4772 6263 4773 0
0 6264 4775 0
4775 6265 4776 0
4776 6266 4777 0
4777 6267 4778 0
4778 6268 4779 0
4779 6269 4780 0
4780 6270 4781 0
0 6271 4783 0
4783 6272 4784 0
4784 6273 4785 0
4785 6274 4786 0
4786 6275 4787 0
4787 6276 4788 0
4788 6277 4789 0
4789 6278 4790 0
0 6279 4792 0
4792 6280 4793 0
But when I try this one :
select * from shortest_path('SELECT arc_num_nod_src as "source",arc_num
as "id",arc_num_nod_des as "target",arc_cost as "cost" FROM
TAB_ARC',4769,4770,false,false);
I become this message :
ERROR: Error computing path: Source vertex not found
Can someone help me ??
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20060111/87940938/attachment.html
More information about the Cartoweb-users
mailing list