mirror of
https://0xacab.org/radar/radar-wp.git
synced 2025-06-09 21:26:27 +02:00
Initial import.
This commit is contained in:
commit
86383280c9
428 changed files with 68738 additions and 0 deletions
29
vendor/phayes/geophp/lib/geometry/GeometryCollection.class.php
vendored
Normal file
29
vendor/phayes/geophp/lib/geometry/GeometryCollection.class.php
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
/**
|
||||
* GeometryCollection: A heterogenous collection of geometries
|
||||
*/
|
||||
class GeometryCollection extends Collection
|
||||
{
|
||||
protected $geom_type = 'GeometryCollection';
|
||||
|
||||
// We need to override asArray. Because geometryCollections are heterogeneous
|
||||
// we need to specify which type of geometries they contain. We need to do this
|
||||
// because, for example, there would be no way to tell the difference between a
|
||||
// MultiPoint or a LineString, since they share the same structure (collection
|
||||
// of points). So we need to call out the type explicitly.
|
||||
public function asArray() {
|
||||
$array = array();
|
||||
foreach ($this->components as $component) {
|
||||
$array[] = array(
|
||||
'type' => $component->geometryType(),
|
||||
'components' => $component->asArray(),
|
||||
);
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
// Not valid for this geomettry
|
||||
public function boundary() { return NULL; }
|
||||
public function isSimple() { return NULL; }
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue