Skip to content

KBE3D / KBCore / turf / feature

函数: feature()

feature<G, P>(geom: G | null, properties?: P, options?: { bbox?: BBox; id?: Id; }): Feature<G, P>

Function

Wraps a GeoJSON Geometry in a GeoJSON Feature.

类型参数

G

G extends Geometry = Geometry

P

P extends GeoJsonProperties = GeoJsonProperties

参数

geom

G | null

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<G, P>

a GeoJSON Feature

示例

ts
var geometry = {
  "type": "Point",
  "coordinates": [110, 50]
};

var feature = turf.feature(geometry);

//=feature

KBE3D @3.0.0 Copyright © 2024-present KBE3D