Skip to main content

box

Creates a rectangular Polygon geometry from bounding box coordinates.

Polygon is oriented clockwise.

Type Parameters

  • P

Parameters

NameTypeDescription
bboxnumber[]Array of four numbers [ xMin, yMin, xMax, yMax ]
options?objectOptional geometry options
options.id?number | stringOptional identifier to be assigned to the geometry instance.
options.properties?POptional data to be assigned to the geometry instance.

Returns

Polygon<P>

A new Polygon geometry

Throws

  • GEOSError when box is degenerated: width or height is 0

See also

  • bounds calculates bounding box of an existing geometry

Examples