Skip to main content
Version: 7.2.0

collectionOf

描述

¥Description

强制执行 Turf 对 FeatureCollection 输入类型的预期。内部使用 geojsonType 判断几何体类型。

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

参数

¥Parameters

名称类型描述
featureCollectionFeatureCollection用于评判特性的特性集合
typestring预期 GeoJSON 类型
namestring调用函数的名称

返回

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