polygon
Creates a Polygon
geometry from an array of linear rings coordinates.
The first ring represents the exterior ring (shell), subsequent rings represent interior rings (holes). Each ring must be a closed line string with first and last positions identical and contain at least 3 positions. Empty polygons without any rings are allowed.
Type Parameters
-
P
Parameters
Name | Type | Description |
---|---|---|
ppts | Position[][] | Polygon coordinates |
options? | object | Optional geometry options |
options.id? | number | string | Optional identifier to be assigned to the geometry instance. |
options.properties? | P | Optional data to be assigned to the geometry instance. |
Returns
Polygon<P>
A new Geometry object
Throws
InvalidGeoJSONError
if any ring is invalid (not closed or with 1 or 2 positions)