Skip to content

KBE3D / KBCore / turf / polygon

函数: polygon()

polygon<P>(coordinates: Position[][], properties?: P, options?: { bbox?: BBox; id?: Id; }): Feature<Polygon, P>

Function

Creates a Polygon Feature from an Array of LinearRings.

类型参数

P

P extends GeoJsonProperties = GeoJsonProperties

参数

coordinates

Position[][]

an array of LinearRings

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

Polygon Feature

示例

ts
var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], { name: 'poly1' });

//=polygon

KBE3D @3.0.0 Copyright © 2024-present KBE3D