]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/template/search-json.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / lib / template / search-json.php
index 774b5be08b3e6bca7db863ab6584542986416cbc..30817c04025114210eb49e0649d6bf123d07ca68 100644 (file)
@@ -27,9 +27,10 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) {
 
     $aPlace['lat'] = $aPointDetails['lat'];
     $aPlace['lon'] = $aPointDetails['lon'];
 
     $aPlace['lat'] = $aPointDetails['lat'];
     $aPlace['lon'] = $aPointDetails['lon'];
+
     $aPlace['display_name'] = $aPointDetails['name'];
 
     $aPlace['display_name'] = $aPointDetails['name'];
 
-    if ($sOutputFormat == 'jsonv2') {
+    if ($sOutputFormat == 'jsonv2' || $sOutputFormat == 'geojson') {
         $aPlace['place_rank'] = $aPointDetails['rank_search'];
         $aPlace['category'] = $aPointDetails['class'];
     } else {
         $aPlace['place_rank'] = $aPointDetails['rank_search'];
         $aPlace['category'] = $aPointDetails['class'];
     } else {
@@ -43,7 +44,7 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) {
         $aPlace['icon'] = $aPointDetails['icon'];
     }
 
         $aPlace['icon'] = $aPointDetails['icon'];
     }
 
-    if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])) {
+    if (isset($aPointDetails['address']) && !empty($aPointDetails['address'])) {
         $aPlace['address'] = $aPointDetails['address'];
     }
 
         $aPlace['address'] = $aPointDetails['address'];
     }