public function EWKT::write in geoPHP 7
Same name and namespace in other branches
- 8 geoPHP/lib/adapters/EWKT.class.php \EWKT::write()
Serialize geometries into an EWKT string.
Parameters
Geometry $geometry:
Return value
string The Extended-WKT string representation of the input geometries
Overrides WKT::write
File
- geoPHP/
lib/ adapters/ EWKT.class.php, line 15
Class
- EWKT
- EWKT (Extended Well Known Text) Adapter
Code
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');
}
}