2
0
forked from Wavyzz/dolibarr
Files
Frédéric FRANCE 7ea6a406bd NEW add geometrics extrafield (#28239)
* 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>
2024-04-24 15:27:38 +02:00

28 lines
498 B
PHP

<?php
/**
* EWKT (Extended Well Known Text) Adapter
*/
class EWKT extends WKT
{
/**
* Serialize geometries into an EWKT string.
*
* @param Geometry $geometry
*
* @return string The Extended-WKT string representation of the input geometries
*/
public function write(Geometry $geometry)
{
$srid = $geometry->SRID();
$wkt = '';
if ($srid) {
$wkt = 'SRID=' . $srid . ';';
$wkt .= $geometry->out('wkt');
return $wkt;
} else {
return $geometry->out('wkt');
}
}
}