}
}
}
}
final Name nameImpl = new NameImpl(coverageName.getLocalPart(), elementName);
final InternationalString description = new SimpleInternationalString(product!=null?product.getDescription():elementName);
// setting bands names.
final GridSampleDimension gridBand = Utilities.buildBands(band, elementName, unit);
final HDF4ProductFieldType fd = new HDF4ProductFieldType(nameImpl, description, gridBand);
fields.put(elementName, fd);
}
// //
//
// Updating the sliceDescriptor Map
//
// //
sliceDescriptorsMap.put(imageIndex, sd);
spatioTemporalMetadataMap.put(imageIndex, metadata);
}
// //
//
// Checking sets
//
// //
for (Name covName : coverageNames) {
// for (Name covName : verticalExtentMap.keySet()) {
// Set<NumberRange<Double>> verticalExtent = verticalExtentMap.get(covName);
// if (verticalExtent.size() == 0) {
// verticalExtent = Collections.emptySet();
// verticalExtentMap.put(covName, verticalExtent);
// }
Set<TemporalGeometricPrimitive> temporalExtent = temporalExtentMap.get(covName);
if (temporalExtent.size() == 0) {
temporalExtent = Collections.emptySet();
temporalExtentMap.put(covName, temporalExtent);
}
// //
//
// Setting a proper RangeType using the FieldTypes found
//
// //
Map<String, HDF4ProductFieldType> fields = (LinkedHashMap<String, HDF4ProductFieldType>) fieldsMap.get(covName);
if (fields != null && !fields.isEmpty()) {
final Set<FieldType> fieldTypes = new LinkedHashSet<FieldType>(fields.size());
final StringBuilder sb = new StringBuilder();
for (HDF4ProductFieldType fd : fields.values()) {
fieldTypes.add(fd);
final InternationalString description = fd.getDescription();
sb.append(description != null ? description.toString()+ "," : "");
}
String description = sb.toString();
int pos = -1;
if (description.length() > 0 && (pos = description.lastIndexOf(",")) != -1) {
description = description.substring(0, pos);
}
DefaultRangeType range = new DefaultRangeType(covName,new SimpleInternationalString(description),fieldTypes);
rangeMap.put(covName, range);
}
}
numberOfCoverages = numCoverages;