You are here

public function Collection::greatCircleLength in geoPHP 7

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

Overrides Geometry::greatCircleLength

1 method overrides Collection::greatCircleLength()
LineString::greatCircleLength in geoPHP/lib/geometry/LineString.class.php

File

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

Class

Collection
Collection: Abstract class for compound geometries

Code

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