} catch(NullParameterAdditionalInfoException e) {
// fine
}
hasRasterInput = hasRasterInput || IRasterLayer.class.isAssignableFrom(param.getParameterClass());
paramInfo.put(param.getParameterName(), new Parameter(param.getParameterName(),
mapToGeoTools(param.getParameterClass()), Text.text(title),
Text.text(description), getAdditionalInfoMap(param)));
}
// check if there is any raster output
boolean hasRasterOutput = false;
OutputObjectsSet ooset = algorithm.getOutputObjects();
for (int i = 0; i < ooset.getOutputObjectsCount(); i++) {
Output output = ooset.getOutput(i);
if (output instanceof OutputRasterLayer) {
hasRasterOutput = true;
break;
}
}
// if there is any input or output raster we also need the user to specify
// the grid structure, though we can get it from the first raster if there
// are raster inputs, meaning in that case we'll grab it from
if(hasRasterInput || hasRasterOutput) {
// create a grid envelope, required only if there is no raster input we can
// get the same info from
if(hasRasterInput) {
paramInfo.put(SEXTANTE_GRID_ENVELOPE, new Parameter(SEXTANTE_GRID_ENVELOPE,
Envelope.class, Text.text("Grid bounds (defaults to the bounds of the inputs)"),
Text.text("The real world coordinates bounding the grid"),
false, 0, 1, null, null));
paramInfo.put(SEXTANTE_GRID_CELL_SIZE, new Parameter(SEXTANTE_GRID_CELL_SIZE,
Double.class, Text.text("Cell size (defaults to the size of the first input)"),
Text.text("The cell size in real world units"),
false, 0, 1, null, null));
} else {
paramInfo.put(SEXTANTE_GRID_ENVELOPE, new Parameter(SEXTANTE_GRID_ENVELOPE,
Envelope.class, Text.text("Grid bounds"),
Text.text("The real world coordinates bounding the grid"),
true, 1, 1, null, null));
paramInfo.put(SEXTANTE_GRID_CELL_SIZE, new Parameter(SEXTANTE_GRID_CELL_SIZE,
Double.class, Text.text("Cell size"),
Text.text("The cell size in real world units"),
true, 1, 1, null, null));
}