final GridCoverage2D preScaledGridCoverage;
if ((scaleXInt == 1) && (scaleYInt == 1)) {
preScaledGridCoverage = gc;
} else {
final ParameterValueGroup param = (ParameterValueGroup) filteredSubsampleParams.clone();
param.parameter("source").setValue(gc);
param.parameter("scaleX").setValue(new Integer(scaleXInt));
param.parameter("scaleY").setValue(new Integer(scaleYInt));
if (interpolation.equals(new InterpolationNearest())) {
param.parameter("qsFilterArray").setValue(new float[] { 1.0F });
} else {
param.parameter("qsFilterArray")
.setValue(new float[] { 0.5F, 1.0F / 3.0F, 0.0F, -1.0F / 12.0F });
}
param.parameter("Interpolation").setValue(interpolation);
param.parameter("BorderExtender").setValue(be);
preScaledGridCoverage = (GridCoverage2D) filteredSubsampleFactory.doOperation(param,
hints);
}
return preScaledGridCoverage;