@Override public String getMetadataValue(String name) throws IOException { return delegate.getMetadataValue(referenceName, name); }
public String getMetadataValue(String name) throws IOException { return delegate.getMetadataValue(name); }
public String getMetadataValue(String coverageName, String name) throws IOException { return delegate.getMetadataValue(coverageName, name); }
public String getMetadataValue(String name) throws IOException { return delegate.getMetadataValue(coverageName, name); }
public String getMetadataValue(String name) throws IOException { return delegate.getMetadataValue(name); }
/** * True if the reader has a elevation dimension * * @throws IOException */ public boolean hasElevation() throws IOException { return "true".equalsIgnoreCase(reader.getMetadataValue(HAS_ELEVATION_DOMAIN)); }
/** * True if the reader has a time dimension * * @throws IOException */ public boolean hasTime() throws IOException { return "true".equalsIgnoreCase(reader.getMetadataValue(HAS_TIME_DOMAIN)); }
/** * Return the domain datatype (if available) * * @param domainName * @throws IOException */ public String getDomainDatatype(final String domainName) throws IOException { return reader.getMetadataValue(domainName.toUpperCase() + "_DOMAIN_DATATYPE"); }
/** * Returns the full set of values for the given dimension * * @throws IOException */ public List<String> getDomain(String name) throws IOException { String[] values = reader.getMetadataValue(name.toUpperCase() + "_DOMAIN").split(","); List<String> valueSet = new ArrayList<String>(); for (String val : values) { valueSet.add(val); } return valueSet; }
@Override public String getMetadataValue(String coverageName, String name) throws IOException { checkCoverageName(coverageName); return delegate.getMetadataValue(referenceName, name); }
/** * True if the reader has a dimension with the given name * * @throws IOException */ public boolean hasDomain(String name) throws IOException { Utilities.ensureNonNull("name", name); return "true" .equalsIgnoreCase(reader.getMetadataValue("HAS_" + name.toUpperCase() + "_DOMAIN")); }
public String getMetadataValue(String coverageName, String name) throws IOException { checkCoverageName(coverageName); return delegate.getMetadataValue(coverageName, name); }
public String getMetadataValue(String coverageName, String name) throws IOException { checkCoverageName(coverageName); return delegate.getMetadataValue(coverageName, name); }
/** * Returns the min value for the elevation (as a Double, or as a NumbeRange) * * @throws IOException */ public Double getMinElevation() throws IOException { if (!hasElevation()) { return null; } final String elevation = reader.getMetadataValue(AbstractGridCoverage2DReader.ELEVATION_DOMAIN_MINIMUM); if (elevation == null) { return null; } try { return Double.parseDouble(elevation); } catch (NumberFormatException e) { throw new RuntimeException("Failed to get minimum elevation from coverage reader", e); } }
/** * Returns the max value for the elevation (as a Double, or as a NumberRange) * * @throws IOException */ public Double getMaxElevation() throws IOException { if (!hasElevation()) { return null; } final String elevation = reader.getMetadataValue(AbstractGridCoverage2DReader.ELEVATION_DOMAIN_MAXIMUM); if (elevation == null) { return null; } try { return Double.parseDouble(elevation); } catch (NumberFormatException e) { throw new RuntimeException("Failed to get maximum elevation from coverage reader", e); } }
/** * Extracts the custom domain lowest value (using String sorting) * * @throws IOException */ public String getCustomDomainDefaultValue(String name) throws IOException { Utilities.ensureNonNull("name", name); // see if we have an optimize way to get the minimum String minimum = reader.getMetadataValue(name.toUpperCase() + "_DOMAIN_MINIMUM"); if (minimum != null) { return minimum; } // ok, get the full domain then List<String> domain = getDomain(name); if (domain.isEmpty()) { return null; } else { return domain.get(0); } }
/** * Returns the full set of elevation values (either as Double or NumberRange), sorted from * smaller to higher * * @throws IOException */ public TreeSet<Object> getElevationDomain() throws IOException { if (!hasElevation()) { return null; } // parse the values from the reader, they are exposed as strings... String[] elevationValues = reader.getMetadataValue(ELEVATION_DOMAIN).split(","); TreeSet<Object> elevations = new TreeSet<Object>(ELEVATION_COMPARATOR); for (String val : elevationValues) { try { elevations.add(parseNumberOrRange(val)); } catch (Exception e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } } return elevations; }
/** * 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); } }
/** * 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; }