Properly handle disambiguating tags on crossing multipolygons (close #7935)

This commit is contained in:
Quincy Morgan
2020-09-01 17:31:16 -04:00
parent 5ac315e460
commit e5d4fcfa44
+8 -14
View File
@@ -48,12 +48,6 @@ export function validationCrossingWays(context) {
return featureType === 'highway' || featureType === 'railway' || featureType === 'waterway';
}
function getFeatureTypeForCrossingCheck(way, graph) {
var feature = getFeatureWithFeatureTypeTagsForWay(way, graph);
return getFeatureType(feature, graph);
}
// discard
var ignoredBuildings = {
demolished: true, dismantled: true, proposed: true, razed: true
@@ -80,9 +74,7 @@ export function validationCrossingWays(context) {
}
function isLegitCrossing(way1, featureType1, way2, featureType2) {
var tags1 = way1.tags;
var tags2 = way2.tags;
function isLegitCrossing(tags1, featureType1, tags2, featureType2) {
// assume 0 by default
var level1 = tags1.level || '0';
@@ -212,7 +204,8 @@ export function validationCrossingWays(context) {
var edgeCrossInfos = [];
if (way1.type !== 'way') return edgeCrossInfos;
var way1FeatureType = getFeatureTypeForCrossingCheck(way1, graph);
var taggedFeature1 = getFeatureWithFeatureTypeTagsForWay(way1, graph);
var way1FeatureType = getFeatureType(taggedFeature1, graph);
if (way1FeatureType === null) return edgeCrossInfos;
var checkedSingleCrossingWays = {};
@@ -223,7 +216,7 @@ export function validationCrossingWays(context) {
var n1, n2, nA, nB, nAId, nBId;
var segment1, segment2;
var oneOnly;
var segmentInfos, segment2Info, way2, way2FeatureType;
var segmentInfos, segment2Info, way2, taggedFeature2, way2FeatureType;
var way1Nodes = graph.childNodes(way1);
var comparedWays = {};
for (i = 0; i < way1Nodes.length - 1; i++) {
@@ -258,11 +251,12 @@ export function validationCrossingWays(context) {
way2 = graph.hasEntity(segment2Info.wayId);
if (!way2) continue;
taggedFeature2 = getFeatureWithFeatureTypeTagsForWay(way2, graph);
// only check crossing highway, waterway, building, and railway
way2FeatureType = getFeatureTypeForCrossingCheck(way2, graph);
way2FeatureType = getFeatureType(taggedFeature2, graph);
if (way2FeatureType === null ||
isLegitCrossing(way1, way1FeatureType, way2, way2FeatureType)) {
isLegitCrossing(taggedFeature1.tags, way1FeatureType, taggedFeature2.tags, way2FeatureType)) {
continue;
}