From bb5e9e063dae210f19515b427f94c951a8b0f2a8 Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Sat, 15 Jul 2023 19:44:32 +0200 Subject: [PATCH] don't trigger line-is-area warning for tags implemented as 2 geometry-dedicated presets e.g. `highway=elevator` in the "Elevator" and "Inclined Lift" presets --- CHANGELOG.md | 1 + modules/validations/mismatched_geometry.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a3a71baf..40ac0d979 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :camera: Street-Level #### :white_check_mark: Validation #### :bug: Bugfixes +* Validator: Don't falsely flag certain tags as "should be a closed area" if the tag also allows both area and line geometries in two separate presets (e.g. `highway=elevator` in the "Elevator" and "Inclined Lift" presets) #### :earth_asia: Localization #### :hourglass: Performance #### :mortar_board: Walkthrough / Help diff --git a/modules/validations/mismatched_geometry.js b/modules/validations/mismatched_geometry.js index 661190e3b..4175f48ba 100644 --- a/modules/validations/mismatched_geometry.js +++ b/modules/validations/mismatched_geometry.js @@ -1,4 +1,5 @@ import deepEqual from 'fast-deep-equal'; + import { actionAddVertex } from '../actions/add_vertex'; import { actionChangeTags } from '../actions/change_tags'; import { actionMergeNodes } from '../actions/merge_nodes'; @@ -27,7 +28,7 @@ export function validationMismatchedGeometry() { var asLine = presetManager.matchTags(tagSuggestingArea, 'line'); var asArea = presetManager.matchTags(tagSuggestingArea, 'area'); - if (asLine && asArea && asLine === asArea) { + if (asLine && asArea && deepEqual(asLine.tags, asArea.tags)) { // this tag also allows lines and making this an area wouldn't matter return null; }