Skip to main content
Version: 7.1.0

coordAll

Description

Get all coordinates from any GeoJSON object.

Parameters

NameTypeDescription
geojsonFeatureCollection | Feature | Geometryany GeoJSON object

Returns

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