Skip to main content
Version: 6.5.0

getGeom

Description

Get Geometry from Feature or Geometry Object

Parameters

NameTypeDescription
geojsonFeature | GeometryGeoJSON Feature or Geometry Object

Returns

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