5 require_once(CONST_BasePath.'/lib/Result.php');
11 protected $aLangPrefOrderSql = "''";
13 protected $bAddressDetails = false;
14 protected $bExtraTags = false;
15 protected $bNameDetails = false;
17 protected $bIncludePolygonAsPoints = false;
18 protected $bIncludePolygonAsText = false;
19 protected $bIncludePolygonAsGeoJSON = false;
20 protected $bIncludePolygonAsKML = false;
21 protected $bIncludePolygonAsSVG = false;
22 protected $fPolygonSimplificationThreshold = 0.0;
24 protected $sAnchorSql = null;
25 protected $sAddressRankListSql = null;
26 protected $sAllowedTypesSQLList = null;
27 protected $bDeDupe = true;
30 public function __construct(&$oDB)
35 public function loadParamArray($oParams)
37 $aLangs = $oParams->getPreferredLanguages();
38 $this->aLangPrefOrderSql =
39 'ARRAY['.join(',', array_map('getDBQuoted', $aLangs)).']';
41 $this->bExtraTags = $oParams->getBool('extratags', false);
42 $this->bNameDetails = $oParams->getBool('namedetails', false);
44 $this->bIncludePolygonAsText = $oParams->getBool('polygon_text');
45 $this->bIncludePolygonAsGeoJSON = $oParams->getBool('polygon_geojson');
46 $this->bIncludePolygonAsKML = $oParams->getBool('polygon_kml');
47 $this->bIncludePolygonAsSVG = $oParams->getBool('polygon_svg');
48 $this->fPolygonSimplificationThreshold
49 = $oParams->getFloat('polygon_threshold', 0.0);
52 ($this->bIncludePolygonAsText ? 1 : 0) +
53 ($this->bIncludePolygonAsGeoJSON ? 1 : 0) +
54 ($this->bIncludePolygonAsKML ? 1 : 0) +
55 ($this->bIncludePolygonAsSVG ? 1 : 0);
56 if ($iWantedTypes > CONST_PolygonOutput_MaximumTypes) {
57 if (CONST_PolygonOutput_MaximumTypes) {
58 userError("Select only ".CONST_PolygonOutput_MaximumTypes." polgyon output option");
60 userError("Polygon output is disabled");
65 public function setAnchorSql($sPoint)
67 $this->sAnchorSql = $sPoint;
70 public function setDeDupe($bDeDupe)
72 $this->bDeDupe = $bDeDupe;
75 public function setAddressRankList($aList)
77 $this->sAddressRankListSql = '('.join(',', $aList).')';
80 public function setAllowedTypesSQLList($sSql)
82 $this->sAllowedTypesSQLList = $sSql;
85 public function setLanguagePreference($aLangPrefOrder)
87 $this->aLangPrefOrderSql =
88 'ARRAY['.join(',', array_map('getDBQuoted', $aLangPrefOrder)).']';
91 public function setIncludeAddressDetails($bAddressDetails = true)
93 $this->bAddressDetails = $bAddressDetails;
96 public function setIncludeExtraTags($bExtraTags = false)
98 $this->bExtraTags = $bExtraTags;
101 public function setIncludeNameDetails($bNameDetails = false)
103 $this->bNameDetails = $bNameDetails;
106 public function setIncludePolygonAsPoints($b = true)
108 $this->bIncludePolygonAsPoints = $b;
111 public function setIncludePolygonAsText($b = true)
113 $this->bIncludePolygonAsText = $b;
116 public function setIncludePolygonAsGeoJSON($b = true)
118 $this->bIncludePolygonAsGeoJSON = $b;
121 public function setIncludePolygonAsKML($b = true)
123 $this->bIncludePolygonAsKML = $b;
126 public function setIncludePolygonAsSVG($b = true)
128 $this->bIncludePolygonAsSVG = $b;
131 public function setPolygonSimplificationThreshold($f)
133 $this->fPolygonSimplificationThreshold = $f;
136 private function addressImportanceSql($sGeometry, $sPlaceId)
138 if ($this->sAnchorSql) {
139 $sSQL = 'ST_Distance('.$this->sAnchorSql.','.$sGeometry.')';
141 $sSQL = '(SELECT max(ai_p.importance * (ai_p.rank_address + 2))';
142 $sSQL .= ' FROM place_addressline ai_s, placex ai_p';
143 $sSQL .= ' WHERE ai_s.place_id = '.$sPlaceId;
144 $sSQL .= ' AND ai_p.place_id = ai_s.address_place_id ';
145 $sSQL .= ' AND ai_s.isaddress ';
146 $sSQL .= ' AND ai_p.importance is not null)';
149 return $sSQL.' AS addressimportance,';
152 private function langAddressSql($sHousenumber)
154 return 'get_address_by_language(place_id,'.$sHousenumber.','.$this->aLangPrefOrderSql.') AS langaddress,';
157 public function lookupOSMID($sType, $iID)
159 $sSQL = "select place_id from placex where osm_type = '".$sType."' and osm_id = ".$iID;
160 $iPlaceID = chksql($this->oDB->getOne($sSQL));
166 $aResults = $this->lookup(array($iPlaceID => new Result($iPlaceID)));
168 return sizeof($aResults) ? reset($aResults) : null;
171 public function lookup($aResults, $iMinRank = 0, $iMaxRank = 30)
173 if (!sizeof($aResults)) {
176 $aSubSelects = array();
178 $sPlaceIDs = Result::joinIdsByTable($aResults, Result::TABLE_PLACEX);
179 if (CONST_Debug) var_dump('PLACEX', $sPlaceIDs);
182 $sSQL .= ' osm_type,';
186 $sSQL .= ' admin_level,';
187 $sSQL .= ' rank_search,';
188 $sSQL .= ' rank_address,';
189 $sSQL .= ' min(place_id) AS place_id,';
190 $sSQL .= ' min(parent_place_id) AS parent_place_id,';
191 $sSQL .= ' housenumber,';
192 $sSQL .= ' country_code,';
193 $sSQL .= $this->langAddressSql('-1');
194 $sSQL .= ' get_name_by_language(name,'.$this->aLangPrefOrderSql.') AS placename,';
195 $sSQL .= " get_name_by_language(name, ARRAY['ref']) AS ref,";
196 if ($this->bExtraTags) {
197 $sSQL .= 'hstore_to_json(extratags)::text AS extra,';
199 if ($this->bNameDetails) {
200 $sSQL .= 'hstore_to_json(name)::text AS names,';
202 $sSQL .= ' avg(ST_X(centroid)) AS lon, ';
203 $sSQL .= ' avg(ST_Y(centroid)) AS lat, ';
204 $sSQL .= ' COALESCE(importance,0.75-(rank_search::float/40)) AS importance, ';
205 $sSQL .= $this->addressImportanceSql(
206 'ST_Collect(centroid)',
207 'min(CASE WHEN placex.rank_search < 28 THEN placex.place_id ELSE placex.parent_place_id END)'
209 $sSQL .= " (extratags->'place') AS extra_place ";
210 $sSQL .= ' FROM placex';
211 $sSQL .= " WHERE place_id in ($sPlaceIDs) ";
213 $sSQL .= " placex.rank_address between $iMinRank and $iMaxRank ";
214 if (14 >= $iMinRank && 14 <= $iMaxRank) {
215 $sSQL .= " OR (extratags->'place') = 'city'";
217 if ($this->sAddressRankListSql) {
218 $sSQL .= ' OR placex.rank_address in '.$this->sAddressRankListSql;
221 if ($this->sAllowedTypesSQLList) {
222 $sSQL .= 'AND placex.class in '.$this->sAllowedTypesSQLList;
224 $sSQL .= ' AND linked_place_id is null ';
225 $sSQL .= ' GROUP BY ';
226 $sSQL .= ' osm_type, ';
227 $sSQL .= ' osm_id, ';
230 $sSQL .= ' admin_level, ';
231 $sSQL .= ' rank_search, ';
232 $sSQL .= ' rank_address, ';
233 $sSQL .= ' housenumber,';
234 $sSQL .= ' country_code, ';
235 $sSQL .= ' importance, ';
236 if (!$this->bDeDupe) $sSQL .= 'place_id,';
237 $sSQL .= ' langaddress, ';
238 $sSQL .= ' placename, ';
240 if ($this->bExtraTags) $sSQL .= 'extratags, ';
241 if ($this->bNameDetails) $sSQL .= 'name, ';
242 $sSQL .= " extratags->'place' ";
244 $aSubSelects[] = $sSQL;
248 $sPlaceIDs = Result::joinIdsByTable($aResults, Result::TABLE_POSTCODE);
251 $sSQL .= " 'P' as osm_type,";
252 $sSQL .= " (SELECT osm_id from placex p WHERE p.place_id = lp.parent_place_id) as osm_id,";
253 $sSQL .= " 'place' as class, 'postcode' as type,";
254 $sSQL .= ' null as admin_level, rank_search, rank_address,';
255 $sSQL .= ' place_id, parent_place_id,';
256 $sSQL .= ' null as housenumber,';
257 $sSQL .= ' country_code,';
258 $sSQL .= $this->langAddressSql('-1');
259 $sSQL .= " postcode as placename,";
260 $sSQL .= " postcode as ref,";
261 if ($this->bExtraTags) $sSQL .= "null AS extra,";
262 if ($this->bNameDetails) $sSQL .= "null AS names,";
263 $sSQL .= " ST_x(geometry) AS lon, ST_y(geometry) AS lat,";
264 $sSQL .= " (0.75-(rank_search::float/40)) AS importance, ";
265 $sSQL .= $this->addressImportanceSql('geometry', 'lp.parent_place_id');
266 $sSQL .= " null AS extra_place ";
267 $sSQL .= "FROM location_postcode lp";
268 $sSQL .= " WHERE place_id in ($sPlaceIDs) ";
269 $sSQL .= " AND lp.rank_address between $iMinRank and $iMaxRank";
271 $aSubSelects[] = $sSQL;
274 // All other tables are rank 30 only.
275 if ($iMaxRank == 30) {
277 if (CONST_Use_US_Tiger_Data) {
278 $sPlaceIDs = Result::joinIdsByTable($aResults, Result::TABLE_TIGER);
280 $sHousenumbers = Result::sqlHouseNumberTable($aResults, Result::TABLE_TIGER);
281 // Tiger search only if a housenumber was searched and if it was found
282 // (realized through a join)
284 $sSQL .= " 'T' AS osm_type, ";
285 $sSQL .= " (SELECT osm_id from placex p WHERE p.place_id=blub.parent_place_id) as osm_id, ";
286 $sSQL .= " 'place' AS class, ";
287 $sSQL .= " 'house' AS type, ";
288 $sSQL .= ' null AS admin_level, ';
289 $sSQL .= ' 30 AS rank_search, ';
290 $sSQL .= ' 30 AS rank_address, ';
291 $sSQL .= ' place_id, ';
292 $sSQL .= ' parent_place_id, ';
293 $sSQL .= ' housenumber_for_place as housenumber,';
294 $sSQL .= " 'us' AS country_code, ";
295 $sSQL .= $this->langAddressSql('housenumber_for_place');
296 $sSQL .= " null AS placename, ";
297 $sSQL .= " null AS ref, ";
298 if ($this->bExtraTags) $sSQL .= "null AS extra,";
299 if ($this->bNameDetails) $sSQL .= "null AS names,";
300 $sSQL .= " st_x(centroid) AS lon, ";
301 $sSQL .= " st_y(centroid) AS lat,";
302 $sSQL .= " -1.15 AS importance, ";
303 $sSQL .= $this->addressImportanceSql('centroid', 'blub.parent_place_id');
304 $sSQL .= " null AS extra_place ";
306 $sSQL .= " SELECT place_id, "; // interpolate the Tiger housenumbers here
307 $sSQL .= " ST_LineInterpolatePoint(linegeo, (housenumber_for_place-startnumber::float)/(endnumber-startnumber)::float) AS centroid, ";
308 $sSQL .= " parent_place_id, ";
309 $sSQL .= " housenumber_for_place";
311 $sSQL .= " location_property_tiger ";
312 $sSQL .= " JOIN (values ".$sHousenumbers.") AS housenumbers(place_id, housenumber_for_place) USING(place_id)) ";
314 $sSQL .= " housenumber_for_place >= startnumber";
315 $sSQL .= " AND housenumber_for_place <= endnumber";
316 $sSQL .= " ) AS blub"; //postgres wants an alias here
318 $aSubSelects[] = $sSQL;
322 // osmline - interpolated housenumbers
323 $sPlaceIDs = Result::joinIdsByTable($aResults, Result::TABLE_OSMLINE);
325 $sHousenumbers = Result::sqlHouseNumberTable($aResults, Result::TABLE_OSMLINE);
326 // interpolation line search only if a housenumber was searched
327 // (realized through a join)
329 $sSQL .= " 'W' AS osm_type, ";
330 $sSQL .= " osm_id, ";
331 $sSQL .= " 'place' AS class, ";
332 $sSQL .= " 'house' AS type, ";
333 $sSQL .= ' 15 AS admin_level, ';
334 $sSQL .= ' 30 AS rank_search, ';
335 $sSQL .= ' 30 AS rank_address, ';
336 $sSQL .= ' place_id, ';
337 $sSQL .= ' parent_place_id, ';
338 $sSQL .= ' housenumber_for_place as housenumber,';
339 $sSQL .= ' country_code, ';
340 $sSQL .= $this->langAddressSql('housenumber_for_place');
341 $sSQL .= ' null AS placename, ';
342 $sSQL .= ' null AS ref, ';
343 if ($this->bExtraTags) $sSQL .= 'null AS extra, ';
344 if ($this->bNameDetails) $sSQL .= 'null AS names, ';
345 $sSQL .= ' st_x(centroid) AS lon, ';
346 $sSQL .= ' st_y(centroid) AS lat, ';
347 // slightly smaller than the importance for normal houses
348 $sSQL .= " -0.1 AS importance, ";
349 $sSQL .= $this->addressImportanceSql('centroid', 'blub.parent_place_id');
350 $sSQL .= " null AS extra_place ";
353 $sSQL .= " osm_id, ";
354 $sSQL .= " place_id, ";
355 $sSQL .= " country_code, ";
356 $sSQL .= " CASE "; // interpolate the housenumbers here
357 $sSQL .= " WHEN startnumber != endnumber ";
358 $sSQL .= " THEN ST_LineInterpolatePoint(linegeo, (housenumber_for_place-startnumber::float)/(endnumber-startnumber)::float) ";
359 $sSQL .= " ELSE ST_LineInterpolatePoint(linegeo, 0.5) ";
360 $sSQL .= " END as centroid, ";
361 $sSQL .= " parent_place_id, ";
362 $sSQL .= " housenumber_for_place ";
364 $sSQL .= " location_property_osmline ";
365 $sSQL .= " JOIN (values ".$sHousenumbers.") AS housenumbers(place_id, housenumber_for_place) USING(place_id)";
367 $sSQL .= " WHERE housenumber_for_place >= 0 ";
368 $sSQL .= " ) as blub"; //postgres wants an alias here
370 $aSubSelects[] = $sSQL;
373 if (CONST_Use_Aux_Location_data) {
374 $sPlaceIDs = Result::joinIdsByTable($aResults, Result::TABLE_AUX);
376 $sHousenumbers = Result::sqlHouseNumberTable($aResults, Result::TABLE_AUX);
378 $sSQL .= " 'L' AS osm_type, ";
379 $sSQL .= " place_id AS osm_id, ";
380 $sSQL .= " 'place' AS class,";
381 $sSQL .= " 'house' AS type, ";
382 $sSQL .= ' null AS admin_level, ';
383 $sSQL .= ' 30 AS rank_search,';
384 $sSQL .= ' 30 AS rank_address, ';
385 $sSQL .= ' place_id,';
386 $sSQL .= ' parent_place_id, ';
387 $sSQL .= ' housenumber,';
388 $sSQL .= " 'us' AS country_code, ";
389 $sSQL .= $this->langAddressSql('-1');
390 $sSQL .= " null AS placename, ";
391 $sSQL .= " null AS ref, ";
392 if ($this->bExtraTags) $sSQL .= "null AS extra, ";
393 if ($this->bNameDetails) $sSQL .= "null AS names, ";
394 $sSQL .= " ST_X(centroid) AS lon, ";
395 $sSQL .= " ST_Y(centroid) AS lat, ";
396 $sSQL .= " -1.10 AS importance, ";
397 $sSQL .= $this->addressImportanceSql(
399 'location_property_aux.parent_place_id'
401 $sSQL .= " null AS extra_place ";
402 $sSQL .= " FROM location_property_aux ";
403 $sSQL .= " WHERE place_id in ($sPlaceIDs) ";
405 $aSubSelects[] = $sSQL;
410 if (CONST_Debug) var_dump($aSubSelects);
412 if (!sizeof($aSubSelects)) {
417 $this->oDB->getAll(join(' UNION ', $aSubSelects)),
418 "Could not lookup place"
421 $aClassType = getClassTypes();
422 foreach ($aPlaces as &$aPlace) {
423 if ($this->bAddressDetails) {
424 // to get addressdetails for tiger data, the housenumber is needed
425 $aPlace['aAddress'] = $this->getAddressNames(
427 $aPlace['housenumber']
431 if ($this->bExtraTags) {
432 if ($aPlace['extra']) {
433 $aPlace['sExtraTags'] = json_decode($aPlace['extra']);
435 $aPlace['sExtraTags'] = (object) array();
439 if ($this->bNameDetails) {
440 if ($aPlace['names']) {
441 $aPlace['sNameDetails'] = json_decode($aPlace['names']);
443 $aPlace['sNameDetails'] = (object) array();
448 $sClassType = $aPlace['class'].':'.$aPlace['type'].':'.$aPlace['admin_level'];
449 if (isset($aClassType[$sClassType]) && isset($aClassType[$sClassType]['simplelabel'])) {
450 $sAddressType = $aClassType[$aClassType]['simplelabel'];
452 $sClassType = $aPlace['class'].':'.$aPlace['type'];
453 if (isset($aClassType[$sClassType]) && isset($aClassType[$sClassType]['simplelabel']))
454 $sAddressType = $aClassType[$sClassType]['simplelabel'];
455 else $sAddressType = $aPlace['class'];
458 $aPlace['addresstype'] = $sAddressType;
461 if (CONST_Debug) var_dump($aPlaces);
466 private function getAddressDetails($iPlaceID, $bAll, $sHousenumber)
469 $sSQL .= ' get_name_by_language(name,'.$this->aLangPrefOrderSql.') as localname';
470 $sSQL .= ' FROM get_addressdata('.$iPlaceID.','.$sHousenumber.')';
472 $sSQL .= " WHERE isaddress OR type = 'country_code'";
474 $sSQL .= ' ORDER BY rank_address desc,isaddress DESC';
476 return chksql($this->oDB->getAll($sSQL));
479 public function getAddressNames($iPlaceID, $sHousenumber = null)
481 $aAddressLines = $this->getAddressDetails(
484 $sHousenumber === null ? -1 : $sHousenumber
488 $aFallback = array();
489 $aClassType = getClassTypes();
490 foreach ($aAddressLines as $aLine) {
493 if (isset($aClassType[$aLine['class'].':'.$aLine['type'].':'.$aLine['admin_level']])) {
494 $aTypeLabel = $aClassType[$aLine['class'].':'.$aLine['type'].':'.$aLine['admin_level']];
495 } elseif (isset($aClassType[$aLine['class'].':'.$aLine['type']])) {
496 $aTypeLabel = $aClassType[$aLine['class'].':'.$aLine['type']];
497 } elseif (isset($aClassType['boundary:administrative:'.((int)($aLine['rank_address']/2))])) {
498 $aTypeLabel = $aClassType['boundary:administrative:'.((int)($aLine['rank_address']/2))];
501 $aTypeLabel = array('simplelabel' => 'address'.$aLine['rank_address']);
504 if ($aTypeLabel && ((isset($aLine['localname']) && $aLine['localname']) || (isset($aLine['housenumber']) && $aLine['housenumber']))) {
505 $sTypeLabel = strtolower(isset($aTypeLabel['simplelabel'])?$aTypeLabel['simplelabel']:$aTypeLabel['label']);
506 $sTypeLabel = str_replace(' ', '_', $sTypeLabel);
507 if (!isset($aAddress[$sTypeLabel]) || (isset($aFallback[$sTypeLabel]) && $aFallback[$sTypeLabel]) || $aLine['class'] == 'place') {
508 $aAddress[$sTypeLabel] = $aLine['localname']?$aLine['localname']:$aLine['housenumber'];
510 $aFallback[$sTypeLabel] = $bFallback;
518 /* returns an array which will contain the keys
520 * and may also contain one or more of the keys
530 public function getOutlines($iPlaceID, $fLon = null, $fLat = null, $fRadius = null)
533 $aOutlineResult = array();
534 if (!$iPlaceID) return $aOutlineResult;
536 if (CONST_Search_AreaPolygons) {
537 // Get the bounding box and outline polygon
538 $sSQL = "select place_id,0 as numfeatures,st_area(geometry) as area,";
539 $sSQL .= "ST_Y(centroid) as centrelat,ST_X(centroid) as centrelon,";
540 $sSQL .= "ST_YMin(geometry) as minlat,ST_YMax(geometry) as maxlat,";
541 $sSQL .= "ST_XMin(geometry) as minlon,ST_XMax(geometry) as maxlon";
542 if ($this->bIncludePolygonAsGeoJSON) $sSQL .= ",ST_AsGeoJSON(geometry) as asgeojson";
543 if ($this->bIncludePolygonAsKML) $sSQL .= ",ST_AsKML(geometry) as askml";
544 if ($this->bIncludePolygonAsSVG) $sSQL .= ",ST_AsSVG(geometry) as assvg";
545 if ($this->bIncludePolygonAsText || $this->bIncludePolygonAsPoints) $sSQL .= ",ST_AsText(geometry) as astext";
546 $sFrom = " from placex where place_id = ".$iPlaceID;
547 if ($this->fPolygonSimplificationThreshold > 0) {
548 $sSQL .= " from (select place_id,centroid,ST_SimplifyPreserveTopology(geometry,".$this->fPolygonSimplificationThreshold.") as geometry".$sFrom.") as plx";
553 $aPointPolygon = chksql($this->oDB->getRow($sSQL), "Could not get outline");
555 if ($aPointPolygon['place_id']) {
556 if ($aPointPolygon['centrelon'] !== null && $aPointPolygon['centrelat'] !== null) {
557 $aOutlineResult['lat'] = $aPointPolygon['centrelat'];
558 $aOutlineResult['lon'] = $aPointPolygon['centrelon'];
561 if ($this->bIncludePolygonAsGeoJSON) $aOutlineResult['asgeojson'] = $aPointPolygon['asgeojson'];
562 if ($this->bIncludePolygonAsKML) $aOutlineResult['askml'] = $aPointPolygon['askml'];
563 if ($this->bIncludePolygonAsSVG) $aOutlineResult['assvg'] = $aPointPolygon['assvg'];
564 if ($this->bIncludePolygonAsText) $aOutlineResult['astext'] = $aPointPolygon['astext'];
565 if ($this->bIncludePolygonAsPoints) $aOutlineResult['aPolyPoints'] = geometryText2Points($aPointPolygon['astext'], $fRadius);
568 if (abs($aPointPolygon['minlat'] - $aPointPolygon['maxlat']) < 0.0000001) {
569 $aPointPolygon['minlat'] = $aPointPolygon['minlat'] - $fRadius;
570 $aPointPolygon['maxlat'] = $aPointPolygon['maxlat'] + $fRadius;
573 if (abs($aPointPolygon['minlon'] - $aPointPolygon['maxlon']) < 0.0000001) {
574 $aPointPolygon['minlon'] = $aPointPolygon['minlon'] - $fRadius;
575 $aPointPolygon['maxlon'] = $aPointPolygon['maxlon'] + $fRadius;
578 $aOutlineResult['aBoundingBox'] = array(
579 (string)$aPointPolygon['minlat'],
580 (string)$aPointPolygon['maxlat'],
581 (string)$aPointPolygon['minlon'],
582 (string)$aPointPolygon['maxlon']
587 // as a fallback we generate a bounding box without knowing the size of the geometry
588 if ((!isset($aOutlineResult['aBoundingBox'])) && isset($fLon)) {
590 if ($this->bIncludePolygonAsPoints) {
591 $sGeometryText = 'POINT('.$fLon.','.$fLat.')';
592 $aOutlineResult['aPolyPoints'] = geometryText2Points($sGeometryText, $fRadius);
596 $aBounds['minlat'] = $fLat - $fRadius;
597 $aBounds['maxlat'] = $fLat + $fRadius;
598 $aBounds['minlon'] = $fLon - $fRadius;
599 $aBounds['maxlon'] = $fLon + $fRadius;
601 $aOutlineResult['aBoundingBox'] = array(
602 (string)$aBounds['minlat'],
603 (string)$aBounds['maxlat'],
604 (string)$aBounds['minlon'],
605 (string)$aBounds['maxlon']
608 return $aOutlineResult;