3 $aFilteredPlaces = array();
7 $aFilteredPlaces['error'] = $sError;
9 $aFilteredPlaces['error'] = 'Unable to geocode';
12 if (isset($aPlace['place_id'])) {
13 $aFilteredPlaces['place_id'] = $aPlace['place_id'];
15 $aFilteredPlaces['licence'] = 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright';
16 $sOSMType = formatOSMType($aPlace['osm_type']);
18 $aFilteredPlaces['osm_type'] = $sOSMType;
19 $aFilteredPlaces['osm_id'] = $aPlace['osm_id'];
21 if (isset($aPlace['lat'])) {
22 $aFilteredPlaces['lat'] = $aPlace['lat'];
24 if (isset($aPlace['lon'])) {
25 $aFilteredPlaces['lon'] = $aPlace['lon'];
28 if ($sOutputFormat == 'jsonv2' || $sOutputFormat == 'geojson') {
29 $aFilteredPlaces['place_rank'] = $aPlace['rank_search'];
31 $aFilteredPlaces['category'] = $aPlace['class'];
32 $aFilteredPlaces['type'] = $aPlace['type'];
34 $aFilteredPlaces['importance'] = $aPlace['importance'];
36 $aFilteredPlaces['addresstype'] = strtolower($aPlace['addresstype']);
38 $aFilteredPlaces['name'] = $aPlace['placename'];
41 $aFilteredPlaces['display_name'] = $aPlace['langaddress'];
43 if (isset($aPlace['address'])) {
44 $aFilteredPlaces['address'] = $aPlace['address']->getAddressNames();
46 if (isset($aPlace['sExtraTags'])) {
47 $aFilteredPlaces['extratags'] = $aPlace['sExtraTags'];
49 if (isset($aPlace['sNameDetails'])) {
50 $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
53 if (isset($aPlace['aBoundingBox'])) {
54 $aFilteredPlaces['boundingbox'] = $aPlace['aBoundingBox'];
57 if (isset($aPlace['asgeojson'])) {
58 $aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson']);
61 if (isset($aPlace['assvg'])) {
62 $aFilteredPlaces['svg'] = $aPlace['assvg'];
65 if (isset($aPlace['astext'])) {
66 $aFilteredPlaces['geotext'] = $aPlace['astext'];
69 if (isset($aPlace['askml'])) {
70 $aFilteredPlaces['geokml'] = $aPlace['askml'];
74 javascript_renderData($aFilteredPlaces);