]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/lookup.php
small typos and wording in the API docs
[nominatim.git] / website / lookup.php
index 578d4c37306d0ecebb545ab3518ac8e8d5017212..f09506a4c0de7ae1aef97afa22b38a4aecc9cae1 100755 (executable)
@@ -11,7 +11,7 @@ ini_set('memory_limit', '200M');
 $oParams = new Nominatim\ParameterParser();
 
 // Format for output
-$sOutputFormat = $oParams->getSet('format', array('xml', 'json'), 'xml');
+$sOutputFormat = $oParams->getSet('format', array('xml', 'json', 'geojson'), 'xml');
 
 // Preferred language
 $aLangPrefOrder = $oParams->getPreferredLanguages();
@@ -25,11 +25,12 @@ $aCleanedQueryParts = array();
 
 $oPlaceLookup = new Nominatim\PlaceLookup($oDB);
 $oPlaceLookup->loadParamArray($oParams);
+$oPlaceLookup->setIncludeAddressDetails($oParams->getBool('addressdetails', true));
 
 $aOsmIds = explode(',', $oParams->getString('osm_ids', ''));
 
 if (count($aOsmIds) > CONST_Places_Max_ID_count) {
-    userError('Bulk User: Only ' . CONST_Places_Max_ID_count . " ids are allowed in one request.");
+    userError('Bulk User: Only ' . CONST_Places_Max_ID_count . ' ids are allowed in one request.');
 }
 
 foreach ($aOsmIds as $sItem) {
@@ -63,7 +64,8 @@ $sQuery = join(',', $aCleanedQueryParts);
 // we initialize these to avoid warnings in our logfile
 $sViewBox = '';
 $bShowPolygons = '';
-$aExcludePlaceIDs = [];
+$aExcludePlaceIDs = array();
 $sMoreURL = '';
 
-include(CONST_BasePath.'/lib/template/search-'.$sOutputFormat.'.php');
+$sOutputTemplate = ($sOutputFormat == 'jsonv2') ? 'json' : $sOutputFormat;
+include(CONST_BasePath.'/lib/template/search-'.$sOutputTemplate.'.php');