* @param mapLayerInfo
* @return
*/
public Filter getTimeElevationToFilter(List<Object> times, List<Object> elevations,
FeatureTypeInfo typeInfo) throws IOException {
DimensionInfo timeInfo = typeInfo.getMetadata().get(ResourceInfo.TIME, DimensionInfo.class);
DimensionInfo elevationInfo = typeInfo.getMetadata().get(ResourceInfo.ELEVATION,
DimensionInfo.class);
DimensionFilterBuilder builder = new DimensionFilterBuilder(ff);
// handle time support
if (timeInfo != null && timeInfo.isEnabled() && times != null) {
List<Object> defaultedTimes = new ArrayList<Object>(times.size());
for (Object datetime : times) {
if (datetime == null) {
// this is "default"
datetime = getDefaultTime(typeInfo);
}
defaultedTimes.add(datetime);
}
builder.appendFilters(timeInfo.getAttribute(), timeInfo.getEndAttribute(), defaultedTimes);
}
// handle elevation support
if (elevationInfo != null && elevationInfo.isEnabled() && elevations != null) {
List<Object> defaultedElevations = new ArrayList<Object>(elevations.size());
for (Object elevation : elevations) {
if (elevation == null) {
// this is "default"
elevation = getDefaultElevation(typeInfo);
}
defaultedElevations.add(elevation);
}
builder.appendFilters(elevationInfo.getAttribute(), elevationInfo.getEndAttribute(),
defaultedElevations);
}
Filter result = builder.getFilter();
return result;