feat(geo): cross-check block heights against Mapbox building data (#25)

Merged PR #25: Mapbox building-height cross-check

Co-authored-by: Zwitschi <zwitschi82@gmail.com>
This commit was merged in pull request #25.
This commit is contained in:
zwitschi authored and zwitschi committed 2026-11-08 16:31:39 +01:00
1 parent 68d8745534
commit 81f7cd3991
10 files changed
+476 -3

No files matched your search

+7 -2
View File
@@ -29,8 +29,13 @@ def classify_height(tags, level_height=LEVEL_HEIGHT):
rule and the "height tag beats levels beats guess" order are the parts that
actually decide what the blockout should render.
"""
if tags.get("building") == "roof" or tags.get("amenity") == "shelter":
kind = "roof" if tags.get("building") == "roof" else "shelter"
# Not building volumes: elevated roof/canopy structures and transit shelters.
# Found by cross-checking against Mapbox's building data
# (Geo/tools/mapbox_buildings.py), which returns roof/canopy/shelter for the
# same footprints instead of a storey count.
building = tags.get("building")
if building in ("roof", "canopy") or tags.get("amenity") == "shelter":
kind = building if building in ("roof", "canopy") else "shelter"
return 0.0, f"not a building volume ({kind})"
if tags.get("height"):
return float(tags["height"]), "height tag"