Commit befeafc7 authored by Andrea Aime's avatar Andrea Aime
Browse files

Add error messages if the raster data is null in the raster download process

parent 218b9f23
......@@ -19,6 +19,7 @@ import javax.media.jai.Interpolation;
import org.geoserver.catalog.CoverageInfo;
import org.geoserver.data.util.CoverageUtils;
import org.geoserver.wps.WPSException;
import org.geoserver.wps.ppio.ComplexPPIO;
import org.geoserver.wps.ppio.ProcessParameterIO;
import org.geoserver.wps.resource.GridCoverageResource;
......@@ -230,6 +231,12 @@ class RasterDownload {
// --> READ
originalGridCoverage = reader.read(readParameters);
// check, the reader might have returned a null coverage
if(originalGridCoverage == null) {
throw new WPSException("The reader did not return any data for current input "
+ "parameters. It normally means there is nothing there, or the data got filtered out by the ROI or filter");
}
//
// STEP 1 - Reproject if needed
......@@ -266,6 +273,11 @@ class RasterDownload {
clippedGridCoverage = cropCoverage.execute(reprojectedGridCoverage,
roiManager.getSafeRoiInTargetCRS(), progressListener);
}
if(clippedGridCoverage == null) {
throw new WPSException("No data left after applying the ROI. This means there "
+ "is source data, but none matching the requested ROI");
}
} else {
// do nothing
clippedGridCoverage = reprojectedGridCoverage;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment