Skip to content

KBE3D / KBCore / turf / geometryCollection

函数: geometryCollection()

geometryCollection<G, P>(geometries: G[], properties?: P, options?: { bbox?: BBox; id?: Id; }): Feature<GeometryCollection<G>, P>

Function

Creates a Feature<GeometryCollection> based on a coordinate array. Properties can be added optionally.

类型参数

G

G extends Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon

P

P extends GeoJsonProperties = GeoJsonProperties

参数

geometries

G[]

an array of GeoJSON Geometries

properties?

P

an Object of key-value pairs to add as properties

options?

Optional Parameters

bbox?

BBox

Bounding Box Array [west, south, east, north] associated with the Feature

id?

Id

Identifier associated with the Feature

返回

Feature<GeometryCollection<G>, P>

a GeoJSON GeometryCollection Feature

示例

ts
var pt = turf.geometry("Point", [100, 0]);
var line = turf.geometry("LineString", [[101, 0], [102, 1]]);
var collection = turf.geometryCollection([pt, line]);

// => collection

KBE3D @3.0.0 Copyright © 2024-present KBE3D