area
描述
¥Description
Calculates the geodesic area in square meters of one or more polygons.
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
geojson | GeoJSON | input polygon(s) as 几何图形, 特性, or FeatureCollection |
返回
¥Returns
number area in square meters
示例
¥Examples
var polygon = turf.polygon([
[
[125, -15],
[113, -22],
[154, -27],
[144, -15],
[125, -15],
],
]);
var area = turf.area(polygon);
安装
¥Installation
$ npm install @turf/area
import { area } from "@turf/area";
const result = area(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.area(...);