3 $aFilteredPlaces = array();
5 if (!sizeof($aPlace)) {
7 $aFilteredPlaces['error'] = $sError;
8 else $aFilteredPlaces['error'] = 'Unable to geocode';
10 if (isset($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 if ($sOutputFormat == 'jsonv2') {
21 $aFilteredPlaces['place_rank'] = $aPlace['rank_search'];
23 $aFilteredPlaces['category'] = $aPlace['class'];
24 $aFilteredPlaces['type'] = $aPlace['type'];
26 $aFilteredPlaces['importance'] = $aPlace['importance'];
28 $aFilteredPlaces['addresstype'] = strtolower($aPlace['addresstype']);
30 $aFilteredPlaces['name'] = $aPlace['placename'];
33 $aFilteredPlaces['display_name'] = $aPlace['langaddress'];
35 if (isset($aPlace['aAddress'])) $aFilteredPlaces['address'] = $aPlace['aAddress'];
36 if (isset($aPlace['sExtraTags'])) $aFilteredPlaces['extratags'] = $aPlace['sExtraTags'];
37 if (isset($aPlace['sNameDetails'])) $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
39 if (isset($aPlace['aBoundingBox'])) {
40 $aFilteredPlaces['boundingbox'] = $aPlace['aBoundingBox'];
43 if (isset($aPlace['asgeojson'])) {
44 $aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson']);
47 if (isset($aPlace['assvg'])) {
48 $aFilteredPlaces['svg'] = $aPlace['assvg'];
51 if (isset($aPlace['astext'])) {
52 $aFilteredPlaces['geotext'] = $aPlace['astext'];
55 if (isset($aPlace['askml'])) {
56 $aFilteredPlaces['geokml'] = $aPlace['askml'];
60 javascript_renderData($aFilteredPlaces);