Build path with pgr_dijkstra without shortcuts #2101
-
Hi! This is the result of the routing using pgr_dijkstra algorithm.
The edges have been built manually, and the vertices are created using the function
Why would algorithm build such a long path, what could be possible reasons?
P.S. I have built an algorithm which does not use pgr_createTopology, but builds it dynamically using points, interpolated from blue linestrings you see on a screenshot below. The issue on this one has been posted at https://gis.stackexchange.com/questions/409136/pgrouting-build-path-without-shortcuts You can also find a code a had built for it there. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
Your
pgr_dijkstra
is for a directed graph.This is your query:
The graph that is been built by the inner query and the flag visually speaking looks like the image bellow where I added arrows.
As you can not go using the wrong way, it will never give you the expected answer
Because of this instruction:
st_length(…