envelope = (Envelope) input.get(SEXTANTE_GRID_ENVELOPE);
} else {
for(String sKey : input.keySet()) {
Object value = paramSet.getParameter(sKey).getParameterValueAsObject();
if(value instanceof GTRasterLayer) {
GridExtent ge = ((GTRasterLayer) value).getLayerGridExtent();
Envelope genv = new Envelope(ge.getXMin(), ge.getXMax(), ge.getYMin(), ge.getYMax());
if(envelope == null) {
envelope = genv;
} else {
envelope.expandToInclude(genv);
}
return;
}
}
}
if(envelope == null) {
if(Double.isNaN(cellSize)) {
throw new GeoAlgorithmExecutionException(SEXTANTE_GRID_ENVELOPE
+ " parameter could not be derived from inputs, and is not available among ");
}
}
// build and set the grid extends
GridExtent extent = new GridExtent();
extent.setXRange(envelope.getMinX(), envelope.getMaxX());
extent.setYRange(envelope.getMinY(), envelope.getMaxY());
extent.setCellSize(cellSize);
m_Algorithm.setGridExtent(extent);
}
}