if (hasTime)
for (GeneralParameterDescriptor pd : parameterDescriptors) {
// TIME
if (pd.getName().getCode().equalsIgnoreCase("TIME")) {
final ParameterValue time = (ParameterValue) pd.createValue();
if (time != null) {
time.setValue(getMapReq.getTime());
}
// add to the list
GeneralParameterValue[] readParametersClone = new GeneralParameterValue[parameters.length + 1];
System.arraycopy(parameters, 0, readParametersClone, 0, parameters.length);
readParametersClone[parameters.length] = time;
parameters = readParametersClone;
// leave
break;
}
}
// uncomment when the DIM_RANGE vendor parameter will be
// enabled
// try {
// ParameterValue dimRange =
// reader.getFormat().getReadParameters()
// .parameter("DIM_RANGE");
// if (dimRange != null && request.getDimRange() !=
// null) {
// dimRange.setValue(request.getDimRange());
// }
// } catch (ParameterNotFoundException p) {
// }
/*
* 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 double elevationValue = getMapReq.getElevation();
final boolean hasElevation = !Double.isNaN(elevationValue);
if (hasElevation)
for (GeneralParameterDescriptor pd : parameterDescriptors) {
// ELEVATION
if (pd.getName().getCode().equalsIgnoreCase("ELEVATION")) {
final ParameterValue elevation = (ParameterValue) pd.createValue();
if (elevation != null) {
elevation.setValue(getMapReq.getElevation());
}
// add to the list
GeneralParameterValue[] readParametersClone = new GeneralParameterValue[parameters.length + 1];
System.arraycopy(parameters, 0, readParametersClone, 0, parameters.length);