Interface GridCoverage2DReader
-
- All Superinterfaces:
GridCoverageReader
- All Known Subinterfaces:
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 GridCoverage2DReader extends GridCoverageReader
Provides access to named GridCoverage2D (along with any context information) from a persistent store.Data access method take a
coverageNamesupplied byGridCoverageReader.getGridCoverageNames()allowing each data GridCoverage2D to be accessed independently.In addition static keywords for use with
GridCoverageReader.getMetadataNames(String coverageName)have been provided.- Author:
- Daniele Romagnoli, GeoSolutions SAS, Andrea Aime, GeoSolutions SAS, Simone Giannecchini, GeoSolutions SAS
-
-
Field Summary
Fields Modifier and Type Field Description static StringELEVATION_DOMAINElevation domain (comma separated list of values)static StringELEVATION_DOMAIN_MAXIMUMElevation domain maximum valuestatic StringELEVATION_DOMAIN_MINIMUMElevation domain minimum valuestatic StringELEVATION_DOMAIN_RESOLUTIONElevation domain resolutionstatic StringFILE_SOURCE_PROPERTYIf a coverage has this property is means it been read straight out of a file without any sub-setting, it means the coverage represents the full contents of the file.static StringHAS_ELEVATION_DOMAINWhether the elevation is expressed as a full domain or min/max/resolution (true if domain list available)static StringHAS_TIME_DOMAINIf the time domain is available (or if a min/max/resolution approach has been chosen)static StringMULTICRS_EPSGCODESWhen the above MULTICRS_READER property is present and evaluates to "true", this property may contain the list of internal EPSG Codes of the multiple CRS, if the reader implements it.static StringMULTICRS_READERThis property is present, and evaluates to "true", if the reader internally has multiple CRS elements, even if it advertises a single CRS in output (e.g., it won't perform a general reprojection for us, but generate and output in its declared CRS)static StringPAM_DATASETThe name of the property containing the eventual GDALPAMDatasetfor the coverage at hand.static StringREPROJECTING_READERThis property is present, and evaluates to "true", if the reader can do reprojection on its own (that is, it is not backed by actual data, but by a remote service that can perform reprojection for us).static StringSOURCE_URL_PROPERTYName of aGridCoverage2Dproperty that is aURLfor the original source of the coverage.static StringTIME_DOMAINThe time domain (comma separated list of values)static StringTIME_DOMAIN_MAXIMUMThe time domain max valuestatic StringTIME_DOMAIN_MINIMUMThe time domain min valuestatic StringTIME_DOMAIN_RESOLUTIONTime domain resolution (when using min/max/resolution)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CoordinateReferenceSystemgetCoordinateReferenceSystem()Retrieves theCoordinateReferenceSystemassociated to the default coverage for thisGridCoverage2DReader.CoordinateReferenceSystemgetCoordinateReferenceSystem(String coverageName)Retrieves theCoordinateReferenceSystemassociated to thisGridCoverage2DReaderfor the specified coverageName.DatasetLayoutgetDatasetLayout()Returns theDatasetLayoutfor the coverage.DatasetLayoutgetDatasetLayout(String coverageName)Returns theDatasetLayoutfor the specified coverage.Set<ParameterDescriptor<List>>getDynamicParameters()Return theSetof dynamic read parameters supported by thisGridCoverage2DReaderfor the default coverage.Set<ParameterDescriptor<List>>getDynamicParameters(String coverageName)Return theSetof dynamic read parameters supported by thisGridCoverage2DReaderfor the specified coverage.ImageLayoutgetImageLayout()Retrieve theImageLayoutfor the default coverage.ImageLayoutgetImageLayout(String coverageName)Retrieve theImageLayoutfor the specified coverage.ServiceInfogetInfo()Information about the store.ResourceInfogetInfo(String coverageName)Information about a specific resource.GeneralBoundsgetOriginalEnvelope()Return the originalGeneralBoundsfor the default coverage served by the underlying store.GeneralBoundsgetOriginalEnvelope(String coverageName)Return the originalGeneralBoundsfor the specified coverageName.GridEnvelopegetOriginalGridRange()Retrieves theGridEnvelopeassociated to the default coverage for thisGridCoverage2DReader.GridEnvelopegetOriginalGridRange(String coverageName)Retrieves theGridEnvelopeassociated to the specified coverageName for thisGridCoverage2DReader.MathTransformgetOriginalGridToWorld(String coverageName, PixelInCell pixInCell)Retrieves theMathTransformassociated to the requested coverageName for thisGridCoverage2DReader.MathTransformgetOriginalGridToWorld(PixelInCell pixInCell)Retrieves theMathTransformassociated to the default coverage for thisGridCoverage2DReader.double[]getReadingResolutions(String coverageName, OverviewPolicy policy, double[] requestedResolution)Return the resolution of the overview which would be picked out for the provided requested resolution using the providedOverviewPolicy.double[]getReadingResolutions(OverviewPolicy policy, double[] requestedResolution)Return the resolution of the overview which would be picked out for the provided requested resolution using the providedOverviewPolicy.double[][]getResolutionLevels()Retrieve the resolution levels for the default coverage.double[][]getResolutionLevels(String coverageName)Retrieve the resolution levels for the specified coverage.GridCoverage2Dread(String coverageName, GeneralParameterValue[] parameters)Retrieves theGridEnvelopeassociated to the specified coverageName for thisGridCoverage2DReader.GridCoverage2Dread(GeneralParameterValue[] parameters)Created aGridCoverage2Dout of thisGridCoverage2DReaderfor the default coverage.-
Methods inherited from interface GridCoverageReader
dispose, getFormat, getGridCoverageCount, getGridCoverageNames, getMetadataNames, getMetadataNames, getMetadataValue, getMetadataValue, getSource
-
-
-
-
Field Detail
-
TIME_DOMAIN
static final String TIME_DOMAIN
The time domain (comma separated list of values)- See Also:
- Constant Field Values
-
TIME_DOMAIN_RESOLUTION
static final String TIME_DOMAIN_RESOLUTION
Time domain resolution (when using min/max/resolution)- See Also:
- Constant Field Values
-
HAS_TIME_DOMAIN
static final String HAS_TIME_DOMAIN
If the time domain is available (or if a min/max/resolution approach has been chosen)- See Also:
- Constant Field Values
-
TIME_DOMAIN_MAXIMUM
static final String TIME_DOMAIN_MAXIMUM
The time domain max value- See Also:
- Constant Field Values
-
TIME_DOMAIN_MINIMUM
static final String TIME_DOMAIN_MINIMUM
The time domain min value- See Also:
- Constant Field Values
-
HAS_ELEVATION_DOMAIN
static final String HAS_ELEVATION_DOMAIN
Whether the elevation is expressed as a full domain or min/max/resolution (true if domain list available)- See Also:
- Constant Field Values
-
ELEVATION_DOMAIN
static final String ELEVATION_DOMAIN
Elevation domain (comma separated list of values)- See Also:
- Constant Field Values
-
ELEVATION_DOMAIN_MAXIMUM
static final String ELEVATION_DOMAIN_MAXIMUM
Elevation domain maximum value- See Also:
- Constant Field Values
-
ELEVATION_DOMAIN_MINIMUM
static final String ELEVATION_DOMAIN_MINIMUM
Elevation domain minimum value- See Also:
- Constant Field Values
-
ELEVATION_DOMAIN_RESOLUTION
static final String ELEVATION_DOMAIN_RESOLUTION
Elevation domain resolution- See Also:
- Constant Field Values
-
FILE_SOURCE_PROPERTY
static final String FILE_SOURCE_PROPERTY
If a coverage has this property is means it been read straight out of a file without any sub-setting, it means the coverage represents the full contents of the file. This can be used for different types of optimizations, such as avoiding reading and re-encoding the original file when the original file would do.- See Also:
- Constant Field Values
-
SOURCE_URL_PROPERTY
static final String SOURCE_URL_PROPERTY
Name of aGridCoverage2Dproperty that is aURLfor the original source of the coverage. ThisURLmight be used to obtain further information on the coverage that is not otherwise available through theGridCoverage2DAPI.- See Also:
- Constant Field Values
-
REPROJECTING_READER
static final String REPROJECTING_READER
This property is present, and evaluates to "true", if the reader can do reprojection on its own (that is, it is not backed by actual data, but by a remote service that can perform reprojection for us).- See Also:
- Constant Field Values
-
MULTICRS_READER
static final String MULTICRS_READER
This property is present, and evaluates to "true", if the reader internally has multiple CRS elements, even if it advertises a single CRS in output (e.g., it won't perform a general reprojection for us, but generate and output in its declared CRS)- See Also:
- Constant Field Values
-
MULTICRS_EPSGCODES
static final String MULTICRS_EPSGCODES
When the above MULTICRS_READER property is present and evaluates to "true", this property may contain the list of internal EPSG Codes of the multiple CRS, if the reader implements it.- See Also:
- Constant Field Values
-
PAM_DATASET
static final String PAM_DATASET
The name of the property containing the eventual GDALPAMDatasetfor the coverage at hand.- See Also:
- Constant Field Values
-
-
Method Detail
-
getOriginalEnvelope
GeneralBounds getOriginalEnvelope()
Return the originalGeneralBoundsfor the default coverage served by the underlying store.- Returns:
- the original
GeneralBoundsfor the default coverage served by the underlying store.
-
getOriginalEnvelope
GeneralBounds getOriginalEnvelope(String coverageName)
Return the originalGeneralBoundsfor the specified coverageName.- Parameters:
coverageName- the name of the coverage to work on.- Returns:
- the original
GeneralBoundsfor the specified coverageName. - Throws:
NullPointerException- if the specified coverageName isnullIllegalArgumentException- if the specified coverageName does not exist
-
getCoordinateReferenceSystem
CoordinateReferenceSystem getCoordinateReferenceSystem()
Retrieves theCoordinateReferenceSystemassociated to the default coverage for thisGridCoverage2DReader.- Returns:
- the
CoordinateReferenceSystemmapped to the specified coverageName, ornullif the provided coverageName does not map to a real coverage. - Throws:
NullPointerException- if the specified coverageName isnull
-
getCoordinateReferenceSystem
CoordinateReferenceSystem getCoordinateReferenceSystem(String coverageName)
Retrieves theCoordinateReferenceSystemassociated to thisGridCoverage2DReaderfor the specified coverageName.- Returns:
- the
CoordinateReferenceSystemmapped to the specified coverageName - Throws:
NullPointerException- if the specified coverageName isnullIllegalArgumentException- if the specified coverageName does not exist
-
getOriginalGridRange
GridEnvelope getOriginalGridRange()
Retrieves theGridEnvelopeassociated to the default coverage for thisGridCoverage2DReader.The
GridEnvelopedescribes the raster area (in pixels) covered by the coverage.- Returns:
- the
CoordinateReferenceSystemmapped to the default coverageName
-
getOriginalGridRange
GridEnvelope getOriginalGridRange(String coverageName)
Retrieves theGridEnvelopeassociated to the specified coverageName for thisGridCoverage2DReader.The
GridEnvelopedescribes the raster area (in pixels) covered by the coverage.- Parameters:
coverageName- the name of the coverage to work with- Returns:
- the
GridEnvelopemapped to the specified coverageName - Throws:
NullPointerException- if the specified coverageName isnullIllegalArgumentException- if the specified coverageName does not exist
-
getOriginalGridToWorld
MathTransform getOriginalGridToWorld(PixelInCell pixInCell)
Retrieves theMathTransformassociated to the default coverage for thisGridCoverage2DReader.- Returns:
- the
CoordinateReferenceSystemmapped to the default coverageName
-
getOriginalGridToWorld
MathTransform getOriginalGridToWorld(String coverageName, PixelInCell pixInCell)
Retrieves theMathTransformassociated to the requested coverageName for thisGridCoverage2DReader.- Parameters:
coverageName- the name of the coverage to work with- Returns:
- the
MathTransformmapped to the specified coverageName - Throws:
NullPointerException- if the specified coverageName isnullIllegalArgumentException- if the specified coverageName does not exist
-
read
GridCoverage2D read(GeneralParameterValue[] parameters) throws IOException
Created aGridCoverage2Dout of thisGridCoverage2DReaderfor the default coverage.- Specified by:
readin interfaceGridCoverageReader- Parameters:
parameters- an array ofGeneralParameterValuethat uses a subset of the available read params for thisGridCoverage2DReaderas specified by theFormat- Returns:
- a
GridCoverage2Dfor the underlying default coverage for thisGridCoverage2DReaderornullin case noGridCoverage2Dcan be read for the provided parameters. - Throws:
IOException- in case an error happen during read time.
-
read
GridCoverage2D read(String coverageName, GeneralParameterValue[] parameters) throws IOException
Retrieves theGridEnvelopeassociated to the specified coverageName for thisGridCoverage2DReader.- Specified by:
readin interfaceGridCoverageReader- Parameters:
coverageName- the name of the coverage to work withparameters- an array ofGeneralParameterValuethat uses a subset of the available read params for thisGridCoverage2DReaderas specified by theFormat- Returns:
- a
GridCoverage2Dfor the underlying default coverage for thisGridCoverage2DReaderornullin case noGridCoverage2Dcan be read for the provided parameters. - Throws:
NullPointerException- if the specified coverageName isnullIllegalArgumentException- if the specified coverageName does not existIOException- if a read operation failed for some other input/output reason, includingFileNotFoundExceptionif no file with the givennamecan be found, orIIOExceptionif an error was thrown by the underlying image library.
-
getDynamicParameters
Set<ParameterDescriptor<List>> getDynamicParameters() throws IOException
Return theSetof dynamic read parameters supported by thisGridCoverage2DReaderfor the default coverage.- Returns:
- the
Setof dynamic read parameters supported by thisGridCoverage2DReader. - Throws:
IOException- in case an error occurs while creating theSetof dynamic parameters.
-
getDynamicParameters
Set<ParameterDescriptor<List>> getDynamicParameters(String coverageName) throws IOException
Return theSetof dynamic read parameters supported by thisGridCoverage2DReaderfor the specified coverage.- Parameters:
coverageName- the name of the coverage to work with- Returns:
- the
Setof dynamic read parameters supported by thisGridCoverage2DReader. - Throws:
IOException- in case an error occurs while creating theSetof dynamic parameters.NullPointerException- if the specified coverageName isnullIllegalArgumentException- if the specified coverageName does not exist
-
getReadingResolutions
double[] getReadingResolutions(OverviewPolicy policy, double[] requestedResolution) throws IOException
Return the resolution of the overview which would be picked out for the provided requested resolution using the providedOverviewPolicy. This method works on the default coverage for thisGridCoverage2DReader.- Parameters:
policy- theOverviewPolicyto use during evaluation.requestedResolution- the requested resolution- Returns:
- an array of 2 double with the resolution of the selected overview.
- Throws:
IOException- in case an error occurs.
-
getReadingResolutions
double[] getReadingResolutions(String coverageName, OverviewPolicy policy, double[] requestedResolution) throws IOException
Return the resolution of the overview which would be picked out for the provided requested resolution using the providedOverviewPolicy. This method works on the specified coverage for thisGridCoverage2DReader.- Parameters:
coverageName- the name of the coverage to work on.policy- theOverviewPolicyto use during evaluation.requestedResolution- the requested resolution- Returns:
- an array of 2 double with the resolution of the selected overview.
- Throws:
IOException- in case an error occurs.NullPointerException- if the specified coverageName isnullIllegalArgumentException- if the specified coverageName does not exist
-
getDatasetLayout
DatasetLayout getDatasetLayout()
Returns theDatasetLayoutfor the coverage.- Returns:
- a
DatasetLayoutobject containing info about Overview number and Image masks.
-
getDatasetLayout
DatasetLayout getDatasetLayout(String coverageName)
Returns theDatasetLayoutfor the specified coverage.- Parameters:
coverageName- the name of the coverage for which we do want to get theDatasetLayout- Returns:
- a
DatasetLayoutobject containing info about Overview number and Image masks.
-
getImageLayout
ImageLayout getImageLayout() throws IOExceptionRetrieve theImageLayoutfor the default coverage.Throw an
IllegalArgumentExceptionin case the name is wrong and/or no such a coverage exists.- Returns:
- an
ImageLayoutthat is useful for actually knowing theColorModel, theSampleModelas well as the tile grid for the default coverage. - Throws:
IOException
-
getImageLayout
ImageLayout getImageLayout(String coverageName) throws IOException
Retrieve theImageLayoutfor the specified coverage.Throw an
IllegalArgumentExceptionin case the name is wrong and/or no such a coverage exists.- Parameters:
coverageName- the name of the coverage for which we want to know theGridEnvelope.- Returns:
- an
ImageLayoutthat is useful for actually knowing theColorModel, theSampleModelas well as the tile grid for a certain coverage. - Throws:
NullPointerException- if the specified coverageName isnullIllegalArgumentException- if the specified coverageName does not existIOException
-
getResolutionLevels
double[][] getResolutionLevels() throws IOExceptionRetrieve the resolution levels for the default coverage.Throw an
IllegalArgumentExceptionin case the name is wrong and/or no such a coverage exists.- Returns:
- the resolution levels for the default coverage.
- Throws:
NullPointerException- if the specified coverageName isnullIllegalArgumentException- if the specified coverageName does not existIOException
-
getResolutionLevels
double[][] getResolutionLevels(String coverageName) throws IOException
Retrieve the resolution levels for the specified coverage.Throw an
IllegalArgumentExceptionin case the name is wrong and/or no such a coverage exists.- Parameters:
coverageName- the name of the coverage for which we want to know the resolution levels.- Returns:
- the resolution levels for the specified coverage.
- Throws:
NullPointerException- if the specified coverageName isnullIllegalArgumentException- if the specified coverageName does not existIOException
-
getInfo
ServiceInfo getInfo()
Information about the store.- Returns:
- ServiceInfo describing the whole store.
-
getInfo
ResourceInfo getInfo(String coverageName)
Information about a specific resource.- Returns:
- ResourceInfo describing a specific coverage.
-
-