# pointOnFeature

Takes a Feature or FeatureCollection and returns a Point guaranteed to be on the surface of the feature.
接受一个 FeatureFeatureCollection ,并返回一个保证在 feature 表面上的点。

参数

参数 类型 描述
geojson GeoJSON 任何 Feature 或 FeatureCollection

返回

Feature <Point> - a point on the surface of input

示例

var polygon = turf.polygon([[
  [116, -36], // 注意:polygon首尾坐标要一致
  [131, -32],
  [146, -43],
  [155, -25],
  [133, -9],
  [111, -22],
  [116, -36]
]]);

var pointOnPolygon = turf.pointOnFeature(polygon);
Last Updated: 6/23/2023, 10:33:35 PM