You are here

EWKT.class.php in geoPHP 8

Same filename and directory in other branches
  1. 7 geoPHP/lib/adapters/EWKT.class.php

File

geoPHP/lib/adapters/EWKT.class.php
View source
<?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');
    }
  }

}

Classes

Namesort descending Description
EWKT EWKT (Extended Well Known Text) Adapter