]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-php/template/address-geocodejson.php
Allow negative osm_id in details page by setting default parameter to 0
[nominatim.git] / lib-php / template / address-geocodejson.php
index 8a0a6289a9697a9a3a5c84ecb95c3224875ad02e..28c605f76ae6e177236ba5a1af5ec3e5fd69c2e6 100644 (file)
@@ -36,6 +36,9 @@ if (empty($aPlace)) {
         $aFilteredPlaces['properties']['geocoding']['osm_id'] = $aPlace['osm_id'];
     }
 
         $aFilteredPlaces['properties']['geocoding']['osm_id'] = $aPlace['osm_id'];
     }
 
+    $aFilteredPlaces['properties']['geocoding']['osm_key'] = $aPlace['class'];
+    $aFilteredPlaces['properties']['geocoding']['osm_value'] = $aPlace['type'];
+
     $aFilteredPlaces['properties']['geocoding']['type'] = addressRankToGeocodeJsonType($aPlace['rank_address']);
 
     $aFilteredPlaces['properties']['geocoding']['accuracy'] = (int) $fDistance;
     $aFilteredPlaces['properties']['geocoding']['type'] = addressRankToGeocodeJsonType($aPlace['rank_address']);
 
     $aFilteredPlaces['properties']['geocoding']['accuracy'] = (int) $fDistance;
@@ -56,7 +59,7 @@ if (empty($aPlace)) {
     }
 
     if (isset($aPlace['asgeojson'])) {
     }
 
     if (isset($aPlace['asgeojson'])) {
-        $aFilteredPlaces['geometry'] = json_decode($aPlace['asgeojson']);
+        $aFilteredPlaces['geometry'] = json_decode($aPlace['asgeojson'], true);
     } else {
         $aFilteredPlaces['geometry'] = array(
                                         'type' => 'Point',
     } else {
         $aFilteredPlaces['geometry'] = array(
                                         'type' => 'Point',