X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6e89310a9285f1ad15d8002bf68f578eada367a0..b9e4563bebaf2b2bfba5440001b4b5750eaebe43:/src/nominatim_api/search/db_searches.py diff --git a/src/nominatim_api/search/db_searches.py b/src/nominatim_api/search/db_searches.py index f5c43146..d2202b2c 100644 --- a/src/nominatim_api/search/db_searches.py +++ b/src/nominatim_api/search/db_searches.py @@ -12,9 +12,9 @@ import abc import sqlalchemy as sa -from nominatim_core.typing import SaFromClause, SaScalarSelect, SaColumn, \ - SaExpression, SaSelect, SaLambdaSelect, SaRow, SaBind -from nominatim_core.db.sqlalchemy_types import Geometry, IntArray +from ..typing import SaFromClause, SaScalarSelect, SaColumn, \ + SaExpression, SaSelect, SaLambdaSelect, SaRow, SaBind +from ..sql.sqlalchemy_types import Geometry, IntArray from ..connection import SearchConnection from ..types import SearchDetails, DataLayer, GeometryFormat, Bbox from .. import results as nres @@ -616,6 +616,8 @@ class PostcodeSearch(AbstractSearch): for prow in await conn.execute(placex_sql, _details_to_bind_params(details)): result = nres.create_from_placex_row(prow, nres.SearchResult) + if result is not None: + result.bbox = Bbox.from_wkb(prow.bbox) break else: result = nres.create_from_postcode_row(row, nres.SearchResult)