throw new WcsException("Multi field coverages are not supported yet",
InvalidParameterValue, "RangeSubset");
}
// check field identifier
FieldSubsetType field = (FieldSubsetType) rangeSubset.getFieldSubset().get(0);
final String fieldId = field.getIdentifier().getValue();
if (!fieldId.equalsIgnoreCase("contents"))
throw new WcsException("Unknown field " + fieldId, InvalidParameterValue, "RangeSubset");
// check interpolation
String interpolation = field.getInterpolationType();
if (interpolation != null) {
boolean interpolationSupported = false;
if (interpolation.equalsIgnoreCase("nearest")) {
interpolation = "nearest neighbor";
} else if (interpolation.equalsIgnoreCase("cubic") || interpolation.equalsIgnoreCase("bicubic")) {
interpolation = "bicubic";
} else if (interpolation.equalsIgnoreCase("linear") || interpolation.equalsIgnoreCase("bilinear")) {
interpolation = "bilinear";
}
for (String method : info.getInterpolationMethods()) {
if (interpolation.equalsIgnoreCase(method)) {
interpolationSupported = true;
break;
}
}
if (!interpolationSupported)
throw new WcsException(
"The requested Interpolation method is not supported by this Coverage.",
InvalidParameterValue, "RangeSubset");
}
// check axis
if (field.getAxisSubset().size() > 1) {
throw new WcsException("Multi axis coverages are not supported yet",
InvalidParameterValue, "RangeSubset");
} else if (field.getAxisSubset().size() == 0)
return;
AxisSubsetType axisSubset = (AxisSubsetType) field.getAxisSubset().get(0);
final String axisId = axisSubset.getIdentifier();
if (!axisId.equalsIgnoreCase("Bands"))
throw new WcsException("Unknown axis " + axisId + " in field " + fieldId,
InvalidParameterValue, "RangeSubset");