]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/ReverseGeocode.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / lib / ReverseGeocode.php
index 6d3cc8293b4a8a11c95b0470fbed7725b7494a73..8fc22f694f21792e7b0b0e8906e2913bbb93e4fd 100644 (file)
@@ -153,7 +153,7 @@ class ReverseGeocode
             // look for an interpolation that is closer
             $aPlaceLine = $this->lookupInterpolation($sPointSQL, $fDistancePlacex);
 
-            if ($aPlaceLine) {
+            if ($aPlaceLine && (float) $aPlaceLine['distance'] < (float) $fDistancePlacex) {
                 // interpolation is closer to point than placex house
                 $bPlaceIsLine = true;
                 $aPlace = $aPlaceLine;
@@ -201,6 +201,8 @@ class ReverseGeocode
         if ($iPlaceID && $iMaxRank < 28) {
             if (($aPlace['rank_search'] > 28 || $bPlaceIsTiger || $bPlaceIsLine) && $iParentPlaceID) {
                 $iPlaceID = $iParentPlaceID;
+                $bPlaceIsLine = false;
+                $bPlaceIsTiger = false;
             }
             $sSQL  = 'select address_place_id';
             $sSQL .= ' FROM place_addressline';