first import
This commit is contained in:
27
sites/all/modules/geophp/geoPHP/lib/adapters/EWKT.class.php
Normal file
27
sites/all/modules/geophp/geoPHP/lib/adapters/EWKT.class.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user