From: marc tobias Date: Mon, 9 Apr 2018 12:24:31 +0000 (+0200) Subject: return centroid on geojson format X-Git-Tag: v3.2.0~83 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/7a1ee9934522f0ed4535a2ad4c3429b7121d90cf return centroid on geojson format --- diff --git a/lib/template/details-json.php b/lib/template/details-json.php index 3cf233d4..288c914c 100644 --- a/lib/template/details-json.php +++ b/lib/template/details-json.php @@ -32,9 +32,10 @@ $aPlaceDetails['rank_address'] = (int) $aPointDetails['rank_address']; $aPlaceDetails['rank_search'] = (int) $aPointDetails['rank_search']; $aPlaceDetails['isarea'] = ($aPointDetails['isarea'] == 't'); -$aPlaceDetails['lat'] = (float) $aPointDetails['lat']; -$aPlaceDetails['lon'] = (float) $aPointDetails['lon']; - +$aPlaceDetails['centroid'] = array( + 'type' => 'Point', + 'coordinates' => array( (float) $aPointDetails['lon'], (float) $aPointDetails['lat'] ) +); $aPlaceDetails['geometry'] = json_decode($aPointDetails['asgeojson']);