final GridCoverage2D coverage = (GridCoverage2D) op.doOperation(params,null);
final ZonalStats zstats = (ZonalStats) coverage
.getProperty(ZonalStatsDescriptor.ZONAL_STATS_PROPERTY);
double min = zstats.statistic(Statistic.MIN).results().get(0).getValue();
double max = zstats.statistic(Statistic.MAX).results().get(0).getValue();
return new double[]{min,max};
}
/**
* Computes quantile breaks for the given layer.