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
+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