Skip to content

Commit

Permalink
Allow the layer and level tag to differentiate very close points (c…
Browse files Browse the repository at this point in the history
…lose #6612)
  • Loading branch information
quincylvania committed Jul 5, 2019
1 parent 3d9bcc8 commit 8003e7b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,8 @@ en:
title: Use a bridge or tunnel
use_different_layers:
title: Use different layers
use_different_layers_or_levels:
title: Use different layers or levels
use_different_levels:
title: Use different levels
use_tunnel:
Expand Down
3 changes: 3 additions & 0 deletions dist/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1952,6 +1952,9 @@
"use_different_layers": {
"title": "Use different layers"
},
"use_different_layers_or_levels": {
"title": "Use different layers or levels"
},
"use_different_levels": {
"title": "Use different levels"
},
Expand Down
17 changes: 17 additions & 0 deletions modules/validations/close_nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,19 @@ export function validationCloseNodes(context) {
if (nearby.loc === node.loc ||
geoSphericalDistance(node.loc, nearby.loc) < pointThresholdMeters) {

// allow very close points if the z-axis varies
var zAxisKeys = { layer: true, level: true };
var zAxisDifferentiates = false;
for (var key in zAxisKeys) {
var nodeValue = node.tags[key] || '0';
var nearbyValue = nearby.tags[key] || '0';
if (nodeValue !== nearbyValue) {
zAxisDifferentiates = true;
break;
}
}
if (zAxisDifferentiates) continue;

issues.push(new validationIssue({
type: type,
severity: 'warning',
Expand All @@ -151,6 +164,10 @@ export function validationCloseNodes(context) {
new validationIssueFix({
icon: 'iD-operation-disconnect',
title: t('issues.fix.move_points_apart.title')
}),
new validationIssueFix({
icon: 'iD-icon-layers',
title: t('issues.fix.use_different_layers_or_levels.title')
})
]
}));
Expand Down

0 comments on commit 8003e7b

Please sign in to comment.