Package org.geotools.api.coverage.grid
Interface GridCoverageReader
-
- All Known Subinterfaces:
GridCoverage2DReader
,StructuredGridCoverage2DReader
- All Known Implementing Classes:
AbstractGridCoverage2DReader
,AIGReader
,ArcGridReader
,BaseGDALGridCoverage2DReader
,BaseGridCoverage2DReader
,DTEDReader
,ECWReader
,EnviHdrReader
,ErdasImgReader
,EsriHdrReader
,GeoPackageReader
,GeoTiffReader
,GrassCoverageReader
,IDRISIReader
,ImageMosaicReader
,ImagePyramidReader
,JP2ECWReader
,JP2KReader
,JP2KReader
,JP2MrSIDReader
,MBTilesReader
,MrSIDReader
,NetCDFReader
,NITFReader
,PGRasterReader
,RPFTOCReader
,SRPReader
,TPKReader
,VRTReader
,VSIReader
,WMSCoverageReader
,WMTSCoverageReader
,WorldImageReader
public interface GridCoverageReader
Support for reading grid coverages out of a persistent store.- Since:
- GeoAPI 2.0
- Author:
- Martin Desruisseaux (IRD), Daniele Romagnoli, GeoSolutions SAS
- See Also:
ImageReader
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
dispose()
Allows any resources held by this object to be released.Format
getFormat()
Returns the format handled by thisGridCoverageReader
.int
getGridCoverageCount()
Retrieve the number of coverages contained within the input source.String[]
getGridCoverageNames()
Retrieve the list of coverages contained within the input source.String[]
getMetadataNames()
Returns the list of metadata keywords associated with the input source as a whole (not associated with any particular grid coverage).String[]
getMetadataNames(String coverageName)
Returns the list of metadata keywords associated with a specific gridCoverage referred by name.String
getMetadataValue(String name)
Retrieve the metadata value for a given metadata name.String
getMetadataValue(String coverageName, String name)
Retrieve the metadata value for a given metadata name for a specified coverage.Object
getSource()
Returns the input source.GridCoverage
read(String coverageName, GeneralParameterValue... parameters)
Read the grid coverage specified by coverageName parameter.GridCoverage
read(GeneralParameterValue... parameters)
Read the only available grid coverage.
-
-
-
Method Detail
-
getFormat
Format getFormat()
Returns the format handled by thisGridCoverageReader
.
-
getSource
Object getSource()
-
getMetadataNames
String[] getMetadataNames() throws IOException
Returns the list of metadata keywords associated with the input source as a whole (not associated with any particular grid coverage). If no metadata is available, the array will be empty.- Returns:
- The list of metadata keywords for the input source.
- Throws:
IOException
- if an error occurs during reading.
-
getMetadataNames
String[] getMetadataNames(String coverageName) throws IOException
Returns the list of metadata keywords associated with a specific gridCoverage referred by name. If no metadata is available, the array will be empty.- Returns:
- The list of metadata keywords for the input source.
- Throws:
IOException
- if an error occurs during reading.
-
getMetadataValue
String getMetadataValue(String name) throws IOException
Retrieve the metadata value for a given metadata name.- Parameters:
name
- Metadata keyword for which to retrieve metadata.- Returns:
- The metadata value for the given metadata name. Should be one of the name returned by
getMetadataNames()
. - Throws:
IOException
- if an error occurs during reading.
-
getMetadataValue
String getMetadataValue(String coverageName, String name) throws IOException
Retrieve the metadata value for a given metadata name for a specified coverage.- Parameters:
name
- Metadata keyword for which to retrieve metadata.- Returns:
- The metadata value for the given metadata name. Should be one of the name returned by
getMetadataNames()
. - Throws:
IOException
- if an error occurs during reading.
-
getGridCoverageNames
String[] getGridCoverageNames() throws IOException
Retrieve the list of coverages contained within the input source. Each grid can have a different coordinate system, number of dimensions and grid geometry. For example, a HDF-EOS file (GRID.HDF) contains 6 grid coverages each having a different projection. An empty array will be returned if no sub names exist.- Returns:
- The list of grid coverages contained within the input source.
- Throws:
IOException
- if an error occurs during reading.
-
getGridCoverageCount
int getGridCoverageCount() throws IOException
Retrieve the number of coverages contained within the input source.- Returns:
- The number of coverages contained within the input source.
- Throws:
IOException
- if an error occurs during reading.
-
read
GridCoverage read(GeneralParameterValue... parameters) throws IllegalArgumentException, IOException
Read the only available grid coverage. Useread(String, GeneralParameterValue[])
in case of multiple grid coverages available.- Parameters:
parameters
- An optional set of parameters. Should be any or all of the parameters returned byFormat.getReadParameters()
.- Returns:
- A new grid coverage from the input source.
- Throws:
InvalidParameterNameException
- if a parameter inparameters
doesn't have a recognized name.InvalidParameterValueException
- if a parameter inparameters
doesn't have a valid value.ParameterNotFoundException
- if a parameter was required for the operation but was not provided in theparameters
list.CannotCreateGridCoverageException
- if the coverage can't be created for a logical reason (for example an unsupported format, or an inconsistency found in the data).IOException
- if a read operation failed for some other input/output reason, includingFileNotFoundException
if no file with the givenname
can be found, orIIOException
if an error was thrown by the underlying image library.IllegalArgumentException
-
read
GridCoverage read(String coverageName, GeneralParameterValue... parameters) throws IllegalArgumentException, IOException
Read the grid coverage specified by coverageName parameter.- Parameters:
parameters
- An optional set of parameters. Should be any or all of the parameters returned byFormat.getReadParameters()
.- Returns:
- A new grid coverage from the input source.
- Throws:
InvalidParameterNameException
- if a parameter inparameters
doesn't have a recognized name.InvalidParameterValueException
- if a parameter inparameters
doesn't have a valid value.ParameterNotFoundException
- if a parameter was required for the operation but was not provided in theparameters
list.CannotCreateGridCoverageException
- if the coverage can't be created for a logical reason (for example an unsupported format, or an inconsistency found in the data).IOException
- if a read operation failed for some other input/output reason, includingFileNotFoundException
if no file with the givenname
can be found, orIIOException
if an error was thrown by the underlying image library.IllegalArgumentException
-
dispose
void dispose() throws IOException
Allows any resources held by this object to be released. The result of calling any other method subsequent to a call to this method is undefined. It is important for applications to call this method when they know they will no longer be using thisGridCoverageReader
. Otherwise, the reader may continue to hold on to resources indefinitely.- Throws:
IOException
- if an error occured while disposing resources (for example while closing a file).
-
-