From: Sarah Hoffmann Date: Mon, 29 Mar 2021 07:36:56 +0000 (+0200) Subject: return housenumbers always from address field X-Git-Tag: v3.7.0~3^2~5 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/0ec3fdd3bab67abe3c78cadf362fffa250dd7d34?hp=c0f0b665091dfacd29727efed5efbe111c5900bf return housenumbers always from address field This means that we can use normalized versions of the housenumber in the housenumber field as it is no longer a user visible field. --- diff --git a/lib-sql/functions/address_lookup.sql b/lib-sql/functions/address_lookup.sql index f49bc93e..5ec977d1 100644 --- a/lib-sql/functions/address_lookup.sql +++ b/lib-sql/functions/address_lookup.sql @@ -164,7 +164,10 @@ BEGIN -- POI objects in the placex table IF place IS NULL THEN SELECT parent_place_id as place_id, country_code, - housenumber, postcode, + coalesce(address->'housenumber', + address->'streetnumber', + address->'conscriptionnumber')::text as housenumber, + postcode, class, type, name, address, centroid @@ -178,7 +181,7 @@ BEGIN -- place we should be using instead. IF place IS NULL THEN select coalesce(linked_place_id, place_id) as place_id, country_code, - housenumber, postcode, + null::text as housenumber, postcode, class, type, null as name, address, null as centroid