Skip to main content
Version: 7.3.0

coordAll

描述

🌐 Description

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

🌐 Get all coordinates from any GeoJSON object.

参数

🌐 Parameters

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

返回

🌐 Returns

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

示例

🌐 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(...);