collectionOf
描述
🌐 Description
强制执行关于 Turf 的 FeatureCollection 输入类型的期望。内部使用 geojsonType 来判断几何类型。
🌐 Enforce expectations about types of FeatureCollection inputs for Turf. Internally this uses geojsonType to judge geometry types.
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| featureCollection | FeatureCollection | 一个特性集合,其特性将被评判 |
| type | string | 预期的 GeoJSON 类型 |
| name | string | 调用函数的名称 |
返回
🌐 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(...);