3 $aFilteredPlaces = array();
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' || $sOutputFormat == 'geojson') {
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['address'])) {
36 $aFilteredPlaces['address'] = $aPlace['address']->getAddressNames();
38 if (isset($aPlace['sExtraTags'])) $aFilteredPlaces['extratags'] = $aPlace['sExtraTags'];
39 if (isset($aPlace['sNameDetails'])) $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
41 if (isset($aPlace['aBoundingBox'])) {
42 $aFilteredPlaces['boundingbox'] = $aPlace['aBoundingBox'];
45 if (isset($aPlace['asgeojson'])) {
46 $aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson']);
49 if (isset($aPlace['assvg'])) {
50 $aFilteredPlaces['svg'] = $aPlace['assvg'];
53 if (isset($aPlace['astext'])) {
54 $aFilteredPlaces['geotext'] = $aPlace['astext'];
57 if (isset($aPlace['askml'])) {
58 $aFilteredPlaces['geokml'] = $aPlace['askml'];
62 javascript_renderData($aFilteredPlaces);