use of org.geotoolkit.image.interpolation.ResampleBorderComportement in project geotoolkit by Geomatys.
the class ResampleProcess method execute.
/**
* Resamples a grid coverage.
*/
@Override
protected void execute() throws ProcessException {
final GridCoverage source = inputParameters.getValue(IN_COVERAGE);
final double[] background = inputParameters.getValue(IN_BACKGROUND);
InterpolationCase interpolation = inputParameters.getValue(IN_INTERPOLATION_TYPE);
final ResampleBorderComportement border = inputParameters.getValue(IN_BORDER_COMPORTEMENT_TYPE);
CoordinateReferenceSystem targetCRS = (CoordinateReferenceSystem) inputParameters.parameter("CoordinateReferenceSystem").getValue();
final GridGeometry targetGG = inputParameters.getValue(IN_GRID_GEOMETRY);
final GridCoverage target;
try {
target = reproject(source, targetCRS, targetGG, interpolation, border, background);
} catch (FactoryException exception) {
throw new CannotReprojectException(Errors.format(Errors.Keys.CantReprojectCoverage_1, CoverageUtilities.getName(source)), exception);
} catch (TransformException exception) {
throw new CannotReprojectException(Errors.format(Errors.Keys.CantReprojectCoverage_1, CoverageUtilities.getName(source)), exception);
}
outputParameters.getOrCreate(OUT_COVERAGE).setValue(target);
}
Aggregations