X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/2c07d5e000bceffb1f77cea456a232c9767ca7af..8c3796826b9c3e35bba0b31f9de3ca22d2577870:/lib/ReverseGeocode.php diff --git a/lib/ReverseGeocode.php b/lib/ReverseGeocode.php index 6d3cc829..8fc22f69 100644 --- a/lib/ReverseGeocode.php +++ b/lib/ReverseGeocode.php @@ -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';