geometry
Description
Creates a GeoJSON Geometry from a Geometry string type & coordinates.
For GeometryCollection type use helpers.geometryCollection
Parameters
Name | Type | Description |
---|---|---|
type | string | Geometry Type |
coordinates | Array<any> | Coordinates |
options? | Object | Optional Parameters (default {}) |
Returns
Geometry a GeoJSON Geometry
Examples
var type = "Point";
var coordinates = [110, 50];
var geometry = turf.geometry(type, coordinates);
// => geometry
Installation
$ npm install @turf/helpers
import { geometry } from "@turf/helpers";
const result = geometry(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.geometry(...);