reverse: choose interpolation only when further than point

The ST_DWithin check also includes objects that are the same distance.

Another attempt at #545.
This commit is contained in:
Sarah Hoffmann
2017-02-05 23:02:21 +01:00
parent dcab7a19e5
commit a84a7a70f3

View 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;