|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Layer
A layer of grid coverages sharing common properties. Layers are created by the
CoverageDatabase.getLayer(String) method. The list of layers available
in a database can be displayed in a Swing widget using the
LayerList panel.
Layer instances are immutable and thread-safe.
| coverage/geotk-coverage-sql (download) | View source code for this class |
| Method Summary | |
|---|---|
void |
addCoverageReferences(Collection<?> files,
CoverageDatabaseController controller)
Adds new coverage references in the database. |
SortedSet<Number> |
getAvailableElevations()
Returns the set of altitudes where a coverage is available. |
SortedSet<Date> |
getAvailableTimes()
Returns the set of dates when a coverage is available. |
RenderedImage |
getColorRamp(int band,
MeasurementRange<?> range,
Map<String,?> properties)
Creates a color ramp for the coverages in this layer. |
int |
getCoverageCount()
Returns the number of coverages in this layer. |
CoverageDatabase |
getCoverageDatabase()
Returns the database which created this layer, or null if unknown. |
GridCoverageReference |
getCoverageReference(CoverageEnvelope envelope)
Returns a reference to a coverage that intersect the given envelope. |
Set<GridCoverageReference> |
getCoverageReferences(CoverageEnvelope envelope)
Returns a reference to every coverages available in this layer which intersect the given envelope. |
CoverageEnvelope |
getEnvelope(Date time,
Number elevation)
Returns the envelope of this layer, optionally centered at the given date and elevation. |
Layer |
getFallback()
Returns a layer to use as a fallback if no data is available in this layer for a given position. |
GeographicBoundingBox |
getGeographicBoundingBox()
Returns the geographic bounding box, or null if unknown. |
SortedSet<GeneralGridGeometry> |
getGridGeometries()
Returns the grid geometries used by the coverages in this layer, sorted by decreasing frequency of use. |
SortedSet<File> |
getImageDirectories()
Returns the directories where the image files are stored, sorted by decreasing frequency of use. |
SortedSet<String> |
getImageFormats()
Returns the image format used by the coverages in this layer, sorted by decreasing frequency of use. |
String |
getName()
Returns the name of this layer. |
List<MeasurementRange<?>> |
getSampleValueRanges()
Returns the ranges of valid geophysics values for each band. |
DateRange |
getTimeRange()
Returns a time range encompassing all coverages in this layer, or null if none. |
double[] |
getTypicalResolution()
Returns the typical pixel resolution in this layer. |
| Method Detail |
|---|
CoverageDatabase getCoverageDatabase()
null if unknown.
The returned value is never null except when this Layer is the result
of a deserialization.
null if unknown.String getName()
int getCoverageCount()
throws CoverageStoreException
CoverageStoreException - if an error occurred while counting the coverages.
DateRange getTimeRange()
throws CoverageStoreException
null if none.
null.
CoverageStoreException - if an error occurred while fetching the time range.
SortedSet<Date> getAvailableTimes()
throws CoverageStoreException
null if unknown.
CoverageStoreException - if an error occurred while fetching the set.
SortedSet<Number> getAvailableElevations()
throws CoverageStoreException
null if unknown.
CoverageStoreException - if an error occurred while fetching the set.
List<MeasurementRange<?>> getSampleValueRanges()
throws CoverageStoreException
CoverageStoreException - If an error occurred while fetching the information.
RenderedImage getColorRamp(int band,
MeasurementRange<?> range,
Map<String,?> properties)
throws CoverageStoreException,
IllegalArgumentException
Note that the default implementation of this method requires the optional
geotk-display
module to be on reachable the classpath.
Note: There is usually only one quantitative category for a layer. However if more than one quantitative category is found, the one which seems the "best fit" for the given range is selected. The definition of "best fit" is implementation-dependent.The range given to this method is typically the following value:
However a different value can be specified, typically in the following situations:MeasurementRange<?> range = getSampleValueRanges().get(band);
null.range.convertTo(displayUnit).ColorMap operation on the
coverage read.This method accepts an optional map of properties, which provide more control on the image to be generated. Current implementation recognizes the following entries (all other entries are silently ignored):
| Key | Value type | Description |
|---|---|---|
"size" |
Dimension |
The image size, in pixels. |
"font" |
Font |
The font to use for rendering graduation labels. |
"foreground" |
Color |
The color to use for rendering graduation labels. |
"graphics" |
Graphics2D |
If provided, paints the image using the given graphics handle instead than
creating a new image. In such case, this method returns null. |
band - The band for which to create a color ramp, from 0 inclusive to
getSampleValueRanges().size() exclusive.range - The range for the graduation, or null if no graduation
should be written. See the above javadoc for a suggested value.properties - An optional map of properties controlling the rendering.
See the above javadoc for a description of expected entries.
null if none.
IllegalArgumentException - If the units of the given range are incompatible
with the units of measurement found in this layer.
CoverageStoreException - If an error occurred while creating the color ramp.ColorRamp
SortedSet<String> getImageFormats()
throws CoverageStoreException
CoverageStoreException - if an error occurred while querying the database.
SortedSet<File> getImageDirectories()
throws CoverageStoreException
CoverageStoreException - if an error occurred while querying the database.
double[] getTypicalResolution()
throws CoverageStoreException
NaN if
they are unknown.
CoverageStoreException - if an error occurred while fetching the resolution.
SortedSet<GeneralGridGeometry> getGridGeometries()
throws CoverageStoreException
CoverageStoreException - if an error occurred while querying the database.
GeographicBoundingBox getGeographicBoundingBox()
throws CoverageStoreException
null if unknown. If the CRS used by
the database is not geographic (for example if it is a projected CRS), then this method
will transform the layer envelope from the layer CRS to a geographic CRS.
null if none.
CoverageStoreException - if an error occurred while querying the database
or while projecting the layer envelope.
CoverageEnvelope getEnvelope(Date time,
Number elevation)
throws CoverageStoreException
getCoverageReference methods.
time - The central date, or null.elevation - The central elevation, or null.
CoverageStoreException - if an error occurred while querying the database.
Set<GridCoverageReference> getCoverageReferences(CoverageEnvelope envelope)
throws CoverageStoreException
If the given envelope is null, then this method returns the references to
every coverages available in this layer regardless of their envelope.
envelope - The envelope for filtering the coverages, or null for no filtering.
CoverageStoreException - if an error occurred while querying the database.
GridCoverageReference getCoverageReference(CoverageEnvelope envelope)
throws CoverageStoreException
envelope - The envelope for filtering the coverages, or null for no
filtering. A null value is useful for layers that are expected to
contain only one coverage, but should be avoided otherwise.
null if no coverage was found.
CoverageStoreException - if an error occurred while querying the database.
void addCoverageReferences(Collection<?> files,
CoverageDatabaseController controller)
throws DatabaseVetoException,
CoverageStoreException
Tile instances, which will be added to the
"GridCoverages" table (not to the "Tiles" table).
ImageReader instances with their
input set and
image metadata conform to the Geotk
spatial metadata format. The
reader input shall be one of the above-cited instances. If this is not possible (for example
because a ImageInputStream is required), consider wrapping
the ImageReaderSpi and the input in a
Tile instance.
Multi-images files
If a file contains more than one image, then the images to insert can be selected by the
CoverageDatabaseController.filterImages(List, boolean) method. If no controller
has been supplied, then the default behavior is to insert only the first image on the
assumption that other images are typically error estimations or overviews.
files - The image inputs.controller - An optional controller to be notified when new references are added.
The controller can modify the values declared in NewGridCoverageReference
before they are written in the database.
DatabaseVetoException - If a listener
vetoed against the operation.
CoverageStoreException - If an error occurred while accessing the database.
Layer getFallback()
throws CoverageStoreException
null if none.
CoverageStoreException - If an error occurred while fetching the information.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||