mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 13:59:27 +02:00
Cherry pick crossing buildings fix
This commit is contained in:
+2
-2
@@ -1369,9 +1369,9 @@ en:
|
||||
building-building:
|
||||
reference: "Buildings should not intersect except on different layers."
|
||||
building-highway:
|
||||
reference: "Highways crossing buildings should use bridges, tunnels, coverings, or entrances."
|
||||
reference: "Highways crossing buildings should use bridges, tunnels, or different layers."
|
||||
building-railway:
|
||||
reference: "Railways crossing buildings should use bridges or tunnels."
|
||||
reference: "Railways crossing buildings should use bridges, tunnels, or different layers."
|
||||
building-waterway:
|
||||
reference: "Waterways crossing buildings should use tunnels or different layers."
|
||||
highway-highway:
|
||||
|
||||
Vendored
+2
-2
@@ -1682,10 +1682,10 @@
|
||||
"reference": "Buildings should not intersect except on different layers."
|
||||
},
|
||||
"building-highway": {
|
||||
"reference": "Highways crossing buildings should use bridges, tunnels, coverings, or entrances."
|
||||
"reference": "Highways crossing buildings should use bridges, tunnels, or different layers."
|
||||
},
|
||||
"building-railway": {
|
||||
"reference": "Railways crossing buildings should use bridges or tunnels."
|
||||
"reference": "Railways crossing buildings should use bridges, tunnels, or different layers."
|
||||
},
|
||||
"building-waterway": {
|
||||
"reference": "Waterways crossing buildings should use tunnels or different layers."
|
||||
|
||||
@@ -75,10 +75,10 @@ export function uiFieldRadio(field, context) {
|
||||
|
||||
|
||||
function structureExtras(selection, tags) {
|
||||
var selected = selectedKey();
|
||||
var selected = selectedKey() || tags.layer !== undefined;
|
||||
var type = context.presets().field(selected);
|
||||
var layer = context.presets().field('layer');
|
||||
var showLayer = (selected === 'bridge' || selected === 'tunnel');
|
||||
var showLayer = (selected === 'bridge' || selected === 'tunnel' || tags.layer !== undefined);
|
||||
|
||||
|
||||
var extrasWrap = selection.selectAll('.structure-extras-wrap')
|
||||
|
||||
@@ -49,18 +49,12 @@ export function validationCrossingWays(context) {
|
||||
return hasTag(tags, 'level') || tags.highway === 'corridor';
|
||||
}
|
||||
|
||||
function allowsStructures(featureType) {
|
||||
return allowsBridge(featureType) || allowsTunnel(featureType);
|
||||
}
|
||||
function allowsBridge(featureType) {
|
||||
return featureType === 'highway' || featureType === 'railway' || featureType === 'waterway';
|
||||
}
|
||||
function allowsTunnel(featureType) {
|
||||
return featureType === 'highway' || featureType === 'railway' || featureType === 'waterway';
|
||||
}
|
||||
function canCover(featureType) {
|
||||
return featureType === 'building';
|
||||
}
|
||||
|
||||
|
||||
function getFeatureTypeForCrossingCheck(way, graph) {
|
||||
@@ -121,20 +115,12 @@ export function validationCrossingWays(context) {
|
||||
} else if (allowsTunnel(featureType1) && hasTag(tags1, 'tunnel')) return true;
|
||||
else if (allowsTunnel(featureType2) && hasTag(tags2, 'tunnel')) return true;
|
||||
|
||||
if (canCover(featureType1) && canCover(featureType2)) {
|
||||
if (hasTag(tags1, 'covered') && !hasTag(tags2, 'covered')) return true;
|
||||
if (!hasTag(tags1, 'covered') && hasTag(tags2, 'covered')) return true;
|
||||
// crossing covered features that can themselves cover must use different layers
|
||||
if (hasTag(tags1, 'covered') && hasTag(tags2, 'covered') && layer1 !== layer2) return true;
|
||||
} else if (canCover(featureType1) && hasTag(tags2, 'covered')) return true;
|
||||
else if (canCover(featureType2) && hasTag(tags1, 'covered')) return true;
|
||||
|
||||
// don't flag crossing waterways and pier/highways
|
||||
if (featureType1 === 'waterway' && featureType2 === 'highway' && tags2.man_made === 'pier') return true;
|
||||
if (featureType2 === 'waterway' && featureType1 === 'highway' && tags1.man_made === 'pier') return true;
|
||||
|
||||
if (!allowsStructures(featureType1) && !allowsStructures(featureType2)) {
|
||||
// if no structures are applicable, the layers must be different
|
||||
if (featureType1 === 'building' || featureType2 === 'building') {
|
||||
// for building crossings, different layers are enough
|
||||
if (layer1 !== layer2) return true;
|
||||
}
|
||||
return false;
|
||||
@@ -423,10 +409,13 @@ export function validationCrossingWays(context) {
|
||||
} else {
|
||||
useFixID = 'use_different_layers';
|
||||
}
|
||||
if (useFixID === 'use_different_layers') {
|
||||
if (useFixID === 'use_different_layers' ||
|
||||
featureType1 === 'building' ||
|
||||
featureType2 === 'building') {
|
||||
fixes.push(makeChangeLayerFix('higher'));
|
||||
fixes.push(makeChangeLayerFix('lower'));
|
||||
} else {
|
||||
}
|
||||
if (useFixID !== 'use_different_layers') {
|
||||
fixes.push(new validationIssueFix({
|
||||
icon: useFixIcon,
|
||||
title: t('issues.fix.' + useFixID + '.title')
|
||||
|
||||
Reference in New Issue
Block a user