You are here

class EWKT in geoPHP 8

Same name and namespace in other branches
  1. 7 geoPHP/lib/adapters/EWKT.class.php \EWKT

EWKT (Extended Well Known Text) Adapter

Hierarchy

Expanded class hierarchy of EWKT

1 string reference to 'EWKT'
geoPHP::getAdapterMap in geoPHP/geoPHP.inc

File

geoPHP/lib/adapters/EWKT.class.php, line 5

View source
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');
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EWKT::write public function Serialize geometries into an EWKT string. Overrides WKT::write
WKT::beginsWith protected function
WKT::endsWith protected function
WKT::extractData public function Extract geometry to a WKT string
WKT::getDataString protected function
WKT::parseGeometryCollection private function
WKT::parseLineString private function
WKT::parseMultiLineString private function
WKT::parseMultiPoint private function
WKT::parseMultiPolygon private function
WKT::parsePoint private function
WKT::parsePolygon private function
WKT::read public function Read WKT string into geometry objects Overrides GeoAdapter::read
WKT::trimParens protected function Trim the parenthesis and spaces