# flattenReduce

Reduce flattened features in any GeoJSON object, similar to Array.reduce().
简化任何GeoJSON对象中的flattened features,类似于Array.reduce()方法。

> npm install @turf/meta


参数 类型 描述
geojson (FeatureCollection|Feature|Geometry) 任何 GeoJSON 对象
callback Function 回调函数 (previousValue, currentFeature, featureIndex, multiFeatureIndex)
initialValue (*) 回调函数第一个参数初始值


    • The value that results from the reduction.


var features = turf.featureCollection([
    turf.point([26, 37], {foo: 'bar'}),
    turf.multiPoint([[40, 30], [36, 53]], {hello: 'world'})

turf.flattenReduce(features, function (previousValue, currentFeature, featureIndex, multiFeatureIndex) {
  return currentFeature
Last Updated: 6/21/2023, 11:40:17 PM