Skip to content

KBE3D / KBCore / turf / getGeom

函数: getGeom()

getGeom<G>(geojson: G | Feature<G, GeoJsonProperties>): G

Get Geometry from Feature or Geometry Object

类型参数

G

G extends Geometry

参数

geojson

GeoJSON Feature or Geometry Object

G | Feature<G, GeoJsonProperties>

返回

G

GeoJSON Geometry Object

抛出

if geojson is not a Feature or Geometry Object

示例

ts
var point = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [110, 40]
  }
}
var geom = turf.getGeom(point)
//={"type": "Point", "coordinates": [110, 40]}

KBE3D @3.0.0 Copyright © 2024-present KBE3D