Skip to main content

geometryCollection

Creates a GeometryCollection geometry from an array of geometries.

The collection consumes the input geometries - after creating the collection, the input geometries become detached, are no longer valid and should not be used.

Type Parameters

  • P

Parameters

NameTypeDescription
geometriesGeometry[]Array of geometry objects to be included in the collection
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

GeometryCollection<P>

A new GeometryCollection containing all input geometries

Examples