Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having some issues when using pgrouting's shortest path. I am following this tutorial available at 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>') – 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

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
Do you know any way to order them in postgressql? – Del Pedro Feb 4 at 9:08

Your Answer


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.