Don't repurpose a node with interesting tags in crossing_ways fix

(closes #8326)
This commit is contained in:
Bryan Housel
2021-01-27 14:38:11 -05:00
parent 2803cd721e
commit 4c1d51348d

View File

@@ -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);