]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 4 Mar 2020 07:18:58 +0000 (08:18 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 4 Mar 2020 07:18:58 +0000 (08:18 +0100)
1  2 
lib/Geocode.php
sql/functions/address_lookup.sql

diff --combined lib/Geocode.php
index c1d0c46f80310fb76c9b2ca4c14a1111ee20f930,ab9446e0ebd757837d819a706f250b5a3c1ac408..0e5d4a53883924b110a054c8afe143759ff213bd
@@@ -18,7 -18,7 +18,7 @@@ class Geocod
      protected $aLangPrefOrder = array();
  
      protected $aExcludePlaceIDs = array();
 -    protected $bReverseInPlan = false;
 +    protected $bReverseInPlan = true;
  
      protected $iLimit = 20;
      protected $iFinalLimit = 10;
                          $sSQL .= 'WHERE place_id in ('.$sPlaceIds.') ';
                          $sSQL .= '  AND (';
                          $sSQL .= "         placex.rank_address between $this->iMinAddressRank and $this->iMaxAddressRank ";
-                         if (14 >= $this->iMinAddressRank && 14 <= $this->iMaxAddressRank) {
-                             $sSQL .= "     OR (extratags->'place') = 'city'";
-                         }
+                         $sSQL .= "         OR placex.rank_search between $this->iMinAddressRank and $this->iMaxAddressRank ";
                          if ($this->aAddressRankList) {
                              $sSQL .= '     OR placex.rank_address in ('.join(',', $this->aAddressRankList).')';
                          }
index 585c22c8d918ee8e709c029fcf923a199022a566,8436fdb190913d99d45400e1e225fd17d7db72ab..dd096728124d1f4e5d13dae849e893d1ec091eda
@@@ -202,9 -202,10 +202,10 @@@ BEGI
  
    FOR location IN
      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,
+            CASE WHEN extratags ? 'place' or extratags ? 'linked_place'
+                 THEN 'place' ELSE class END as class,
+            coalesce(extratags->'place', extratags->'linked_place', type) as 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)