getCoord
Description
Unwrap a coordinate from a Point Feature, Geometry or a single coordinate.
Parameters
Name | Type | Description |
---|---|---|
coord | Array<number> | Geometry<Point> | Feature<Point> | GeoJSON Point or an Array of numbers |
Returns
Array<number> coordinates
Examples
var pt = turf.point([10, 10]);
var coord = turf.getCoord(pt);
//= [10, 10]
Installation
$ npm install @turf/invariant
import { getCoord } from "@turf/invariant";
const result = getCoord(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.getCoord(...);