crossing_ways fixing - specially handle crossing nodes

This commit is contained in:
Milos Brzakovic
2021-08-05 14:50:38 +02:00
parent 057891643c
commit 750b4e023f
2 changed files with 6 additions and 1 deletions
+4
View File
@@ -141,6 +141,10 @@ Object.assign(osmNode.prototype, {
return utilArrayUniq(results);
},
isCrossing: function(){
return this.tags.highway === 'crossing' ||
this.tags.railway && this.tags.railway.indexOf('crossing') !== -1;
},
isEndpoint: function(resolver) {
return resolver.transient(this, 'isEndpoint', function() {
+2 -1
View File
@@ -721,7 +721,8 @@ export function validationCrossingWays(context) {
var edgeNodes = [graph.entity(edge[0]), graph.entity(edge[1])];
var nearby = geoSphericalClosestNode(edgeNodes, loc);
// if there is already a suitable node nearby, use that
if (!nearby.node.hasInterestingTags() && nearby.distance < mergeThresholdInMeters) {
// use the node if node has no interesting tags or if it is a crossing node #8326
if ((!nearby.node.hasInterestingTags() || nearby.node.isCrossing()) && nearby.distance < mergeThresholdInMeters) {
nodesToMerge.push(nearby.node.id);
// else add the new node to the way
} else {