| .. | ||
| index.d.ts | ||
| index.js | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
@turf/invariant
getCoord
Unwrap a coordinate from a Point Feature, Geometry or a single coordinate.
Parameters
Returns Array<number> coordinates
getCoords
Unwrap coordinates from a Feature, Geometry Object or an Array of numbers
Parameters
Returns Array<any> coordinates
geojsonType
Enforce expectations about types of GeoJSON objects for Turf.
Parameters
-
valueGeoJSON any GeoJSON object -
typestring expected GeoJSON type -
namestring name of calling function -
Throws Error if value is not the expected type.
featureOf
Enforce expectations about types of Feature inputs for Turf. Internally this uses geojsonType to judge geometry types.
Parameters
-
featureFeature a feature with an expected geometry type -
typestring expected GeoJSON type -
namestring name of calling function -
Throws Error error if value is not the expected type.
collectionOf
Enforce expectations about types of FeatureCollection inputs for Turf. Internally this uses geojsonType to judge geometry types.
Parameters
-
featureCollectionFeatureCollection a FeatureCollection for which features will be judged -
typestring expected GeoJSON type -
namestring name of calling function -
Throws Error if value is not the expected type.
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Installation
Install this module individually:
$ npm install @turf/invariant
Or install the Turf module that includes it as a function:
$ npm install @turf/turf