X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/bd951819916c9357e82dcb4c84c06064772c36f4..f289db9bfe21c5a725e751be98e2b824026e2310:/lib-php/template/address-geocodejson.php diff --git a/lib-php/template/address-geocodejson.php b/lib-php/template/address-geocodejson.php index 8a0a6289..28c605f7 100644 --- a/lib-php/template/address-geocodejson.php +++ b/lib-php/template/address-geocodejson.php @@ -36,6 +36,9 @@ if (empty($aPlace)) { $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; @@ -56,7 +59,7 @@ if (empty($aPlace)) { } if (isset($aPlace['asgeojson'])) { - $aFilteredPlaces['geometry'] = json_decode($aPlace['asgeojson']); + $aFilteredPlaces['geometry'] = json_decode($aPlace['asgeojson'], true); } else { $aFilteredPlaces['geometry'] = array( 'type' => 'Point',