Polygon
in package
Polygon represented as a set of coordinates (vertices/points).
Table of Contents
Properties
- $coordinates : array<string|int, mixed>|null
Methods
- __construct() : mixed
- __toString() : string
- getCentroid() : Point
- Retrieves the centroid of the polygon.
- getCoordinates() : array<string|int, mixed>|null
- Retrieves the coordinates of the polygon.
- isEmpty() : bool
- Checks whether the Polygon has coordinates.
Properties
$coordinates
private
array<string|int, mixed>|null
$coordinates
Vertices of the polygon.
Methods
__construct()
public
__construct([array<string|int, mixed>|null $coordinates = null ]) : mixed
Parameters
- $coordinates : array<string|int, mixed>|null = null
-
Coordinates of the polygon as a set of Points.
__toString()
public
__toString() : string
Return values
string —String representation.
getCentroid()
Retrieves the centroid of the polygon.
public
getCentroid() : Point
Return values
PointgetCoordinates()
Retrieves the coordinates of the polygon.
public
getCoordinates() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullisEmpty()
Checks whether the Polygon has coordinates.
public
isEmpty() : bool