text: Forbidding U-Turns - possible? - Open Source Routing Engine - GraphHopper Forum
  Forbidding U-Turns - possible?
  sanwer December 11, 2019, 1:23pm #1
  Hi all, had a question I was hoping someone could help me with.
  Basically, I'd like to know whether it's possible to forbid u-turns (or at the very least, add a penalty of some sort) while finding a route? I know we can deal with forbidden turns by adding "ch.disable = true", but I'd like to reduce and possibly completely forbid u-turns altogether.
  EDIT: Just to follow up: is there a way of identifying these U-turns, if we can't forbid them?
  karussell December 11, 2019, 5:07pm #2
  A screenshot or link to GraphHopper Maps would help where you experience u-turns. If you mean u-turns at via points you can try pass_through=true or try the new curbside=right (only in 1.0-preX)
  sanwer January 6, 2020, 12:08pm #3
  Hi karussell, I'll try to cook up a simple example later and post a screenshot. But this happens when there are multiple stops. So, for instance,the vehicle gets to the stop 2, stops, then makes a u-turn back on the road to get to stop 3. Now, there will be some cases where this will be unavoidable, but it's possible in some cases to take another road (even though it will take slightly longer, which I am ok with).
  karussell January 6, 2020, 12:46pm #4
  This is possible via pass_through - see the API docs: https://github.com/graphhopper/graphhopper/blob/0.13/docs/web/api-doc.md
  Or use edge-based configuration and curbside=right
  sanwer January 6, 2020, 1:18pm #5
  Oh, that worked great. Thank you!
  sanwer January 17, 2020, 11:15am #6
  As a follow up to this question - there are some cases where a U-turn would obviously be unavoidable (such as when houses are down a cul-de-sac or a dead end). Is there a way in Graphhopper to detect (from a list of lat-long locations) such locations which are down a cul-de-sac?
  easbar January 24, 2020, 8:43am #7
  No currently there is no special functionality that can be used to detect dead ends. If you are thinking about doing this in code it should be rather simple: Just iterate over all nodes and count the number of adjacent edges.