box
Creates a rectangular Polygon geometry from bounding box coordinates.
Polygon is oriented clockwise.
Type Parameters
-
P
Parameters
| Name | Type | Description |
|---|---|---|
bbox | number[] | Array of four numbers [ xMin, yMin, xMax, yMax ] |
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 Polygon geometry
Throws
GEOSErrorwhen box is degenerated: width or height is0
See also
boundscalculates bounding box of an existing geometry