mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-07 10:08:27 +01:00
* add extrafield point * wip * wip * wip * input * input * output values * update values * update values * update values * update values * update values * wip * add geomapeditor * add geomapeditor * add linestring and polygon * add linestring and polygon * add linestring and polygon * add linestring and polygon * wip * wip * can store and retrieve linestring * can store and retrieve linestring * coordinates are inverted * coordinates are inverted * add multipoints * use text instead binary * auto center map * wip wip * doc * fix * wip * wip * translation dynamic --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
34 lines
913 B
PHP
34 lines
913 B
PHP
<?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; }
|
|
}
|