Skip to content
Snippets Groups Projects

Resolve "Change the processing of the `stories` rule to a `height` GEM Taxonomy tag"

Compare and Show latest version
2 files
+ 10
8
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -39,8 +39,8 @@ class HeightAndFloorspaceRule:
gem_taxonomy_height = []
# The number of stories ideally comes from the tags from OpenStreetMap. If we are able
# to use that, we can also calculate the floorspace. The height_and_floorspace tags in OSM are also
# parsed, but no floorspace is estimated.
# to use that, we can also calculate the floorspace. The height_and_floorspace tags in OSM are
# also parsed, but no floorspace is estimated.
try:
stories, floorspace = HeightAndFloorspaceRule.get_stories_and_floorspace_from_osm(
tags, area
@@ -69,8 +69,8 @@ class HeightAndFloorspaceRule:
"floorspace": floorspace,
}
# If no information can be retrieved from OSM, we use the height_and_floorspace estimation from GHSL
# and do not estimate any floorspace.
# If no information can be retrieved from OSM, we use the height_and_floorspace estimation from
# GHSL and do not estimate any floorspace.
ghsl_height = HeightAndFloorspaceRule.get_height_from_ghsl(ghsl_characteristics_type)
if ghsl_height:
return {"height_and_floorspace": ghsl_height, "floorspace": None}
@@ -158,7 +158,8 @@ class HeightAndFloorspaceRule:
@staticmethod
def get_height_from_osm(tags: dict):
"""
Get the height_and_floorspace of a building, based on the `height_and_floorspace` and `min_height` tags.
Get the height_and_floorspace of a building, based on the `height_and_floorspace` and `min_height`
tags.
Args:
tags (dict):
@@ -188,8 +189,8 @@ class HeightAndFloorspaceRule:
@staticmethod
def get_height_from_ghsl(ghsl_characteristics_type: int):
"""
Get the GEM Taxonomy height_and_floorspace tag, based on the type in the GHSL characteristics layer
that has the most overlap with the building.
Get the GEM Taxonomy height_and_floorspace tag, based on the type in the GHSL characteristics
layer that has the most overlap with the building.
Args:
ghsl_characteristics_type (int):
Loading