Skip to content

KBE3D / KBCore / turf / getCoords

函数: getCoords()

getCoords<G>(coords: any[] | G | Feature<G, GeoJsonProperties>): any[]

Function

Unwrap coordinates from a Feature, Geometry Object or an Array

类型参数

G

G extends Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon

参数

coords

Feature, Geometry Object or an Array

any[] | G | Feature<G, GeoJsonProperties>

返回

any[]

coordinates

示例

ts
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]]]

KBE3D @3.0.0 Copyright © 2024-present KBE3D