# getType
Get GeoJSON object's type, Geometry type is prioritize.
获取GeoJSON对象的类型,优先考虑几何体类型。
> npm install @turf/invariant
参数
参数 | 类型 | 描述 |
---|---|---|
geojson | GeoJSON | input GeoJSON feature(s) |
name | string | 在错误信息中显示的变量名称 |
返回
string - GeoJSON type
示例
var point = {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [110, 40]
}
}
var geom = turf.getType(point)
//="Point"