/** * 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); } }
/** * 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; }
if (!hasElevation()) { Collections.emptySet();
elevationInfo != null && elevationInfo.isEnabled() && dimensions.hasElevation(); DimensionInfo timeInfo = metadata.get(ResourceInfo.TIME, DimensionInfo.class); hasTime |= timeInfo != null && timeInfo.isEnabled() && dimensions.hasTime();
if (hasElevation && dimensions.hasElevation()) { handleElevationDimensionRaster(cvInfo, elevInfo, dimensions);
if (elevationDimension != null && elevationDimension.isEnabled() && dimensions.hasElevation()) { List<Double> elevations = new ArrayList<Double>();
if (dimensions.hasElevation()) {