Skip to main content
Version: 6.5.0

collectionOf

Description

Enforce expectations about types of FeatureCollection inputs for Turf. Internally this uses geojsonType to judge geometry types.

Parameters

NameTypeDescription
featureCollectionFeatureCollectiona FeatureCollection for which features will be judged
typestringexpected GeoJSON type
namestringname of calling function

Returns

Installation

$ npm install @turf/invariant

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

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