Skip to main content
Version: 7.3.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(...);