|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GridCoverageReader
Interface for reading GridCoverage
objects. Reading is a two steps process:
The input file must be set first, then the actual reading is performed with the
getGridCoverage(int)
. Example:
GridCoverageReader reader = ... reader.setInput(new File("MyCoverage.dat"), true); GridCoverage coverage = reader.getGridCoverage(0);
Method Summary | |
---|---|
org.opengis.referencing.crs.CoordinateReferenceSystem |
getCoordinateReferenceSystem(int index)
Returns the coordinate reference system for the GridCoverage to be read. |
org.opengis.geometry.Envelope |
getEnvelope(int index)
Returns the envelope for the GridCoverage to be read. |
org.opengis.coverage.grid.GridCoverage |
getGridCoverage(int index)
Reads the grid coverage. |
org.opengis.coverage.grid.GridEnvelope |
getGridRange(int index)
Returns the grid range for the GridCoverage to be read. |
org.opengis.referencing.operation.MathTransform |
getMathTransform(int index)
Returns the transform from grid range to CRS coordinates. |
java.lang.String |
getName(int index)
Gets the GridCoverage name at the specified index. |
int |
getNumImages(boolean allowSearch)
Returns the number of images available from the current input source. |
GridSampleDimension[] |
getSampleDimensions(int index)
Returns the sample dimensions for each band of the GridCoverage
to be read. |
void |
reset()
Restores the GridCoverageReader to its initial state. |
void |
setInput(java.lang.Object input,
boolean seekForwardOnly)
Sets the input source to the given object. |
Method Detail |
---|
void setInput(java.lang.Object input, boolean seekForwardOnly) throws java.io.IOException
File
or an URL
object. But some
other types (e.g. ImageInputStream
)
may be accepted as well.
input
- The File
or URL
to be read.seekForwardOnly
- if true
, grid coverages
and metadata may only be read in ascending order from
the input source.
java.io.IOException
- if an I/O operation failed.
java.lang.IllegalArgumentException
- if input is not a valid instance.int getNumImages(boolean allowSearch) throws java.io.IOException
allowSearch
parameter may be set to false
to indicate that an exhaustive search is not desired.
allowSearch
- If true
, the true number of images will
be returned even if a search is required. If false
,
the reader may return -1 without performing the search.
allowSearch
is
false
and a search would be required.
java.lang.IllegalStateException
- If the input source has not been set, or if
the input has been specified with seekForwardOnly
set to true
.
java.io.IOException
- If an error occurs reading the information from the input source.java.lang.String getName(int index) throws java.io.IOException
GridCoverage
name at the specified index.
index
- The index of the image to be queried.
GridCoverage
at the specified index.
java.lang.IllegalStateException
- if the input source has not been set.
java.lang.IndexOutOfBoundsException
- if the supplied index is out of bounds.
java.io.IOException
- if an error occurs reading the information from the input source.org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem(int index) throws java.io.IOException
GridCoverage
to be read.
index
- The index of the image to be queried.
GridCoverage
at the specified index.
java.lang.IllegalStateException
- if the input source has not been set.
java.lang.IndexOutOfBoundsException
- if the supplied index is out of bounds.
java.io.IOException
- if an error occurs reading the width information from the input source.org.opengis.geometry.Envelope getEnvelope(int index) throws java.io.IOException
GridCoverage
to be read.
The envelope must have the same number of dimensions than the
coordinate reference system.
index
- The index of the image to be queried.
GridCoverage
at the specified index.
java.lang.IllegalStateException
- if the input source has not been set.
java.lang.IndexOutOfBoundsException
- if the supplied index is out of bounds.
java.io.IOException
- if an error occurs reading the width information from the input source.org.opengis.coverage.grid.GridEnvelope getGridRange(int index) throws java.io.IOException
GridCoverage
to be read.
The grid range must have the same number of dimensions than the
envelope.
index
- The index of the image to be queried.
GridCoverage
at the specified index.
java.lang.IllegalStateException
- if the input source has not been set.
java.lang.IndexOutOfBoundsException
- if the supplied index is out of bounds.
java.io.IOException
- if an error occurs reading the width information from the input source.org.opengis.referencing.operation.MathTransform getMathTransform(int index) throws java.io.IOException
java.io.IOException
GridSampleDimension[] getSampleDimensions(int index) throws java.io.IOException
GridCoverage
to be read. If sample dimensions are not known, then this method returns
null
.
index
- The index of the image to be queried.
GridCoverage
at the specified index.
This array's length must be equals to the number of bands in GridCoverage
.
java.lang.IllegalStateException
- if the input source has not been set.
java.lang.IndexOutOfBoundsException
- if the supplied index is out of bounds.
java.io.IOException
- if an error occurs reading the width information from the input source.org.opengis.coverage.grid.GridCoverage getGridCoverage(int index) throws java.io.IOException
index
- The index of the image to be queried.
GridCoverage
at the specified index.
java.lang.IllegalStateException
- if the input source has not been set.
java.lang.IndexOutOfBoundsException
- if the supplied index is out of bounds.
java.io.IOException
- if an error occurs reading the width information from the input source.void reset() throws java.io.IOException
GridCoverageReader
to its initial state.
java.io.IOException
- if an error occurs while disposing resources.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |