]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/PlaceLookup.php
make phpcs happy
[nominatim.git] / lib / PlaceLookup.php
index 57d6166e6c3e400e3d3803f535d026f820d6b23e..c94121f8983121356254434fd0ce3aad344ba835 100644 (file)
@@ -43,11 +43,6 @@ class PlaceLookup
         $this->bIncludePolygonAsPoints = $b;
     }
 
-    public function setAddressDetails($b = true)
-    {
-        $this->bAddressDetails = $b;
-    }
-
     public function setAddressAdminLevels($b = true)
     {
         $this->bAddressAdminLevels = $b;
@@ -551,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'];
             }
         }