From 4c1d51348da76fc7afc3052ad1fafb10c12ade0b Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 27 Jan 2021 14:38:11 -0500 Subject: [PATCH] Don't repurpose a node with interesting tags in crossing_ways fix (closes #8326) --- modules/validations/crossing_ways.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/validations/crossing_ways.js b/modules/validations/crossing_ways.js index e140059ef..ec38a7f82 100644 --- a/modules/validations/crossing_ways.js +++ b/modules/validations/crossing_ways.js @@ -719,10 +719,10 @@ export function validationCrossingWays(context) { edges.forEach(function(edge) { var edgeNodes = [graph.entity(edge[0]), graph.entity(edge[1])]; - var closestNodeInfo = geoSphericalClosestNode(edgeNodes, loc); - // if there is already a point nearby, use that - if (closestNodeInfo.distance < mergeThresholdInMeters) { - nodesToMerge.push(closestNodeInfo.node.id); + var nearby = geoSphericalClosestNode(edgeNodes, loc); + // if there is already a suitable node nearby, use that + if (!nearby.node.hasInterestingTags() && nearby.distance < mergeThresholdInMeters) { + nodesToMerge.push(nearby.node.id); // else add the new node to the way } else { graph = actionAddMidpoint({loc: loc, edge: edge}, node)(graph);