Skip to content
Snippets Groups Projects

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

Files
4
+ 18
0
class RelationIDRule:
def __call__(self, relations, *args, **kwargs):
"""
Determine the building relation OSM ID.
Args:
relations:
List of the attributes of all relations that the building is member of.
Returns:
OSM ID of the first relation that the building is member of.
"""
for relation in relations:
osm_id = relation.get("osm_id", None)
if osm_id is not None:
return {"relation_id": osm_id}
return {"relation_id": None}
Loading