Do not warn if path is connected to entrance

(closes #3906)
This commit is contained in:
Bryan Housel
2017-03-17 14:40:55 -04:00
parent 8b35ff449f
commit 0e788717c5
3 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -468,7 +468,7 @@ en:
used_with: "used with {type}"
validations:
disconnected_highway: Disconnected highway
disconnected_highway_tooltip: "Roads should be connected to other roads."
disconnected_highway_tooltip: "Roads should be connected to other roads or building entrances."
untagged_point: Untagged point
untagged_line: Untagged line
untagged_area: Untagged area
+1 -1
View File
@@ -578,7 +578,7 @@
},
"validations": {
"disconnected_highway": "Disconnected highway",
"disconnected_highway_tooltip": "Roads should be connected to other roads.",
"disconnected_highway_tooltip": "Roads should be connected to other roads or building entrances.",
"untagged_point": "Untagged point",
"untagged_line": "Untagged line",
"untagged_area": "Untagged area",
+10 -6
View File
@@ -10,11 +10,15 @@ export function validationDisconnectedHighway() {
return graph.childNodes(entity)
.every(function(vertex) {
return graph.parentWays(vertex)
.filter(function(parent) {
return parent.tags.highway && parent !== entity;
})
.length === 0;
var parents = graph.parentWays(vertex);
if (parents.length === 1) { // standalone vertex
return true;
} else { // shared vertex
return !vertex.tags.entrance &&
parents.filter(function(parent) {
return parent.tags.highway && parent !== entity;
}).length === 0;
}
});
}
@@ -26,7 +30,7 @@ export function validationDisconnectedHighway() {
if (isDisconnectedHighway(entity, graph)) {
warnings.push({
id: 'missing_tag',
id: 'disconnected_highway',
message: t('validations.disconnected_highway'),
tooltip: t('validations.disconnected_highway_tooltip'),
entity: entity