//
// TIME
//
ReaderDimensionsAccessor dimensions = new ReaderDimensionsAccessor(reader);
DimensionInfo timeDimension = meta.getMetadata().get(ResourceInfo.TIME, DimensionInfo.class);
if(timeDimension != null && timeDimension.isEnabled() && dimensions.hasTime()) {
final List<Object> timeValues = new ArrayList<Object>();
if (temporalSubset != null && temporalSubset.getTimePosition() != null) {
// grab the time positions
final EList timePosition = temporalSubset.getTimePosition();
for (Iterator it = timePosition.iterator(); it.hasNext();) {
TimePositionType tp = (TimePositionType) it.next();
Date date = (Date) tp.getValue();
if(date == null) {
date = dimensions.getMaxTime();
}
timeValues.add(date);
}
// grab the time intervals
final EList timePeriods = temporalSubset.getTimePeriod();
for (Iterator it = timePeriods.iterator(); it.hasNext();) {
TimePeriodType tp = (TimePeriodType) it.next();
Date begin = (Date) tp.getBeginPosition().getValue();
Date end = (Date) tp.getEndPosition().getValue();
timeValues.add(new DateRange(begin, end));
}
}
if(timeValues.isEmpty()) {
Date date = dimensions.getMaxTime();
timeValues.add(date);
}
readParameters = CoverageUtils.mergeParameter(parameterDescriptors,
readParameters, timeValues, "TIME", "Time");
}
//
// ELEVATION SUPPORT VIA A SPECIFIC AXIS ELEVATION
//
DimensionInfo elevationDimension = meta.getMetadata().get(ResourceInfo.ELEVATION, DimensionInfo.class);
if(elevationDimension != null && elevationDimension.isEnabled() && dimensions.hasElevation()) {
List<Double> elevations = new ArrayList<Double>();
// extract elevation values
List axisSubset = null;
if (request.getRangeSubset() != null) {
axisSubset = request.getRangeSubset().getAxisSubset();