From a9ae2c74571a56dc5b89a8a8ac1acc91b3f1e285 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 15 Apr 2019 22:43:07 +0200 Subject: [PATCH] add reverse zoom level that includes minor streets Zoom 17 now also resolves service roads and similar. Fixes #1350. --- lib/ReverseGeocode.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/ReverseGeocode.php b/lib/ReverseGeocode.php index ff20691a..50060ee0 100644 --- a/lib/ReverseGeocode.php +++ b/lib/ReverseGeocode.php @@ -36,8 +36,8 @@ class ReverseGeocode 13 => 18, 14 => 22, // Suburb 15 => 22, - 16 => 26, // Street, TODO: major street? - 17 => 26, + 16 => 26, // major street + 17 => 27, // minor street 18 => 30, // or >, Building 19 => 30, // or >, Building ); @@ -246,12 +246,7 @@ class ReverseGeocode $sSQL .= ' placex'; $sSQL .= ' WHERE ST_DWithin('.$sPointSQL.', geometry, '.$fSearchDiam.')'; $sSQL .= ' AND'; - // only streets - if ($iMaxRank == 26) { - $sSQL .= ' rank_address = 26'; - } else { - $sSQL .= ' rank_address between 26 and '.$iMaxRank; - } + $sSQL .= ' rank_address between 26 and '.$iMaxRank; $sSQL .= ' and (name is not null or housenumber is not null'; $sSQL .= ' or rank_address between 26 and 27)'; $sSQL .= ' and (rank_address between 26 and 27'; -- 2.39.5