protected function GeoRSS::parseBoxes in geoPHP 8
Same name and namespace in other branches
- 7 geoPHP/lib/adapters/GeoRSS.class.php \GeoRSS::parseBoxes()
1 call to GeoRSS::parseBoxes()
- GeoRSS::geomFromXML in geoPHP/
lib/ adapters/ GeoRSS.class.php
File
- geoPHP/
lib/ adapters/ GeoRSS.class.php, line 138
Class
- GeoRSS
- PHP Geometry/GeoRSS encoder/decoder
Code
protected function parseBoxes() {
$polygons = array();
$box_elements = $this->xmlobj
->getElementsByTagName('box');
foreach ($box_elements as $box) {
$parts = explode(' ', trim($box->firstChild->nodeValue));
$components = array(
new Point($parts[3], $parts[2]),
new Point($parts[3], $parts[0]),
new Point($parts[1], $parts[0]),
new Point($parts[1], $parts[2]),
new Point($parts[3], $parts[2]),
);
$exterior_ring = new LineString($components);
$polygons[] = new Polygon(array(
$exterior_ring,
));
}
return $polygons;
}