X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c5836c80905200fb7a857f3704d441c9992b69f6..95c3181a350538317678d5fef5122ed4b284b012:/nominatim/api/lookup.py diff --git a/nominatim/api/lookup.py b/nominatim/api/lookup.py index a46cdb69..e9181f47 100644 --- a/nominatim/api/lookup.py +++ b/nominatim/api/lookup.py @@ -38,6 +38,7 @@ async def find_in_placex(conn: SearchConnection, place: ntyp.PlaceRef, t.c.importance, t.c.wikipedia, t.c.indexed_date, t.c.parent_place_id, t.c.rank_address, t.c.rank_search, t.c.linked_place_id, + t.c.geometry.ST_Expand(0).label('bbox'), t.c.centroid) if isinstance(place, ntyp.PlaceID): @@ -182,9 +183,6 @@ async def get_detailed_place(conn: SearchConnection, place: ntyp.PlaceRef, # add missing details assert result is not None - result.parent_place_id = row.parent_place_id - result.linked_place_id = getattr(row, 'linked_place_id', None) - result.admin_level = getattr(row, 'admin_level', 15) indexed_date = getattr(row, 'indexed_date', None) if indexed_date is not None: result.indexed_date = indexed_date.replace(tzinfo=dt.timezone.utc) @@ -232,7 +230,8 @@ async def get_simple_place(conn: SearchConnection, place: ntyp.PlaceRef, # add missing details assert result is not None - result.bbox = getattr(row, 'bbox', None) + if hasattr(row, 'bbox'): + result.bbox = ntyp.Bbox.from_wkb(row.bbox) await nres.add_result_details(conn, [result], details)