Skip to main content
Version: Next

getCoords

描述

¥Description

Unwrap coordinates from a Feature, Geometry Object or an Array

参数

¥Parameters

名称类型描述
coords数组<any> | 几何图形 | 特性Feature, Geometry Object or an Array

返回

¥Returns

数组<任意> 坐标

¥Array<any> coordinates

示例

¥Examples

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

安装

¥Installation

$ npm install @turf/invariant

import { getCoords } from "@turf/invariant";
const result = getCoords(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.getCoords(...);