You are here

public function Collection::length in geoPHP 7

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

Overrides Geometry::length

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

File

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

Class

Collection
Collection: Abstract class for compound geometries

Code

public function length() {
  $length = 0;
  foreach ($this->components as $delta => $component) {
    $length += $component
      ->length();
  }
  return $length;
}