protected function KML::_extractCoordinates in geoPHP 8
Same name and namespace in other branches
- 7 geoPHP/lib/adapters/KML.class.php \KML::_extractCoordinates()
2 calls to KML::_extractCoordinates()
- KML::parseLineString in geoPHP/
lib/ adapters/ KML.class.php - KML::parsePoint in geoPHP/
lib/ adapters/ KML.class.php
File
- geoPHP/
lib/ adapters/ KML.class.php, line 168
Class
- KML
- PHP Geometry/KML encoder/decoder
Code
protected function _extractCoordinates($xml) {
$coord_elements = $this
->childElements($xml, 'coordinates');
$coordinates = array();
if (count($coord_elements)) {
$coord_sets = explode(' ', $coord_elements[0]->nodeValue);
foreach ($coord_sets as $set_string) {
$set_string = trim($set_string);
if ($set_string) {
$set_array = explode(',', $set_string);
if (count($set_array) >= 2) {
$coordinates[] = $set_array;
}
}
}
}
return $coordinates;
}