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 have a couple of questions related to the shortest path returned by pgrouting. I have this result for example.

edge_id   cost            reverse_cost  x1           y1         x2           y2
1         0.0016861729    1000000       -93.2518843  44.9718147 -93.2527683 44.9707752

160       0.0034403359    1000000       -93.2544283 44.9686054  -93.2527683  44.9707752

Now as you can see the first two results of the shortest path query are showing edges which are one way. It is because the reverse cost is high 1000000. Now if I want to trace out the path of the shortest path then I will join the coordinates like this

(-93.2527683  44.9707752) -> (-93.2527683 44.9707752) -> (-93.2527683 44.9707752)

and soon. Now my question is the coordinate pair (-93.2527683 44.9707752) is common in the first and second edge which are both one ways. Now when joining the coordinates from the second pair, I am joining it like

(-93.2527683 44.9707752) -> (-93.2527683 44.9707752)

which is in opposite direction, so is it fine? I mean the edge is one way but I am joining the coordinates from like (x2,y2) to (x1,y1). Is this correct or I am missing something?

share|improve this question
    
Which shortest path function(dijkstra/astar/shooting star) did you use? And result is an only two edges? –  sanak Jul 12 '12 at 14:15
    
I used dijkstra. No it's just the first two edges, there is a long list of edges. –  user31820 Jul 12 '12 at 19:32
    
Did you use anitagraser's QGIS "pgRoutingLayer" plugin(github.com/anitagraser/pgRoutingLayer)? If so, modify ".qgis/python/plugins/pgRoutingLayer/pgRoutingLayer.py" file's line 135 from 'query = "SELECT "+tableName+".*, route.cost AS route_cost FROM "' to 'query = "SELECT "+tableName+".*, route.vertex_id AS route_vertex_id, route.cost AS route_cost FROM "' and check result "route_vertex_id" columns values. –  sanak Jul 13 '12 at 2:28

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.