From: Sarah Hoffmann Date: Wed, 15 Nov 2023 21:10:21 +0000 (+0100) Subject: Merge pull request #3248 from lonvia/fix-postcode-area-computation X-Git-Tag: v4.4.0~82 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/ee556fd42e6713a31bc784d762736df0e4d4f85d?hp=b4ce1fb59954ef21aea12157c3145eb7a5ae2a5a Merge pull request #3248 from lonvia/fix-postcode-area-computation PHP frontent: fix postcode area computation for address points --- diff --git a/lib-sql/functions/address_lookup.sql b/lib-sql/functions/address_lookup.sql index 5d2cb94d..26ce2073 100644 --- a/lib-sql/functions/address_lookup.sql +++ b/lib-sql/functions/address_lookup.sql @@ -262,7 +262,7 @@ BEGIN -- If the place had a postcode assigned, take this one only -- into consideration when it is an area and the place does not have -- a postcode itself. - IF location.fromarea AND location.isaddress + IF location.fromarea AND location_isaddress AND (place.address is null or not place.address ? 'postcode') THEN place.postcode := null; -- remove the less exact postcode diff --git a/nominatim/db/connection.py b/nominatim/db/connection.py index a64cbfaf..fce897bc 100644 --- a/nominatim/db/connection.py +++ b/nominatim/db/connection.py @@ -31,7 +31,7 @@ class Cursor(psycopg2.extras.DictCursor): """ Query execution that logs the SQL query when debugging is enabled. """ if LOG.isEnabledFor(logging.DEBUG): - LOG.debug(self.mogrify(query, args).decode('utf-8')) # type: ignore[arg-type] + LOG.debug(self.mogrify(query, args).decode('utf-8')) super().execute(query, args)