Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
    
you need to assign_vertex_id('<table>', float tolerance, '<geometry column', '<gid>') workshop.pgrouting.org/chapters/topology.html –  Mapperz May 30 '12 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 sthapit May 30 '12 at 17:55

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.