描述
从任何 GeoJSON 对象获取所有坐标。
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| geojson | AllGeoJSON | 任何 GeoJSON 对象 |
返回值
示例
javascript
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]]安装
javascript
$ npm install @turf/meta
import { coordAll } from "@turf/meta";
const result = coordAll(...);javascript
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.coordAll(...);