]> git.openstreetmap.org Git - nominatim.git/commitdiff
return centroid on geojson format
authormarc tobias <mtmail@gmx.net>
Mon, 9 Apr 2018 12:24:31 +0000 (14:24 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 12 Apr 2018 20:02:24 +0000 (22:02 +0200)
lib/template/details-json.php

index 3cf233d4ba72518654ae2879fa3214cc00b744a9..288c914c10294c9bc0c2d7817f97ba8c879e7b08 100644 (file)
@@ -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']);