From 161d83af5b5537199dab4e0048a6c4c835521d93 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 29 Jun 2022 17:54:30 +0200 Subject: [PATCH] fix handling of zero importance To avoid importance becoming zero and cancelling out other weights, df008d99f549d850d07580b4592435388e44387c introduced a minimum value for importance. That broke importances for interpolated addresses, which are less than zero. Instead of setting a minimum, set zero importances to a very small value. Fixes #2753. --- lib-php/Geocode.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib-php/Geocode.php b/lib-php/Geocode.php index bf9a3262..acb79493 100644 --- a/lib-php/Geocode.php +++ b/lib-php/Geocode.php @@ -843,7 +843,9 @@ class Geocode $aResult['importance'] = 0.001; $aResult['foundorder'] = $aResult['addressimportance']; } else { - $aResult['importance'] = max(0.001, $aResult['importance']); + if ($aResult['importance'] == 0) { + $aResult['importance'] = 0.0001; + } $aResult['importance'] *= $this->viewboxImportanceFactor( $aResult['lon'], $aResult['lat'] -- 2.39.5