]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 23 Sep 2020 13:26:36 +0000 (15:26 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 23 Sep 2020 13:26:36 +0000 (15:26 +0200)
1  2 
sql/functions/address_lookup.sql

index 196fb434868f69aacf87bdd7b895f80e11c458db,b20cb364b5589debef77ccaf5839329a156d5d4c..53bc1ae3aa34563124a578ddddcff80cf8354fb6
@@@ -101,6 -101,7 +101,7 @@@ DECLAR
    postcode_isexact BOOL;
    searchclass TEXT;
    searchtype TEXT;
+   search_unlisted_place TEXT;
    countryname HSTORE;
  BEGIN
    -- The place ein question might not have a direct entry in place_addressline.
    IF for_place_id IS NULL THEN
      SELECT parent_place_id, country_code, housenumber, rank_search,
             postcode, address is not null and address ? 'postcode',
-            name, class, type
+            name, class, type,
+            address -> '_unlisted_place' as unlisted_place
        FROM placex
        WHERE place_id = in_place_id and rank_search > 27
        INTO for_place_id, searchcountrycode, searchhousenumber, searchrankaddress,
-            searchpostcode, postcode_isexact, searchhousename, searchclass, searchtype;
+            searchpostcode, postcode_isexact, searchhousename, searchclass,
+            searchtype, search_unlisted_place;
    END IF;
  
    -- If for_place_id is still NULL at this point then the object has its own
    FOR location IN
      SELECT placex.place_id, osm_type, osm_id, name, class, type,
             coalesce(extratags->'linked_place', extratags->'place') as place_type,
 -           admin_level, fromarea, isaddress,
 +           admin_level, fromarea, isaddress and linked_place_id is NULL as isaddress,
             CASE 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)
      RETURN NEXT location;
    END IF;
  
+   IF search_unlisted_place is not null THEN
+     RETURN NEXT ROW(null, null, null, hstore('name', search_unlisted_place),
+                     'place', 'locality', null, null, true, true, 26, 0)::addressline;
+   END IF;
    IF searchpostcode IS NOT NULL THEN
      location := ROW(null, null, null, hstore('ref', searchpostcode), 'place',
                      'postcode', null, null, false, true, 5, 0)::addressline;