# polygon
Creates a Polygon Feature from an Array of LinearRings.
从LinearRing
数组创建Polygon
。
> npm install @turf/helpers
参数
参数 | 类型 | 描述 |
---|---|---|
coordinates | Array | an array of LinearRings |
properties | Object | an Object of key-value pairs to add as properties |
options | Object | 可选参数:见下文 |
options选项
属性 | 类型 | 默认值 | 描述 |
---|---|---|---|
bbox | (Array) | Bounding Box Array | |
id | (string|number) | Identifier associated with the Feature |
返回
Feature <Polygon> - Polygon Feature
示例
// 注意:polygon首尾坐标要一致
var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], { name: 'poly1' });
//=polygon