]> git.openstreetmap.org Git - nominatim.git/commitdiff
return housenumbers always from address field
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 29 Mar 2021 07:36:56 +0000 (09:36 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 4 Apr 2021 13:26:47 +0000 (15:26 +0200)
This means that we can use normalized versions of the
housenumber in the housenumber field as it is no longer
a user visible field.

lib-sql/functions/address_lookup.sql

index f49bc93efd52d8fbce8e008d40817398ca038f53..5ec977d17552d7434bde9dc7fe88db9555b12c6c 100644 (file)
@@ -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