# area

Takes one or more features and returns their area in square meters.
获取一个或多个features,并返回其面积(平方米)。

参数

参数 类型 描述
geojson GeoJSON input GeoJSON feature(s)

返回

number - 面积(平方米)

示例

var polygon = turf.polygon([[
        [108.09876, 37.200787], // 注意:polygon首尾坐标要一致
        [106.398901, 33.648651],
        [114.972103, 33.340483],
        [113.715685, 37.845557],
        [108.09876, 37.200787]
      ]]);

var area = turf.area(polygon);
npm install @turf/area
Last Updated: 6/21/2023, 11:40:17 PM