}
final Statistic[] statistis = statisticsSet.toArray(new Statistic[statisticsSet
.size()]);
final OperationJAI op = new OperationJAI("ZonalStats");
ParameterValueGroup params = op.getParameters();
params.parameter("dataImage").setValue(cropped);
params.parameter("stats").setValue(statistis);
params.parameter("bands").setValue(bands);
params.parameter("roi").setValue(roi);
params.parameter("ranges").setValue(inclusionRanges);
params.parameter("rangesType").setValue(rangesType);
params.parameter("rangeLocalStats").setValue(isLocal);
final GridCoverage2D coverage = (GridCoverage2D) op.doOperation(params, null);
final ZonalStats stats = (ZonalStats) coverage
.getProperty(ZonalStatsDescriptor.ZONAL_STATS_PROPERTY);
final Map<Statistic, List<Result>> statsMap = new HashMap<Statistic, List<Result>>();
for (Statistic statistic : statistis) {
final List<Range> inclRanges = CollectionFactory.list();