Skip to main content
Version: 7.2.0

coordAll

描述

¥Description

从任意 GeoJSON 对象获取所有坐标。

¥Get all coordinates from any GeoJSON object.

参数

¥Parameters

名称类型描述
geojsonAllGeoJSON任意 GeoJSON 对象

返回

¥Returns

数组<数组<number>> 坐标位置数组

¥Array<Array<number>> coordinate position array

示例

¥Examples

var features = turf.featureCollection([
turf.point([26, 37], { foo: "bar" }),
turf.point([36, 53], { hello: "world" }),
]);

var coords = turf.coordAll(features);
//= [[26, 37], [36, 53]]

安装

¥Installation

$ npm install @turf/meta

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

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