public static AbstractRaster transform( AbstractRaster raster, Envelope env, Grid grid, String interpolation )
throws TransformationException {
LOG.debug( "Transforming raster with envelope '{}' and grid '{}', interpolation method '{}'.",
new Object[] { env, grid, interpolation } );
AbstractRaster result;
try {
RasterTransformer transf = new RasterTransformer( env.getCoordinateSystem() );
result = transf.transform( raster, env, grid.getWidth(), grid.getHeight(),
InterpolationType.fromString( interpolation ) );
} catch ( Exception e ) {
LOG.debug( "Original stack trace", e );
throw new TransformationException( "error while transforming raster result: " + e.getMessage(), e );
}
return result;
}
}