]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/PlaceLookup.php
reorganise path settings in config
[nominatim.git] / lib / PlaceLookup.php
index 8a1a366678652513e37378e15c36c64d18c0e679..58510e266f5a99da705c5ca2303d5c4d3a59f26c 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Nominatim;
 
-require_once(CONST_BasePath.'/lib/AddressDetails.php');
-require_once(CONST_BasePath.'/lib/Result.php');
+require_once(CONST_LibDir.'/AddressDetails.php');
+require_once(CONST_LibDir.'/Result.php');
 
 class PlaceLookup
 {
@@ -448,16 +448,24 @@ class PlaceLookup
                 }
             }
 
-            $aPlace['addresstype'] = ClassTypes\getProperty(
+            $aPlace['addresstype'] = ClassTypes\getLabelTag(
                 $aPlace,
-                'simplelabel',
-                $aPlace['class']
+                $aPlace['country_code']
             );
+
+            $aResults[$aPlace['place_id']] = $aPlace;
         }
 
-        Debug::printVar('Places', $aPlaces);
+        $aResults = array_filter(
+            $aResults,
+            function ($v) {
+                return !($v instanceof Result);
+            }
+        );
+
+        Debug::printVar('Places', $aResults);
 
-        return $aPlaces;
+        return $aResults;
     }
 
     /* returns an array which will contain the keys