From: Sarah Hoffmann Date: Sun, 5 Feb 2017 22:02:21 +0000 (+0100) Subject: reverse: choose interpolation only when further than point X-Git-Tag: v3.0.0~77 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/a84a7a70f3f5687c19064e6872720167dc5a0676 reverse: choose interpolation only when further than point The ST_DWithin check also includes objects that are the same distance. Another attempt at #545. --- diff --git a/lib/ReverseGeocode.php b/lib/ReverseGeocode.php index b3899e3b..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;