# centerOfMass

Takes any Feature or a FeatureCollection and returns its center of mass using this formula: Centroid of Polygon.
取任何FeatureFeatureCollection,并利用这个公式返回其质心:多边形质心。

参数

参数 类型 描述
geojson GeoJSON GeoJSON to be centered
properties Object an Object that is used as the Feature 's properties

返回

Feature <Point> - the center of mass

示例

var polygon = turf.polygon([[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]);

var center = turf.centerOfMass(polygon);
Last Updated: 1/19/2021, 10:59:20 AM