Can anybody guide me to to deal with roundabouts in pgrouting?? I have some roundabouts in my road network and when i try to make route from one point to another, it gives me wrong direction where it finds the shortest path because length on road is my cost.

In the picture below, blue cross is my starting point and other side is mt destination.

enter image description here

I am using simple pgr_dijkstra function and i am not considering any direction. boolean parameter for direction is set false. And there is no information about direction in my data. I just want to know what should I do if I want correct routing on my roundabouts.

thanks in advance

2 Answers 2


There are 2 possibilities, what could be wrong.

(1) You missed to make use of one-way street information as Uffe answered already. In pgRouting this means, that you need to use reverse_cost and then have different cost values for each direction.

See the documentation of Dijkstra algorithm for example, and especially look at the "with reverse_cost" example.

(2) Your data does not contain information about one-way directions. In this case pgRouting can't really help and you need to fix your data.


You have to add information about oneway streets (direction). Which is what a round-about basically is.

  • please explain, i am a newbie
    – osqureshi
    Commented Apr 24, 2014 at 13:00
  • how to do that?
    – osqureshi
    Commented Apr 24, 2014 at 13:03
  • Read the documentation for your software. I'm 100% certain it mentions one-way streets. Commented Apr 24, 2014 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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