Skip to content

KBE3D / KBCore / turf / area

函数: area()

area(geojson: Geometry | Feature<any, GeoJsonProperties> | FeatureCollection<any, GeoJsonProperties>): number

Function

Calculates the geodesic area in square meters of one or more polygons.

参数

geojson

input polygon(s) as Geometry, Feature, or FeatureCollection

Geometry | Feature<any, GeoJsonProperties> | FeatureCollection<any, GeoJsonProperties>

返回

number

area in square meters

示例

ts
var polygon = turf.polygon([[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]);

var area = turf.area(polygon);

//addToMap
var addToMap = [polygon]
polygon.properties.area = area

KBE3D @3.0.0 Copyright © 2024-present KBE3D