Skip to content

#11775 Validation: Remove layer fixes for building overlaps; recommend level tags#11822

Open
ak8abhinay wants to merge 1 commit intoopenstreetmap:developfrom
ak8abhinay:fix/remove-building-layer-suggestions
Open

#11775 Validation: Remove layer fixes for building overlaps; recommend level tags#11822
ak8abhinay wants to merge 1 commit intoopenstreetmap:developfrom
ak8abhinay:fix/remove-building-layer-suggestions

Conversation

@ak8abhinay
Copy link

This PR modifies the crossing_ways validation logic to prevent the iD Editor from suggesting "Tag as higher" or "Tag as lower" (which adds layer=*) when two building features overlap.

The Problem Currently, mappers often use the "Quick Fix" layer buttons to silence validation warnings for overlapping buildings. This creates "layer soup"—data where buildings are incorrectly marked as floating in the air. Per community best practices and my recommendation [2026-01-15], buildings should stay on layer=0. If they are physically stacked, the level tag is the correct way to map them.

The Fix

Logic: Updated modules/validations/crossing_ways.js to identify building-on-building overlaps and suppress the changeLayer fixes.

Education: Updated the validation message in core.yaml to explicitly guide mappers toward using the level tag instead of layer.

Validation

Verified that "Tag as higher/lower" buttons are hidden for building-building crossings.

Verified that these buttons still appear for valid cases, such as bridges or tunnels (non-building crossings)

Closes #11775

@ak8abhinay ak8abhinay force-pushed the fix/remove-building-layer-suggestions branch from bd187c3 to 3ded861 Compare February 2, 2026 03:35
building-building:
reference: "Buildings should not intersect except on different layers."
message: "Buildings should not intersect. If they are vertically stacked, please use the level tag instead of layer."
reference: "Buildings should not intersect. If they are vertically stacked, please use the **level** tag instead of **layer**."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? If they are in fact vertically stacked buildings then layer is appropriate.

level is for this on different levels (and BTW things on single level may be still vertically stacked)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is wiki advising this anywhere?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Key:layer Wiki page advises for buildings in the final para :

'Ways in buildings... should be mostly described with level= instead of layer.'

After looking at the review, I've realized my current code logic is incomplete. While I've updated the message, the validation still incorrectly allows layer as a fix, which is inconsistent. As these changes were made some time ago, I’d like to take some time to properly review and adjust the implementation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Ways in buildings... should be mostly described with level= instead of layer.'

it refers to ways in buildings, not to buildings themselves

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not entirely sure is layer= proper solution of vertically stacked buildings*, but level= is surely not - as it refers to position within a building.

*this is distinct form whether pushing mapper to add fake layer= instead of fixing almost certainly bad geometries is appropriate - hiding "just add layers" when both are buildings makes sense to me

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand now. I’ll re-evaluate how overlapping building features should be handled in the validator and adjust the logic accordingly.

fixes.push(makeChangeLayerFix('higher'));
fixes.push(makeChangeLayerFix('lower'));
// For overlapping buildings, do not suggest changing the `layer=*` tag.
// Vertically stacked buildings should use `level=*` instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least also here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the check if (!isBothBuildings) here to specifically disable the 'Make Higher' and 'Make Lower' layer buttons for building-to-building overlaps.

By removing these buttons, we stop the editor from suggesting layer as an automated fix and encourage mappers to handle manual fix or fix the geometry. However, I've realized my current logic is a bit inconsistent since the validator still technically allows the tag, so I will review this and come up with proper implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding higher or lower to overlapping buildings

2 participants