You are here

public function Collection::isSimple in geoPHP 8

Same name and namespace in other branches
  1. 7 geoPHP/lib/geometry/Collection.class.php \Collection::isSimple()

Overrides Geometry::isSimple

4 methods override Collection::isSimple()
GeometryCollection::isSimple in geoPHP/lib/geometry/GeometryCollection.class.php
LineString::isSimple in geoPHP/lib/geometry/LineString.class.php
MultiPoint::isSimple in geoPHP/lib/geometry/MultiPoint.class.php
Polygon::isSimple in geoPHP/lib/geometry/Polygon.class.php

File

geoPHP/lib/geometry/Collection.class.php, line 259

Class

Collection
Collection: Abstract class for compound geometries

Code

public function isSimple() {
  if ($this
    ->geos()) {
    return $this
      ->geos()
      ->isSimple();
  }

  // A collection is simple if all it's components are simple
  foreach ($this->components as $component) {
    if (!$component
      ->isSimple()) {
      return FALSE;
    }
  }
  return TRUE;
}