X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/27af9b102c2d6167b9025d594f8cb75e4dd76a03..5f09ba4e10b52b5154fb3e9211b8ec5fcfe82d91:/lib-php/template/search-geocodejson.php diff --git a/lib-php/template/search-geocodejson.php b/lib-php/template/search-geocodejson.php index 336731a2..bba41a0d 100644 --- a/lib-php/template/search-geocodejson.php +++ b/lib-php/template/search-geocodejson.php @@ -1,4 +1,12 @@ $aPointDetails) { @@ -17,8 +25,10 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { $aPlace['properties']['geocoding']['osm_type'] = $sOSMType; $aPlace['properties']['geocoding']['osm_id'] = $aPointDetails['osm_id']; } + $aPlace['properties']['geocoding']['osm_key'] = $aPointDetails['class']; + $aPlace['properties']['geocoding']['osm_value'] = $aPointDetails['type']; - $aPlace['properties']['geocoding']['type'] = $aPointDetails['type']; + $aPlace['properties']['geocoding']['type'] = addressRankToGeocodeJsonType($aPointDetails['rank_address']); $aPlace['properties']['geocoding']['label'] = $aPointDetails['langaddress']; @@ -36,7 +46,7 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { } if (isset($aPointDetails['asgeojson'])) { - $aPlace['geometry'] = json_decode($aPointDetails['asgeojson']); + $aPlace['geometry'] = json_decode($aPointDetails['asgeojson'], true); } else { $aPlace['geometry'] = array( 'type' => 'Point',