InvalidParameterValue, "RangeSubset");
} else if (rangeSubset.getAxisSubset().size() == 0)
return;
for (int a = 0; a < rangeSubset.getAxisSubset().size(); a++) {
AxisSubsetType axisSubset = (AxisSubsetType) rangeSubset.getAxisSubset().get(a);
if (axisSubset.getName().equalsIgnoreCase("Band")) {
// prepare a support structure to quickly get the band index of a key
// (and remember we replaced spaces with underscores in the keys to
// avoid issues with the kvp parsing of indentifiers that include spaces)
// check indexes
int[] bands = null;
if (axisSubset.getSingleValue().size() > 0) {
bands = new int[1];
bands[0] = Integer.parseInt(((TypedLiteralType) axisSubset.getSingleValue()
.get(0)).getValue());
} else if (axisSubset.getInterval().size() > 0) {
IntervalType interval = (IntervalType) axisSubset.getInterval().get(0);
int min = Integer.parseInt(interval.getMin().getValue());
int max = Integer.parseInt(interval.getMax().getValue());
int res = (interval.getRes() != null ? Integer.parseInt(interval.getRes()
.getValue()) : 1);
bands = new int[(max - min) / res];
for (int b = 0; b < bands.length; b++)
bands[b] = min + (b * res);
}
if (bands == null)
throw new WcsException("Invalid values for axis " + axisSubset.getName(),
InvalidParameterValue, "AxisSubset");
} else if (axisSubset.getName().equalsIgnoreCase(WCSUtils.ELEVATION)) {
double[] elevations = null;
if (axisSubset.getSingleValue().size() > 0) {
elevations = new double[axisSubset.getSingleValue().size()];
for (int s = 0; s < axisSubset.getSingleValue().size(); s++) {
elevations[s] = Double.parseDouble(((TypedLiteralType) axisSubset
.getSingleValue().get(s)).getValue());
}
} else if (axisSubset.getInterval().size() > 0) {
IntervalType interval = (IntervalType) axisSubset.getInterval().get(0);
int min = Integer.parseInt(interval.getMin().getValue());
int max = Integer.parseInt(interval.getMax().getValue());
int res = (interval.getRes() != null ? Integer.parseInt(interval.getRes()
.getValue()) : 1);