You are here

public function Polygon::dimension in geoPHP 7

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

Overrides Collection::dimension

File

geoPHP/lib/geometry/Polygon.class.php, line 119

Class

Polygon
Polygon: A polygon is a plane figure that is bounded by a closed path, composed of a finite sequence of straight line segments

Code

public function dimension() {
  if ($this
    ->isEmpty()) {
    return 0;
  }
  return 2;
}