3 $aFilteredPlaces = array();
5 if (!sizeof($aPlace)) {
7 $aFilteredPlaces['error'] = $sError;
8 else $aFilteredPlaces['error'] = 'Unable to geocode';
10 if ($aPlace['place_id']) $aFilteredPlaces['place_id'] = $aPlace['place_id'];
11 $aFilteredPlaces['licence'] = 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright';
12 $sOSMType = formatOSMType($aPlace['osm_type']);
14 $aFilteredPlaces['osm_type'] = $sOSMType;
15 $aFilteredPlaces['osm_id'] = $aPlace['osm_id'];
17 if (isset($aPlace['lat'])) $aFilteredPlaces['lat'] = $aPlace['lat'];
18 if (isset($aPlace['lon'])) $aFilteredPlaces['lon'] = $aPlace['lon'];
20 $aFilteredPlaces['place_rank'] = $aPlace['rank_search'];
22 $aFilteredPlaces['category'] = $aPlace['class'];
23 $aFilteredPlaces['type'] = $aPlace['type'];
25 $aFilteredPlaces['importance'] = $aPlace['importance'];
27 $aFilteredPlaces['addresstype'] = strtolower($aPlace['addresstype']);
29 $aFilteredPlaces['display_name'] = $aPlace['langaddress'];
30 $aFilteredPlaces['name'] = $aPlace['placename'];
32 if (isset($aPlace['aAddress'])) $aFilteredPlaces['address'] = $aPlace['aAddress'];
33 if (isset($aPlace['sExtraTags'])) $aFilteredPlaces['extratags'] = $aPlace['sExtraTags'];
34 if (isset($aPlace['sNameDetails'])) $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
36 if (isset($aPlace['aBoundingBox'])) {
37 $aFilteredPlaces['boundingbox'] = $aPlace['aBoundingBox'];
40 if (isset($aPlace['asgeojson'])) {
41 $aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson']);
44 if (isset($aPlace['assvg'])) {
45 $aFilteredPlaces['svg'] = $aPlace['assvg'];
48 if (isset($aPlace['astext'])) {
49 $aFilteredPlaces['geotext'] = $aPlace['astext'];
52 if (isset($aPlace['askml'])) {
53 $aFilteredPlaces['geokml'] = $aPlace['askml'];
57 javascript_renderData($aFilteredPlaces);