# getCoords

Unwrap coordinates from a Feature, Geometry Object or an Array
从Feature、几何对象或数组中获取坐标

> npm install @turf/invariant

参数

参数 类型 描述
coord (Array|Geometry|Feature) Feature, Geometry Object或数组

返回

Array - coordinates

示例

// 注意:polygon首尾坐标要一致
var poly = turf.polygon([[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]]);

var coords = turf.getCoords(poly);
//= [[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]]
Last Updated: 1/17/2023, 5:38:58 PM