Skip to content

geodalib / core/src / getGeometryCollection

Function: getGeometryCollection() ​

getGeometryCollection(__namedParameters): Promise<GeometryCollection>

Defined in: core/src/geometry/utils.ts:198

Get GeometryCollection from input geometries. The input geometries can be

  1. GeoJSON features
  2. binary feature collections
  3. point layer data
  4. arc layer data
  5. hexagon id layer data

Parameters ​

__namedParameters ​

convertToUTM? ​

boolean = false

convert to UTM

fixPolygon? ​

boolean = true

fix polygon

geometries ​

SpatialGeometry

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 });