From 777585317a2b05b35f22bec5d370ce7ddc37e65e Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 12 Feb 2018 14:42:39 -0500 Subject: [PATCH] Better inference of u-turns via way --- modules/osm/intersection.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/osm/intersection.js b/modules/osm/intersection.js index 409471add..4f91320e9 100644 --- a/modules/osm/intersection.js +++ b/modules/osm/intersection.js @@ -604,7 +604,9 @@ export function osmInferRestriction(graph, from, to, projection) { if (fromNode === toNode) return 'no_u_turn'; if ((angle < 23 || angle > 336) && fromOneWay && toOneWay) - return 'no_u_turn'; + return 'no_u_turn'; // wider tolerance for u-turn if both ways are oneway + if ((angle < 40 || angle > 319) && fromOneWay && toOneWay && from.vertex !== to.vertex) + return 'no_u_turn'; // even wider tolerance for u-turn if there is a via way (from !== to) if (angle < 158) return 'no_right_turn'; if (angle > 202)