You are here

public function Collection::boundary in geoPHP 8

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

Overrides Geometry::boundary

2 methods override Collection::boundary()
GeometryCollection::boundary in geoPHP/lib/geometry/GeometryCollection.class.php
LineString::boundary in geoPHP/lib/geometry/LineString.class.php

File

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

Class

Collection
Collection: Abstract class for compound geometries

Code

public function boundary() {
  if ($this
    ->isEmpty()) {
    return new LineString();
  }
  if ($this
    ->geos()) {
    return $this
      ->geos()
      ->boundary();
  }
  $components_boundaries = array();
  foreach ($this->components as $component) {
    $components_boundaries[] = $component
      ->boundary();
  }
  return geoPHP::geometryReduce($components_boundaries);
}