Make the crossing_ways hash less strict

Previously it was including a lot of data about the edge, and a very specific
crossing location.  This meant that any tiny perturbation in the crossing ways
would generate a new issue hash, effectively "fixing" the old crossing issue and
creating a new one.
This commit is contained in:
Bryan Housel
2021-08-13 16:24:29 -04:00
parent 34c3ea472d
commit 1f172d5623
+4 -7
View File
@@ -8,7 +8,7 @@ import { geoAngle, geoExtent, geoLatToMeters, geoLonToMeters, geoLineIntersectio
import { osmNode } from '../osm/node';
import { osmFlowingWaterwayTagValues, osmPathHighwayTagValues, osmRailwayTrackTagValues, osmRoutableHighwayTagValues } from '../osm/tags';
import { t } from '../core/localizer';
import { utilDisplayLabel, utilHashcode } from '../util';
import { utilDisplayLabel } from '../util';
import { validationIssue, validationIssueFix } from '../core/validation';
@@ -395,10 +395,8 @@ export function validationCrossingWays(context) {
crossingTypeID += '_connectable';
}
// include crossing point, edges (sorted for determinism), and connection tags
var uniqueID = crossing.crossPoint.toString() +
edges.slice().sort(function(edge1, edge2) { return edge1[0] < edge2[0] ? -1 : 1; }).toString() +
JSON.stringify(connectionTags);
// Differentiate based on the loc rounded to 4 digits, since two ways can cross multiple times.
var uniqueID = '' + crossing.crossPoint[0].toFixed(4) + ',' + crossing.crossPoint[1].toFixed(4);
return new validationIssue({
type: type,
@@ -422,8 +420,7 @@ export function validationCrossingWays(context) {
featureTypes: featureTypes,
connectionTags: connectionTags
},
// differentiate based on the loc since two ways can cross multiple times
hash: utilHashcode(uniqueID),
hash: uniqueID,
loc: crossing.crossPoint,
dynamicFixes: function(context) {
var mode = context.mode();