@mytec: 1.4iter ready for testing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user