CoordReduceCallback<T> typedef

CoordReduceCallback<T> = T? Function(T? previousValue, Position? currentCoord, int? coordIndex, int? featureIndex, int? multiFeatureIndex, int? geometryIndex)

Callback for coordReduce

The first time the callback function is called, the values provided as arguments depend on whether the reduce method has an initialValue argument.

If an initialValue is provided to the reduce method:

  • The previousValue argument is initialValue.
  • The currentValue argument is the value of the first element present in the List.

If an initialValue is not provided:

  • The previousValue argument is the value of the first element present in the List.
  • The currentValue argument is the value of the second element present in the List.

Takes previousValue, the accumulated value previously returned in the last invocation of the callback, or initialValue, if supplied, currentCoord The current coordinate being processed, coordIndex The current index of the coordinate being processed. Starts at index 0, if an initialValue is provided, and at index 1 otherwise, featureIndex The current index of the Feature being processed, multiFeatureIndex, the current index of the Multi-Feature being processed., and geometryIndex, the current index of the Geometry being processed.

Implementation

typedef CoordReduceCallback<T> = T? Function(
  T? previousValue, // todo: change to CoordType
  Position? currentCoord,
  int? coordIndex,
  int? featureIndex,
  int? multiFeatureIndex,
  int? geometryIndex,
);