|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectGridCoverageStore
GridCoverageReader
LayerCoverageReader
public class LayerCoverageReader
A grid coverage reader for a layer. This class provides a way to read the data using only the
GridCoverageReader API, with input of kind Layer.
The read method actually reads two-dimensional slices selected according
the spatio-temporal envelope given to the GridCoverageReadParam argument.
Usage example:
CoverageDatabase db = new CoverageDatabase(...);
LayerCoverageReader reader = db.createGridCoverageReader("My layer");
GridCoverageReadParam param = new GridCoverageGridParam();
param.setEnvelope(...);
param.setResolution(...);
GridCoverage coverage = reader.read(0, param);
CoverageDatabase.createGridCoverageReader(String),
CoverageDatabase.readSlice(CoverageQuery),
GridCoverageReference.read(CoverageEnvelope, IIOListeners)
| coverage/geotk-coverage-sql (download) | View source code for this class |
| Field Summary | |
|---|---|
protected CoverageDatabase |
database
The coverage database which created this LayerCoverageReader. |
protected CoverageEnvelope |
temporaryEnvelope
A temporary object used for computing the value to be given to the Layer.getCoverageReference(CoverageEnvelope) method. |
| Fields inherited from class GridCoverageStore |
|---|
abortRequested |
| Constructor Summary | |
|---|---|
protected |
LayerCoverageReader(CoverageDatabase database)
Creates a new reader for the given database. |
| Method Summary | |
|---|---|
void |
dispose()
Allows any resources held by this reader to be released. |
SpatialMetadata |
getCoverageMetadata(int index)
Returns the metadata associated with the given coverage. |
List<LocalName> |
getCoverageNames()
Returns the layer name. |
GeneralGridGeometry |
getGridGeometry(int index)
Returns the most commonly used grid geometry. |
Layer |
getInput()
Returns the current layer which is used as input, or null if none. |
List<GridSampleDimension> |
getSampleDimensions(int index)
Returns the most commonly used sample dimensions for each band of the GridCoverage
to be read. |
SpatialMetadata |
getStreamMetadata()
Returns the metadata associated with the stream as a whole. |
GridCoverage |
read(int index,
GridCoverageReadParam param)
Reads the data and return them as a coverage. |
GridCoverage2D |
readSlice(int index,
GridCoverageReadParam param)
Reads the data of a two-dimensional slice and returns them as a coverage. |
void |
reset()
Restores the GridCoverageReader to its initial state. |
void |
setInput(Object input)
Sets a new layer as input. |
| Methods inherited from class GridCoverageReader |
|---|
getMetadata, getProperties, getSampleValueRanges |
| Methods inherited from class GridCoverageStore |
|---|
abort, getLocale, getLogLevel, setLocale, setLogLevel |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final CoverageDatabase database
LayerCoverageReader.
protected final CoverageEnvelope temporaryEnvelope
Layer.getCoverageReference(CoverageEnvelope) method. Subclasses can use
this field for computation purpose, but its content shall not be presumed stable.
| Constructor Detail |
|---|
protected LayerCoverageReader(CoverageDatabase database)
setInput(Object)
method must be invoked before this reader can be used.
database - The database to used with this reader.| Method Detail |
|---|
public final Layer getInput()
throws CoverageStoreException
null if none.
getInput in class GridCoverageReadernull if none.
CoverageStoreException - If the operation failed.ImageReader.getInput()
public void setInput(Object input)
throws CoverageStoreException
Layer instance,
or the name of a layer as a CharSequence.
setInput in class GridCoverageReaderinput - The new input as a Layer instance or a CharSequence,
or null for removing any input previously set.
IllegalArgumentException - If the given input is not of a legal type.
CoverageStoreException - If the operation failed.ImageReader.setInput(Object)
public List<LocalName> getCoverageNames()
throws CoverageStoreException
getCoverageNames in class GridCoverageReaderCoverageStoreException - If an error occurs while reading the information from the input source.ImageReader.getNumImages(boolean)
public GeneralGridGeometry getGridGeometry(int index)
throws CoverageStoreException
null.
getGridGeometry in class GridCoverageReaderindex - The index of the coverage to be queried.
GridCoverage at the specified index.
CoverageStoreException - If an error occurs while reading the information from the input source.ImageReader.getWidth(int),
ImageReader.getHeight(int)
public List<GridSampleDimension> getSampleDimensions(int index)
throws CoverageStoreException
GridCoverage
to be read. If sample dimensions are not known, then this method returns null.
getSampleDimensions in class GridCoverageReaderindex - The index of the coverage to be queried.
GridCoverage at the specified index,
or null if none. This list length is equals to the number of bands in the
GridCoverage.
CoverageStoreException - If an error occurs while reading the information from the input source.
public SpatialMetadata getStreamMetadata()
throws CoverageStoreException
getStreamMetadata in class GridCoverageReadernull.
CoverageStoreException - If an error occurs while reading the information from the input source.ImageReader.getStreamMetadata()
public SpatialMetadata getCoverageMetadata(int index)
throws CoverageStoreException
getCoverageMetadata in class GridCoverageReaderindex - The index of the coverage to be queried.
null.
CoverageStoreException - If an error occurs while reading the information from the input source.ImageReader.getImageMetadata(int)
public GridCoverage read(int index,
GridCoverageReadParam param)
throws CoverageStoreException
readSlice(int, GridCoverageReadParam). A future implementation may return a
three-dimensional coverage.
read in class GridCoverageReaderindex - The image index (usually 0).param - Optional read parameters (including the envelope and resolution to request),
or null if none.
null if none.
CoverageStoreException - If an error occurred while querying the database or reading
the image.ImageReader.read(int)
public GridCoverage2D readSlice(int index,
GridCoverageReadParam param)
throws CoverageStoreException
index - The image index (usually 0).param - Optional read parameters (including the envelope and resolution to request),
or null if none.
null if none.
CoverageStoreException - If an error occurred while querying the database or reading
the image.CoverageDatabase.readSlice(CoverageQuery)
public void reset()
throws CoverageStoreException
GridCoverageReader to its initial state.
reset in class GridCoverageReaderCoverageStoreException - If an error occurs while restoring to the initial state.ImageReader.reset()
public void dispose()
throws CoverageStoreException
dispose in class GridCoverageReaderCoverageStoreException - If an error occurs while disposing resources.ImageReader.dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||