Skip to content

KBE3D / KBCore / turf / featureCollection

函数: featureCollection()

featureCollection<G, P>(features: Feature<G, P>[], options?: { bbox?: BBox; id?: Id; }): FeatureCollection<G, P>

Function

Takes one or more Features and creates a FeatureCollection.

类型参数

G

G extends Geometry = Geometry

P

P extends GeoJsonProperties = GeoJsonProperties

参数

features

Feature<G, P>[]

input features

options?

Optional Parameters

bbox?

BBox

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

id?

Id

Identifier associated with the Feature

返回

FeatureCollection<G, P>

FeatureCollection of Features

示例

ts
var locationA = turf.point([-75.343, 39.984], {name: 'Location A'});
var locationB = turf.point([-75.833, 39.284], {name: 'Location B'});
var locationC = turf.point([-75.534, 39.123], {name: 'Location C'});

var collection = turf.featureCollection([
  locationA,
  locationB,
  locationC
]);

//=collection

KBE3D @3.0.0 Copyright © 2024-present KBE3D