if (request.getRangeSubset() != null) {
if (request.getRangeSubset().getFieldSubset().size() > 1) {
throw new WcsException("Multi field coverages are not supported yet");
}
FieldSubsetType field = (FieldSubsetType) request.getRangeSubset().getFieldSubset().get(0);
interpolationType = field.getInterpolationType();
// handle axis subset
if (field.getAxisSubset().size() > 1) {
throw new WcsException("Multi axis coverages are not supported yet");
}
if (field.getAxisSubset().size() == 1) {
// prepare a support structure to quickly get the band index
// of a
// key
List<CoverageDimensionInfo> dimensions = meta.getDimensions();
Map<String, Integer> dimensionMap = new HashMap<String, Integer>();
for (int i = 0; i < dimensions.size(); i++) {
String keyName = dimensions.get(i).getName().replace(' ', '_');
dimensionMap.put(keyName, i);
}
// extract the band indexes
AxisSubsetType axisSubset = (AxisSubsetType) field.getAxisSubset().get(0);
List keys = axisSubset.getKey();
int[] bands = new int[keys.size()];
for (int j = 0; j < bands.length; j++) {
final String key = (String) keys.get(j);
Integer index = dimensionMap.get(key);
if (index == null)
throw new WcsException("Unknown field/axis/key combination "
+ field.getIdentifier().getValue() + "/"
+ axisSubset.getIdentifier() + "/" + key);
bands[j] = index;
}
// finally execute the band select