if(parameters != null && parameters.length > 0 && parameters[0] instanceof GetCoverageType) {
// check we are going against a granule
GetCoverageType gc = (GetCoverageType) parameters[0];
String coverageId = gc.getCoverageId();
if(coverageId == null) {
throw new WCS20Exception("Required parameter coverageId is missing",
WCS20Exception.WCS20ExceptionCode.MissingParameterValue, "coverageId");
}
CoverageInfo coverage = codec.getGranuleCoverage(coverageId);
if(coverage != null) {
// set the actual coverage name
String actualCoverageId = NCNameResourceCodec.encode(coverage);
gc.setCoverageId(actualCoverageId);
// extract the granule filter
Filter granuleFilter = codec.getGranuleFilter(coverageId);
// check the filter actually matches one granule
if(!readerHasGranule(coverage, granuleFilter)) {
throw new WCS20Exception("Could not locate coverage " + coverageId, WCS20ExceptionCode.NoSuchCoverage, "coverageId");
}
// set and/or merge with the previous filter
Filter previous = gc.getFilter();
if(previous == null || previous == Filter.INCLUDE) {