/** * Returns the max value for the time, either as a single {@link Date} or {@link DateRange} * according to what the underlying reader provides * * @throws IOException */ public Date getMaxTime() throws IOException { if (!hasTime()) { return null; } final String currentTime = reader.getMetadataValue(AbstractGridCoverage2DReader.TIME_DOMAIN_MAXIMUM); if (currentTime == null) { return null; } try { return getTimeFormat().parse(currentTime); } catch (ParseException e) { throw new RuntimeException("Failed to get CURRENT time from coverage reader", e); } }
/** * Returns the full set of time values supported by the raster, sorted by time. They are either * {@link Date} objects, or {@link DateRange} objects, according to what the underlying reader * provides. * * @throws IOException */ public TreeSet<Object> getTimeDomain() throws IOException { if (!hasTime()) { Collections.emptySet(); } final SimpleDateFormat df = getTimeFormat(); String domain = reader.getMetadataValue(TIME_DOMAIN); String[] timeInstants = domain.split("\\s*,\\s*"); TreeSet<Object> values = new TreeSet<Object>(TEMPORAL_COMPARATOR); for (String tp : timeInstants) { try { values.add(parseTimeOrRange(df, tp)); } catch (ParseException e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } } return values; }
/** * Returns the min value for the time * * @throws IOException */ public Date getMinTime() throws IOException { if (!hasTime()) { return null; } final String currentTime = reader.getMetadataValue(AbstractGridCoverage2DReader.TIME_DOMAIN_MINIMUM); if (currentTime == null) { return null; } try { return getTimeFormat().parse(currentTime); } catch (ParseException e) { throw new RuntimeException("Failed to get minimum time from coverage reader", e); } }
if (!hasTime()) { Collections.emptySet();
&& dimensions.hasElevation(); DimensionInfo timeInfo = metadata.get(ResourceInfo.TIME, DimensionInfo.class); hasTime |= timeInfo != null && timeInfo.isEnabled() && dimensions.hasTime();
if (hasTime && dimensions.hasTime()) { handleTimeDimensionRaster(cvInfo, timeInfo, dimensions);
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) {