From a84a7a70f3f5687c19064e6872720167dc5a0676 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 5 Feb 2017 23:02:21 +0100 Subject: [PATCH] reverse: choose interpolation only when further than point The ST_DWithin check also includes objects that are the same distance. Another attempt at #545. --- lib/ReverseGeocode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5