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
3 files
+ 91
56
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -36,19 +36,22 @@ class HeightAndFloorspaceRule:
gem_taxonomy_height = []
# The number of stories ideally comes from the `building:levels` tags in OpenStreetMap. If they are present,
# the floorspace of a building can be calculated. OpenStreetMap buildings can also contain a `height` tag but
# this tag is only parsed without the floorspace being estimated.
# The number of stories ideally comes from the `building:levels` tags in OpenStreetMap.
# If they are present, the floorspace of a building can be calculated. OpenStreetMap
# buildings can also contain a `height` tag but this tag is only parsed without the
# floorspace being estimated.
try:
stories, floorspace = self.get_stories_and_floorspace_from_osm(tags, area)
# OSM can have unexpected data types and unexpected content in their tagging scheme, therefore we do not raise
# an exception in case of a ValueError, but instead ignore the values.
# OSM can have unexpected data types and unexpected content in their tagging scheme,
# therefore we do not raise an exception in case of a ValueError, but instead ignore
# the values.
except ValueError:
stories, floorspace = None, None
if stories:
gem_taxonomy_height.append(stories)
# If any of the number-of-stories and height tags are found in OpenStreetMap, they are returned.
# If any of the number-of-stories and height tags are found in OpenStreetMap, they are
# returned.
if len(gem_taxonomy_height) > 0:
return {
"height": "+".join(gem_taxonomy_height),
Loading