# pointOnFeature

Takes a Feature or FeatureCollection and returns a Point guaranteed to be on the surface of the feature.
获取一个FeatureFeatureCollection,并返回一个保证位于该Feature表面的点。

参数

参数 类型 描述
geojson GeoJSON any Feature or FeatureCollection

返回

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

示例

var polygon = turf.polygon([[
  [116, -36],
  [131, -32],
  [146, -43],
  [155, -25],
  [133, -9],
  [111, -22],
  [116, -36]
]]);

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