geodalib / core/src / getGeometryCollection
Function: getGeometryCollection()
getGeometryCollection(
__namedParameters
):Promise
<GeometryCollection
>
Defined in: core/src/geometry/utils.ts:189
Get GeometryCollection from input geometries. The input geometries can be
- GeoJSON features
- binary feature collections
- point layer data
- arc layer data
- hexagon id layer data
Parameters
__namedParameters
convertToUTM?
boolean
= false
convert to UTM
fixPolygon?
boolean
= true
fix polygon
geometries
input geometries see SpatialGeometry
Returns
Promise
<GeometryCollection
>
GeometryCollection - the geometry collection used in GeoDaLib see src/spatial_features.h
Example
ts
const geoms = [
{ type: 'Feature', geometry: { type: 'Polygon', coordinates: [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]] }, properties: { index: 0 } },
];
const geometryCollection = await getGeometryCollection({ geometries: geoms });