inherit postcode from street to poi

This commit is contained in:
Sarah Hoffmann
2014-05-26 22:42:03 +02:00
parent be1d7f38ca
commit 0ab547793d

View File

@@ -2487,7 +2487,7 @@ BEGIN
CASE WHEN class = 'place' and type = 'postcode' THEN hstore('name', postcode) ELSE name END as name,
class, type, admin_level, true as fromarea, true as isaddress,
CASE WHEN rank_address = 0 THEN 100 WHEN rank_address = 11 THEN 5 ELSE rank_address END as rank_address,
0 as distance, calculated_country_code
0 as distance, calculated_country_code, postcode
from placex
where place_id = for_place_id
LOOP
@@ -2498,6 +2498,9 @@ BEGIN
IF searchpostcode IS NOT NULL and location.type = 'postcode' THEN
location.isaddress := FALSE;
END IF;
IF searchpostcode IS NULL and location.postcode IS NOT NULL THEN
searchpostcode := location.postcode;
END IF;
IF location.rank_address = 4 AND location.isaddress THEN
hadcountry := true;
END IF;