You are here

public function Geometry::geos in geoPHP 7

Same name and namespace in other branches
  1. 8 geoPHP/lib/geometry/Geometry.class.php \Geometry::geos()
37 calls to Geometry::geos()
Collection::area in geoPHP/lib/geometry/Collection.class.php
Collection::boundary in geoPHP/lib/geometry/Collection.class.php
Collection::centroid in geoPHP/lib/geometry/Collection.class.php
Collection::equals in geoPHP/lib/geometry/Collection.class.php
Collection::getBBox in geoPHP/lib/geometry/Collection.class.php

... See full list

File

geoPHP/lib/geometry/Geometry.class.php, line 142

Class

Geometry
Geometry abstract class

Code

public function geos() {

  // If it's already been set, just return it
  if ($this->geos && geoPHP::geosInstalled()) {
    return $this->geos;
  }

  // It hasn't been set yet, generate it
  if (geoPHP::geosInstalled()) {
    $reader = new GEOSWKBReader();
    $this->geos = $reader
      ->readHEX($this
      ->out('wkb', TRUE));
  }
  else {
    $this->geos = FALSE;
  }
  return $this->geos;
}