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";
}
for (Iterator it = info.getInterpolationMethods().iterator(); it.hasNext();) {
String method = (String) it.next();
if (interpolation.equalsIgnoreCase(method)) {
interpolationSupported = true;
}
}
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");