]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 13 Mar 2014 19:48:21 +0000 (20:48 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 13 Mar 2014 19:48:21 +0000 (20:48 +0100)
Conflicts:
lib/Geocode.php

1  2 
lib/Geocode.php

diff --cc lib/Geocode.php
index c345bf36a6e22964a9989c115fa1ebf4d4cc1c59,c6febe7384de1e128d5f12ba6140474480c58af2..016fc101215618274effd14b89ea400411ab70ff
                                                                $aTerms[] = "country_code in ($sCountryCodesSQL)";
                                                        }
  
 -                                                      if ($bBoundingBoxSearch) $aTerms[] = "centroid && $sViewboxSmallSQL";
 +                                                      if ($bBoundingBoxSearch) $aTerms[] = "centroid && $this->sViewboxSmallSQL";
                                                        if ($sNearPointSQL) $aOrder[] = "ST_Distance($sNearPointSQL, centroid) asc";
  
-                                                       $sImportanceSQL = '(case when importance = 0 OR importance IS NULL then 0.75-(search_rank::float/40) else importance end)';
+                                                       if ($aSearch['sHouseNumber'])
+                                                       {
+                                                               $sImportanceSQL = '- abs(26 - address_rank) + 3';
+                                                       }
+                                                       else
+                                                       {
+                                                               $sImportanceSQL = '(case when importance = 0 OR importance IS NULL then 0.75-(search_rank::float/40) else importance end)';
+                                                       }
 -                                                      if ($sViewboxSmallSQL) $sImportanceSQL .= " * case when ST_Contains($sViewboxSmallSQL, centroid) THEN 1 ELSE 0.5 END";
 -                                                      if ($sViewboxLargeSQL) $sImportanceSQL .= " * case when ST_Contains($sViewboxLargeSQL, centroid) THEN 1 ELSE 0.5 END";
 +                                                      if ($this->sViewboxSmallSQL) $sImportanceSQL .= " * case when ST_Contains($this->sViewboxSmallSQL, centroid) THEN 1 ELSE 0.5 END";
 +                                                      if ($this->sViewboxLargeSQL) $sImportanceSQL .= " * case when ST_Contains($this->sViewboxLargeSQL, centroid) THEN 1 ELSE 0.5 END";
++
                                                        $aOrder[] = "$sImportanceSQL DESC";
                                                        if (sizeof($aSearch['aFullNameAddress']))
                                                        {