return;
}
}
}
if(Double.isNaN(cellSize)) {
throw new GeoAlgorithmExecutionException(SEXTANTE_GRID_CELL_SIZE
+ " parameter could not be derived from inputs, and is not available among ");
}
// get the extents
Envelope envelope = null;
if(input.get(SEXTANTE_GRID_ENVELOPE) != null) {
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