fix(geo): the three "guessed" block heights are a roof, a roof and a bus shelter (#23)
Merged PR #23: block height classification + hero proportions recorded Co-authored-by: Zwitschi <zwitschi82@gmail.com>
This commit was merged in pull request #23.
This commit is contained in:
1 parent
6a778dbc63
commit
420f863999
2 files changed
+13
-5
No files matched your search
@@ -45,7 +45,14 @@ def main():
|
||||
continue
|
||||
tag_height = tags.get("height")
|
||||
levels = tags.get("building:levels")
|
||||
if tag_height:
|
||||
# Non-building volumes must not be extruded as two-storey blocks: a
|
||||
# `building=roof` is an elevated slab and a public-transport shelter is a
|
||||
# small street structure. Treating them as "2 levels x 3.2 m" produced a
|
||||
# 6.4 m block for a bus shelter and a canopy.
|
||||
if tags.get("building") == "roof" or tags.get("amenity") == "shelter":
|
||||
kind = "roof" if tags.get("building") == "roof" else "shelter"
|
||||
height, source = 0.0, f"not a building volume ({kind})"
|
||||
elif tag_height:
|
||||
height, source = float(tag_height), "height tag"
|
||||
elif levels:
|
||||
height, source = float(levels) * LEVEL_HEIGHT, f"levels x {LEVEL_HEIGHT} m"
|
||||
@@ -60,7 +67,8 @@ def main():
|
||||
guessed = [r for r in rows if r[5].startswith("GUESS")]
|
||||
print(f"{len(rows)} buildings in the block, {len(guessed)} with a guessed height\n")
|
||||
for side, setback, wid, name, height, source in rows:
|
||||
flag = " <-- guessed" if source.startswith("GUESS") else ""
|
||||
flag = (" <-- guessed" if source.startswith("GUESS")
|
||||
else (" <-- not a building volume" if source.startswith("not a building") else ""))
|
||||
print(f"{side} way {wid:>10} setback {setback:5.1f} m height {height:5.1f} m "
|
||||
f"({source:26}) {name[:34]}{flag}")
|
||||
|
||||
|
||||
Reference in new issue
Block a user