StatisticDefinition constructor

StatisticDefinition({
  1. required String onFieldName,
  2. required StatisticType statisticType,
  3. String outputAlias = '',
})

Creates a statistic definition. A statistic definition must specify a field name and statistic type. Optionally, you can provide a name for the output statistic result.

Parameters:

  • onFieldName — The name of the field in the table containing values to be used for the statistic.
  • statisticType — The statistic to calculate.
  • outputAlias — The optional name for this statistic in the results.

Implementation

factory StatisticDefinition({
  required String onFieldName,
  required StatisticType statisticType,
  String outputAlias = '',
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreOnFieldName = _CString(onFieldName);
  final coreOutputAlias = _CString(outputAlias);
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_StatisticDefinition_createWith(
      coreOnFieldName.bytes,
      statisticType.coreValue,
      coreOutputAlias.bytes,
      errorHandler,
    );
  });
  return StatisticDefinition._withHandle(handle);
}