« Return to Thread: How to identify start node and end node in shortest_path_astar when the user click 2 points on the map?

How to identify start node and end node in shortest_path_astar when the user click 2 points on the map?

by Nguyen Thi Van An :: Rate this Message:

Reply to Author | View in Thread

Hi everybody,

I'm  doing a project which needs to find a shortest path between two
user's clicked points. I already  installed successfully  pgRouting.

I use this function:
SELECT * from shortest_path_astar('SELECT gid as id, source, target,
length as cost, x1, y1, x2, y2 FROM roads', 3, 7, false, false);

But the problem is that I can't identify exactly the start node and end
node to find path (How to identify node 3 and node 7?). I already have
the start point and end point of the user. But they don't select
correctly the points on my roads. So I can't draw the path correctly on
the map (The path begins with their start clicked point and ends with
their end clicked point)

Anybody has experiences with this? Please help me!

Thanks so much.
_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users

 « Return to Thread: How to identify start node and end node in shortest_path_astar when the user click 2 points on the map?