Output output = outputs.getOutput(i);
Object outputObject = output.getOutputObject();
// if the output object is a layer or a table, we return
// the inner GeoTools object
if (outputObject instanceof IDataObject){
IDataObject dataObject = (IDataObject) outputObject;
Object wrapped = dataObject.getBaseDataObject();
if(wrapped instanceof FeatureSource) {
results.put(output.getName(), ((FeatureSource) wrapped).getFeatures());
} else if(wrapped instanceof GridCoverage2D) {
results.put(output.getName(), wrapped);
} else {