You are here

class GeometryCollection in geoPHP 8

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

GeometryCollection: A heterogenous collection of geometries

Hierarchy

Expanded class hierarchy of GeometryCollection

7 string references to 'GeometryCollection'
EWKB::write in geoPHP/lib/adapters/EWKB.class.php
Serialize geometries into an EWKB binary string.
GeoJSON::getArray in geoPHP/lib/adapters/GeoJSON.class.php
GeoJSON::objToGeom in geoPHP/lib/adapters/GeoJSON.class.php
geoPHP::geometryList in geoPHP/geoPHP.inc
geoPHP::geometryReduce in geoPHP/geoPHP.inc

... See full list

File

geoPHP/lib/geometry/GeometryCollection.class.php, line 5

View source
class GeometryCollection extends Collection {
  protected $geom_type = 'GeometryCollection';

  // We need to override asArray. Because geometryCollections are heterogeneous
  // we need to specify which type of geometries they contain. We need to do this
  // because, for example, there would be no way to tell the difference between a
  // MultiPoint or a LineString, since they share the same structure (collection
  // of points). So we need to call out the type explicitly.
  public function asArray() {
    $array = array();
    foreach ($this->components as $component) {
      $array[] = array(
        'type' => $component
          ->geometryType(),
        'components' => $component
          ->asArray(),
      );
    }
    return $array;
  }

  // Not valid for this geomettry
  public function boundary() {
    return NULL;
  }
  public function isSimple() {
    return NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Collection::$components public property
Collection::area public function Overrides Geometry::area 2
Collection::centroid public function Overrides Geometry::centroid 1
Collection::dimension public function Overrides Geometry::dimension 2
Collection::endPoint public function Overrides Geometry::endPoint 1
Collection::equals public function Overrides Geometry::equals
Collection::explode public function Overrides Geometry::explode 2
Collection::exteriorRing public function Overrides Geometry::exteriorRing 1
Collection::geometryN public function Overrides Geometry::geometryN
Collection::getBBox public function Overrides Geometry::getBBox
Collection::getComponents public function Returns Collection component geometries
Collection::getPoints public function Overrides Geometry::getPoints
Collection::greatCircleLength public function Overrides Geometry::greatCircleLength 1
Collection::haversineLength public function Overrides Geometry::haversineLength 1
Collection::interiorRingN public function Overrides Geometry::interiorRingN 1
Collection::isClosed public function Overrides Geometry::isClosed 2
Collection::isEmpty public function Overrides Geometry::isEmpty
Collection::isRing public function Overrides Geometry::isRing 1
Collection::length public function Overrides Geometry::length 2
Collection::numGeometries public function Overrides Geometry::numGeometries
Collection::numInteriorRings public function Overrides Geometry::numInteriorRings 1
Collection::numPoints public function Overrides Geometry::numPoints 2
Collection::pointN public function Overrides Geometry::pointN 1
Collection::pointOnSurface public function Overrides Geometry::pointOnSurface
Collection::startPoint public function Overrides Geometry::startPoint 1
Collection::x public function Overrides Geometry::x
Collection::y public function Overrides Geometry::y
Collection::__construct public function Constructor: Checks and sets component geometries 1
Geometry::$geos private property
Geometry::$srid protected property
Geometry::asBinary public function
Geometry::asText public function
Geometry::buffer public function
Geometry::checkValidity public function
Geometry::contains public function
Geometry::convexHull public function
Geometry::coordinateDimension public function
Geometry::coveredBy public function
Geometry::covers public function
Geometry::crosses public function
Geometry::difference public function
Geometry::disjoint public function
Geometry::distance public function
Geometry::envelope public function
Geometry::equalsExact public function
Geometry::geometryType public function
Geometry::geos public function
Geometry::getArea public function
Geometry::getCentroid public function
Geometry::getGeomType public function
Geometry::getGeos public function
Geometry::getSRID public function
Geometry::getX public function
Geometry::getY public function
Geometry::hasZ public function
Geometry::hausdorffDistance public function
Geometry::intersection public function
Geometry::intersects public function
Geometry::is3D public function
Geometry::isMeasured public function
Geometry::m public function
Geometry::out public function
Geometry::overlaps public function
Geometry::project public function
Geometry::relate public function
Geometry::setGeos public function
Geometry::setSRID public function
Geometry::simplify public function
Geometry::SRID public function
Geometry::symDifference public function
Geometry::touches public function
Geometry::union public function
Geometry::within public function
Geometry::z public function 1
GeometryCollection::$geom_type protected property Overrides Geometry::$geom_type
GeometryCollection::asArray public function Overrides Collection::asArray
GeometryCollection::boundary public function Overrides Collection::boundary
GeometryCollection::isSimple public function Overrides Collection::isSimple