readParameters = (readParameters != null ? readParameters : new GeneralParameterValue[0]);
//
// Setting coverage reading params.
//
final ParameterValue requestedGridGeometryParam = new DefaultParameterDescriptor(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString(), GeneralGridGeometry.class, null, requestedGridGeometry).createValue();
/*
* Test if the parameter "TIME" is present in the WMS
* request, and by the way in the reading parameters. If
* it is the case, one can adds it to the request. If an
* exception is thrown, we have nothing to do.
*/
final List<GeneralParameterDescriptor> parameterDescriptors = readParametersDescriptor.getDescriptor().descriptors();
ParameterValue time=null;
boolean hasTime=timeValues.size()>0;
ParameterValue elevation=null;
boolean hasElevation=elevations != null && !Double.isNaN(elevations[0]);
if(hasElevation||hasTime){
for(GeneralParameterDescriptor pd:parameterDescriptors){
final String code=pd.getName().getCode();
//
// TIME
//
if(code.equalsIgnoreCase("TIME")){
time=(ParameterValue) pd.createValue();
time.setValue(timeValues); }
//
// ELEVATION
//
if(code.equalsIgnoreCase("ELEVATION")){
elevation=(ParameterValue) pd.createValue();
elevation.setValue(elevations[0]);
}
// leave?
if((hasElevation&&elevation!=null&&hasTime&&time!=null)||