Compare commits
2 Commits
main
...
retrofit_d
Author | SHA1 | Date | |
---|---|---|---|
e96a4262a7 | |||
146ac487ad |
@ -213,8 +213,6 @@ class Geojson:
|
||||
polygon = Polygon(coordinates)
|
||||
polygon.area = igh.ground_area(coordinates)
|
||||
surfaces[-1] = Surface(polygon, polygon)
|
||||
if len(surfaces) > 1:
|
||||
raise ValueError('too many surfaces!!!!')
|
||||
building = Building(f'{building_name}', surfaces, year_of_construction, function)
|
||||
for alias in building_aliases:
|
||||
building.add_alias(alias)
|
||||
|
@ -152,8 +152,14 @@ class CityObject(Repository):
|
||||
buildings = session.execute(select(Model).where(
|
||||
Model.city_id.in_(ids), Model.name.in_(names)
|
||||
))
|
||||
if len(buildings) == 0:
|
||||
# search by aliases instead
|
||||
buildings = session.execute(select(Model).where(
|
||||
Model.city_id.in_(ids), Model.name.in_(names)
|
||||
))
|
||||
results = [r[0] for r in buildings]
|
||||
print(ids, buildings)
|
||||
|
||||
print(ids, [r.name for r in results])
|
||||
return None
|
||||
|
||||
def get_by_name_or_alias_and_city(self, name, city_id) -> Union[Model, None]:
|
||||
|
Loading…
Reference in New Issue
Block a user