Skip to main content
Version: Next

getGeom

Description

Get Geometry from Feature or Geometry Object

Parameters

NameTypeDescription
geojsonFeature | GeometryGeoJSON Feature or Geometry Object

Returns

Geometry | null GeoJSON Geometry Object

Examples

var point = {
type: "Feature",
properties: {},
geometry: {
type: "Point",
coordinates: [110, 40],
},
};
var geom = turf.getGeom(point);
//={"type": "Point", "coordinates": [110, 40]}

Installation

$ npm install @turf/invariant

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

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