Skip to content
Snippets Groups Projects
Commit d2d8858c authored by Danijel Schorlemmer's avatar Danijel Schorlemmer Committed by Laurens Oostwegel
Browse files

Apply 8 suggestion(s) to 2 file(s)

parent 4f6d940f
No related branches found
No related tags found
No related merge requests found
Pipeline #65070 failed
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
class QuadkeyRule:
def __call__(self, longitude, latitude, *args, **kwargs):
"""
Determine the Quadkey tile of a building, based on the latitude and longitude of the
centroid.
Determine the Quadkey of the tile in which the building centroid is located given its longitude and latitude.
Args:
longitude:
Longitude of the centroid
Longitude of the building centroid
latitude:
Latitude of the centroid
Latitude of the building centroid
Returns:
A dictionary with the zoom-level 18 Quadkey tile.
A dictionary with the zoom-level 18 Quadkey.
"""
import mercantile
......
......@@ -2,7 +2,7 @@ class StoriesAndFloorspaceRule:
def __call__(self, tags, relations, area, *args, **kwargs):
"""
Find the `building:levels` tag in the attributes of the building or one of the building
relations and save as number of stories. Calculate the floorspace of the building, based
relations and save this as the number of stories. Calculate the floorspace of the building, based
on the footprint size of the building and the number of stories.
Args:
......@@ -27,7 +27,7 @@ class StoriesAndFloorspaceRule:
try:
storeys = ceil(float(storey_string))
if storeys < 1:
raise ValueError("Storeys cannot be below 1")
raise ValueError("Number of stories cannot be below 1")
floorspace = storeys * area
return {"storeys": storeys, "floorspace": floorspace}
except ValueError:
......@@ -37,14 +37,14 @@ class StoriesAndFloorspaceRule:
@staticmethod
def get_info(tags):
"""
Get the number of storeys, if the attribute `building:levels` exist
Get the number of stories, if the attribute `building:levels` exist
Args:
tags:
Building tags, such has the building levels or building type.
Returns:
Number of storeys, if the attribute `building:levels` exist, otherwise `None`.
Number of stories, if the attribute `building:levels` exist, otherwise `None`.
"""
return tags.get("building:levels", None)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment