Skip to content
Snippets Groups Projects

Resolve "Create the Geometry, Quadkey, RelationID and Floorspace rules"

2 files
+ 8
9
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 23
0
class QuadkeyRule:
def __call__(self, longitude, latitude, *args, **kwargs):
"""
Determine the Quadkey of the tile in which the building centroid is located given its
longitude and latitude.
Args:
longitude:
Longitude of the building centroid
latitude:
Latitude of the building centroid
Returns:
A dictionary with the zoom-level 18 Quadkey.
"""
import mercantile
if longitude is None or latitude is None:
quadkey = None
else:
quadkey = mercantile.quadkey(mercantile.tile(longitude, latitude, 18))
return {"quadkey": quadkey}
Loading