From 05bef92f0f566b0a40e6efc63237028417572af2 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 6 Jul 2018 21:59:17 +0200 Subject: [PATCH] ignore admin_level = 15 in geocodejson output Level 15 is an artifical value. --- lib/PlaceLookup.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PlaceLookup.php b/lib/PlaceLookup.php index f0db09c9..c94121f8 100644 --- a/lib/PlaceLookup.php +++ b/lib/PlaceLookup.php @@ -546,13 +546,15 @@ class PlaceLookup { $aAddressLines = $this->getAddressDetails( $iPlaceID, - false, + true, $sHousenumber === null ? -1 : $sHousenumber ); $aAddress = array(); foreach ($aAddressLines as $aLine) { - if (isset($aLine['admin_level'])) { + if (isset($aLine['admin_level']) + && $aLine['admin_level'] < 15 + && !isset($aAddress['level'.$aLine['admin_level']])) { $aAddress['level'.$aLine['admin_level']] = $aLine['localname']; } }