# featureOf

Enforce expectations about types of Feature inputs for Turf. Internally this uses geojsonType to judge geometry types.
Turf库要求输入的Feature必须符合预期类型,其内部使用geojsonType来判断几何类型。

> npm install @turf/invariant

参数

参数 类型 描述
feature Feature 一个具有预期几何类型的Feature
type string 预期的GeoJSON类型
name string 调用函数的名称

示例

var linestring1 = turf.lineString([[-24, 63], [-23, 60], [-25, 65], [-20, 69]], {name: 'line 1'});

turf.featureOf(linestring1, 'LineString', 'line 1');
Last Updated: 6/23/2023, 10:33:35 PM