zoneGeom = JTS.transform(zoneGeom, CRS.findMathTransform(zonesCrs, dataCrs,
true));
}
// gather the statistics
ZonalStats stats = processStatistics(zoneGeom);
// build the resulting feature
if (stats != null) {
if(classificationRaster != null) {
// if zonal stats we're going to build
for (Integer classZoneId : stats.getZones()) {
builder.addAll(zone.getAttributes());
builder.add(classZoneId);
addStatsToFeature(stats.zone(classZoneId));
features.add(builder.buildFeature(zone.getID()));
}
} else {
builder.addAll(zone.getAttributes());
addStatsToFeature(stats);