]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 12 Oct 2017 19:03:55 +0000 (21:03 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 12 Oct 2017 19:03:55 +0000 (21:03 +0200)
1  2 
sql/functions.sql

diff --combined sql/functions.sql
index 820bdbf8a3390291a1352ab4203875c1510e368a,596bf808c35e2715400c3c5d930b37ca9b64fea3..97baf52b74520b0dc312b0189a6d232ba45ddae7
@@@ -1757,7 -1757,7 +1757,7 @@@ BEGI
    END IF;
  
    -- make sure all names are in the word table
-   IF NEW.admin_level = 2 AND NEW.class = 'boundary' AND NEW.type = 'administrative' AND NEW.country_code IS NOT NULL THEN
+   IF NEW.admin_level = 2 AND NEW.class = 'boundary' AND NEW.type = 'administrative' AND NEW.country_code IS NOT NULL AND NEW.osm_type = 'R' THEN
      perform create_country(NEW.name, lower(NEW.country_code));
      --DEBUG: RAISE WARNING 'Country names updated';
    END IF;
@@@ -2503,7 -2503,7 +2503,7 @@@ BEGI
      select placex.place_id, osm_type, osm_id, name,
        CASE WHEN extratags ? 'place' THEN 'place' ELSE class END as class,
        CASE WHEN extratags ? 'place' THEN extratags->'place' ELSE type END as type,
 -      admin_level, fromarea, isaddress,
 +      admin_level, fromarea, isaddress and linked_place_id is NULL as isaddress,
        CASE WHEN address_place_id = for_place_id AND rank_address = 0 THEN 100 WHEN rank_address = 11 THEN 5 ELSE rank_address END as rank_address,
        distance,country_code,postcode
        from place_addressline join placex on (address_place_id = placex.place_id)