feature
Description
Wraps a GeoJSON Geometry in a GeoJSON Feature.
Parameters
Name | Type | Description |
---|---|---|
geom | G | null | |
properties? | GeoJsonProperties | an Object of key-value pairs to add as properties (default {}) |
options? | Object | Optional Parameters (default {}) |
options.bbox? | BBox | Bounding Box Array [west, south, east, north] associated with the Feature |
options.id? | Id | Identifier associated with the Feature |
geometry | GeometryObject | input geometry |
Returns
Feature<GeometryObject, GeoJsonProperties> a GeoJSON Feature
Examples
var geometry = {
type: "Point",
coordinates: [110, 50],
};
var feature = turf.feature(geometry);
//=feature
Installation
$ npm install @turf/helpers
import { feature } from "@turf/helpers";
const result = feature(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.feature(...);