@mytec: 1.4iter ready for testing

This commit is contained in:
2026-01-31 00:59:30 +02:00
parent 1ffac9f510
commit 61e113965c
8 changed files with 1398 additions and 36 deletions

View File

@@ -15,6 +15,8 @@ class Building(BaseModel):
height: float # meters
levels: Optional[int] = None
building_type: Optional[str] = None
material: Optional[str] = None # Detected material type
tags: dict = {} # Store all OSM tags for material detection
class BuildingsService:
@@ -144,12 +146,21 @@ class BuildingsService:
# Estimate height
height = self._estimate_height(tags)
# Detect material from tags
material_str = None
if "building:material" in tags:
material_str = tags["building:material"]
elif "building:facade:material" in tags:
material_str = tags["building:facade:material"]
buildings.append(Building(
id=element["id"],
geometry=geometry,
height=height,
levels=int(tags.get("building:levels", 0)) or None,
building_type=tags.get("building")
building_type=tags.get("building"),
material=material_str,
tags=tags
))
return buildings