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.
This commit is contained in:
Sarah Hoffmann
2021-03-29 09:36:56 +02:00
parent c0f0b66509
commit 0ec3fdd3ba

View File

@@ -164,7 +164,10 @@ BEGIN
-- POI objects in the placex table -- POI objects in the placex table
IF place IS NULL THEN IF place IS NULL THEN
SELECT parent_place_id as place_id, country_code, SELECT parent_place_id as place_id, country_code,
housenumber, postcode, coalesce(address->'housenumber',
address->'streetnumber',
address->'conscriptionnumber')::text as housenumber,
postcode,
class, type, class, type,
name, address, name, address,
centroid centroid
@@ -178,7 +181,7 @@ BEGIN
-- place we should be using instead. -- place we should be using instead.
IF place IS NULL THEN IF place IS NULL THEN
select coalesce(linked_place_id, place_id) as place_id, country_code, select coalesce(linked_place_id, place_id) as place_id, country_code,
housenumber, postcode, null::text as housenumber, postcode,
class, type, class, type,
null as name, address, null as name, address,
null as centroid null as centroid