I am having some issues when using pgrouting's shortest path. I am following this tutorial available at http://workshop.pgrouting.org/chapters/shortest_path.html#dijkstra. This query returns a list of edges. Then I get the start and end points of each edge. Then I just join these points to show the shortest path. Just to let you know that I don't necessarily get the ending point of the first edge in the list to be the starting point of the second edge in the list returned. So I join, the ending and starting points of the two edges as well. However, sometimes the points are repeated and I have lines crossing over each other and the path looks a mess. What could be the reason behind this?
-
you need to assign_vertex_id('<table>', float tolerance, '<geometry column', '<gid>') workshop.pgrouting.org/chapters/topology.html– Mapperz ♦Commented May 30, 2012 at 15:32
-
I already have it. I actually used osm2p tool to create the table consisting of the edges with their corresponding vertices– rajan sthapitCommented May 30, 2012 at 17:55
Add a comment
|
1 Answer
The result of shortest path is not ordered. Therefore you cannot rely on it. To visualize the results, you could use the edge geometries instead.