final ParameterValueGroup wparams = TIFF_FORMAT.getWriteParameters();
wparams.parameter(AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.getName().toString()).setValue(wp);
final GeneralParameterValue[] wps = (GeneralParameterValue[]) wparams.values().toArray(new GeneralParameterValue[1]);
// write out the coverage
AbstractGridCoverageWriter writer = (AbstractGridCoverageWriter) format.getWriter(os);
if (writer == null)
throw new WPSException(
"Could not find the GeoTIFF writer, please check it's in the classpath");
try {
writer.write(coverage, wps);
} catch(IOException e) {
throw new ProcessException(e);
} finally {
try {
writer.dispose();
} catch (Exception e) {
// swallow
}
}
}