Class AbstractGridCoverage2DReader
- Object
- 
- AbstractGridCoverage2DReader
 
- 
- All Implemented Interfaces:
- GridCoverageReader,- GridCoverage2DReader
 - Direct Known Subclasses:
- ArcGridReader,- BaseGridCoverage2DReader,- GeoPackageReader,- GeoTiffReader,- GrassCoverageReader,- ImageMosaicReader,- ImagePyramidReader,- JP2KReader,- MBTilesReader,- NetCDFReader,- PGRasterReader,- TPKReader,- WMSCoverageReader,- WMTSCoverageReader,- WorldImageReader
 
 public abstract class AbstractGridCoverage2DReader extends Object implements GridCoverage2DReader This class is a first attempt for providing a way to get more informations out of a single 2D raster datasets (x,y). It is worth to remark that for the moment this is thought for 2D rasters not for 3D or 4D rasters (x,y,z,t).The main drawback I see with the current GeoApi GridCoverageReader interface is that there is no way to get real information about a raster source unless you instantiate a GridCoverage. As an instance it is impossible to know the envelope, the number of overviews, the tile size. This information is needed in order to perform decimation on reading or to use built-in overviews 
 This really impacts the ability to exploit raster datasets in a desktop environment where caching is crucial.- Since:
- 2.3
- Author:
- Simone Giannecchini, GeoSolutions
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected booleancloseMeTemp variable used in many readers.protected GridCoverageFactorycoverageFactoryGridCoverageFactoryinstance.protected StringcoverageNameCoverage nameprotected CoordinateReferenceSystemcrscrs for this coverageprotected DatasetLayoutdtLayoutCoverageDatasetLayoutcontaining information about Overviews and Mask managementprotected static doubleEPSSmall number used for double comparisonsprotected booleangzippedIn case we are trying to read from a GZipped file this will be set to true.protected double[]highestResHighest resolution available for this reader.protected HintshintsHints used by theAbstractGridCoverage2DReadersubclasses.protected ImageInputStreaminStreamInput stream that can be used to initialize subclasses ofAbstractGridCoverage2DReader.protected ImageInputStreamSpiinStreamSPIprotected intnumOverviewsThis contains the number of overviews.aaaprotected Double[]offsetsprotected GeneralBoundsoriginalEnvelopeEnvelope read from fileprotected GridEnvelopeoriginalGridRangeThe originalGridRangefor theGridCoverage2Dof this reader.protected double[][]overViewResolutionsResolutions avialaible through an overviews based mechanism.protected MathTransformraster2Model2DGridToWorld math transform.protected Double[]scalesscales and offsets for rescalingprotected ObjectsourceSource to read from- 
Fields inherited from interface GridCoverage2DReaderELEVATION_DOMAIN, ELEVATION_DOMAIN_MAXIMUM, ELEVATION_DOMAIN_MINIMUM, ELEVATION_DOMAIN_RESOLUTION, FILE_SOURCE_PROPERTY, HAS_ELEVATION_DOMAIN, HAS_TIME_DOMAIN, MULTICRS_EPSGCODES, MULTICRS_READER, PAM_DATASET, REPROJECTING_READER, SOURCE_URL_PROPERTY, TIME_DOMAIN, TIME_DOMAIN_MAXIMUM, TIME_DOMAIN_MINIMUM, TIME_DOMAIN_RESOLUTION
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedAbstractGridCoverage2DReader()Default protected constructor.AbstractGridCoverage2DReader(Object input)Creates a new instance of aAIGReader.AbstractGridCoverage2DReader(Object input, Hints hints)Creates a new instance of aAIGReader.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddAllSiblings(File file, List<File> files, String... extensions)Adds all the siblings that could be found to exist to the given file listprotected voidaddSiblings(List<File> files, File... siblings)Adds the specified siblings, if not null, and existingprotected booleancheckName(String coverageName)This method is responsible for checking the provided coverage name against the coverage name for thisGridCoverage2DReader.protected voidcollectScaleOffset(IIOMetadata iioMetadata)Collects the scales and offsets for value rescaling from the metadata, if presentprotected GridCoveragecreateImageCoverage(String coverageName, PlanarImage image)Creates aGridCoveragefor the providedPlanarImageusing theoriginalEnvelopethat was provided for this coverage.protected GridCoverage2DcreateImageCoverage(String coverageName, PlanarImage image, MathTransform raster2Model)Creates aGridCoveragefor the providedPlanarImageusing theraster2Modelthat was provided for this coverage.protected GridCoveragecreateImageCoverage(PlanarImage image)Creates aGridCoveragefor the providedPlanarImageusing theoriginalEnvelopethat was provided for this coverage.protected GridCoverage2DcreateImageCoverage(PlanarImage image, MathTransform raster2Model)Creates aGridCoveragefor the providedPlanarImageusing theraster2Modelthat was provided for this coverage.protected voiddecimationOnReadingControl(String coverageName, Integer imageChoice, ImageReadParam readP, double[] requestedRes)This method is responsible for evaluating possible subsampling factors once the best resolution level has been found, in case we have support for overviews, or starting from the original coverage in case there are no overviews available.voiddispose()Disposes this reader.protected voidfinalize()Forcing disposal of thisAbstractGridCoverage2DReaderwhich may keep anImageInputStreamopen.CoordinateReferenceSystemgetCoordinateReferenceSystem()Retrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.CoordinateReferenceSystemgetCoordinateReferenceSystem(String coverageName)Retrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.DatasetLayoutgetDatasetLayout()Returns theDatasetLayoutfor the coverage.DatasetLayoutgetDatasetLayout(String coverageName)Returns theDatasetLayoutfor the specified coverage.Set<ParameterDescriptor<List>>getDynamicParameters()Return the set of dynamic parameterDescriptors (the ones related to domains) for this reader.Set<ParameterDescriptor<List>>getDynamicParameters(String coverageName)Return the set of dynamic parameterDescriptors (the ones related to domains) for this reader.protected List<FileGroupProvider.FileGroup>getFiles()Returns a list of files making up the source data for this reader (as a whole).intgetGridCoverageCount()Retrieve the number of coverages contained within the input source.String[]getGridCoverageNames()Retrieve the list of coverages contained within the input source.GroundControlPointsgetGroundControlPoints()Return the ground control points for the default coverage, or null if there are noneGroundControlPointsgetGroundControlPoints(String coverageName)Return the ground control points for the specified, or null if there are noneprotected double[]getHighestRes()protected double[]getHighestRes(String coverageName)ImageLayoutgetImageLayout()Retrieve theImageLayoutfor the default coverage.ImageLayoutgetImageLayout(String coverageName)Retrieve theImageLayoutfor the specified coverage.ServiceInfogetInfo()Information about this source.ResourceInfogetInfo(String coverageName)Default implementation returns a FileResourceInfo containing same fileGroup list contained in the ServiceInfo object.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.StringgetMetadataValue(String name)Retrieve the metadata value for a given metadata name.StringgetMetadataValue(String coverageName, String name)Retrieve the metadata value for a given metadata name for a specified coverage.protected MultiLevelROIProvidergetMultiLevelROIProvider(String coverageName)GeneralBoundsgetOriginalEnvelope()Retrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.GeneralBoundsgetOriginalEnvelope(String coverageName)Retrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.GridEnvelopegetOriginalGridRange()Retrieves theGeneralGridEnvelopethat represents the raster grid dimensions of the highest resolution level in this dataset.GridEnvelopegetOriginalGridRange(String coverageName)Retrieves theGeneralGridEnvelopethat represents the raster grid dimensions of the highest resolution level in this dataset.MathTransformgetOriginalGridToWorld(String coverageName, PixelInCell pixInCell)Retrieves the original grid to world transformation for thisAbstractGridCoverage2DReader.MathTransformgetOriginalGridToWorld(PixelInCell pixInCell)Retrieves the original grid to world transformation for thisAbstractGridCoverage2DReader.GridEnvelopegetOverviewGridEnvelope(int overviewIndex)GridEnvelopegetOverviewGridEnvelope(String coverageName, int overviewIndex)static PAMDatasetgetPamDataset(TIFFImageMetadata metadata)If available, parses the GDAL_METADATA tag contents and transforms it into a PAMDatasetstatic PAMDatasetgetPamDataset(File sourceFile, IIOMetadata metadata)Method that looks for an externalPAMDatasetfirst, and if not found, checks for an internalGDALMetadatainside a custom tag.double[]getReadingResolutions(String coverageName, OverviewPolicy policy, double[] requestedResolution)Returns the actual resolution used to read the data given the specified target resolution and the specified overview policydouble[]getReadingResolutions(OverviewPolicy policy, double[] requestedResolution)Returns the actual resolution used to read the data given the specified target resolution and the specified overview policyprotected AffineTransformgetRescaledRasterToModel(RenderedImage coverageRaster)Computes the raster to model of a rescaled output raster, based on the original transform and output raster scaling factorprotected static double[]getResolution(GeneralBounds envelope, Rectangle2D dim, CoordinateReferenceSystem crs)This method is responsible for computing the resolutions in for the provided grid geometry in the provided crs.double[][]getResolutionLevels()Retrieve the resolution levels for the default coverage.double[][]getResolutionLevels(String coverageName)Retrieve the resolution levels for the specified coverage.protected static FilegetSibling(File file, String extension)Retrieves the sibling of the specified file, if available, or null otherwiseObjectgetSource()Retrieves the source for thisAbstractGridCoverage2DReader.protected FilegetSourceAsFile()Returns the source as a File, if it can be converted to one, and it existsGridCoverage2Dread(String coverageName, GeneralParameterValue[] parameters)Retrieves theGridEnvelopeassociated to the specified coverageName for thisGridCoverage2DReader.abstract GridCoverage2Dread(GeneralParameterValue[] parameters)Read the current grid coverage from the stream.protected voidsetlayout(ImageLayout layout)Set the provided layout for thisGridCoverage2DReader-protected voidsetLayout(ImageReader reader)Extract the ImageLayout from the provided reader for the first available image.protected IntegersetReadParams(String coverageName, OverviewPolicy overviewPolicy, ImageReadParam readP, GeneralBounds requestedEnvelope, Rectangle requestedDim)This method is responsible for preparing the read param for doing anImageReader.read(int, ImageReadParam).protected IntegersetReadParams(OverviewPolicy overviewPolicy, ImageReadParam readP, GeneralBounds requestedEnvelope, Rectangle requestedDim)This method is responsible for preparing the read param for doing anImageReader.read(int, ImageReadParam).- 
Methods inherited from class Objectclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface GridCoverageReadergetFormat
 
- 
 
- 
- 
- 
Field Detail- 
EPSprotected static double EPS Small number used for double comparisons
 - 
numOverviewsprotected int numOverviews This contains the number of overviews.aaa
 - 
raster2Modelprotected MathTransform raster2Model 2DGridToWorld math transform.
 - 
crsprotected CoordinateReferenceSystem crs crs for this coverage
 - 
originalEnvelopeprotected GeneralBounds originalEnvelope Envelope read from file
 - 
coverageNameprotected String coverageName Coverage name
 - 
sourceprotected Object source Source to read from
 - 
hintsprotected Hints hints Hints used by theAbstractGridCoverage2DReadersubclasses.
 - 
highestResprotected double[] highestRes Highest resolution available for this reader.
 - 
closeMeprotected boolean closeMe Temp variable used in many readers.
 - 
gzippedprotected boolean gzipped In case we are trying to read from a GZipped file this will be set to true.
 - 
originalGridRangeprotected GridEnvelope originalGridRange The originalGridRangefor theGridCoverage2Dof this reader.
 - 
inStreamprotected ImageInputStream inStream Input stream that can be used to initialize subclasses ofAbstractGridCoverage2DReader.
 - 
overViewResolutionsprotected double[][] overViewResolutions Resolutions avialaible through an overviews based mechanism.
 - 
coverageFactoryprotected GridCoverageFactory coverageFactory GridCoverageFactoryinstance.
 - 
scalesprotected Double[] scales scales and offsets for rescaling
 - 
offsetsprotected Double[] offsets 
 - 
inStreamSPIprotected ImageInputStreamSpi inStreamSPI 
 - 
dtLayoutprotected DatasetLayout dtLayout CoverageDatasetLayoutcontaining information about Overviews and Mask management
 
- 
 - 
Constructor Detail- 
AbstractGridCoverage2DReaderprotected AbstractGridCoverage2DReader() Default protected constructor. Useful for wrappers.
 - 
AbstractGridCoverage2DReaderpublic AbstractGridCoverage2DReader(Object input) throws DataSourceException Creates a new instance of aAIGReader. I assume nothing about file extension.- Parameters:
- input- Source object for which we want to build an- AIGReader.
- Throws:
- DataSourceException
 
 - 
AbstractGridCoverage2DReaderpublic AbstractGridCoverage2DReader(Object input, Hints hints) throws DataSourceException Creates a new instance of aAIGReader. I assume nothing about file extension.- Parameters:
- input- Source object for which we want to build an- AIGReader.
- hints- Hints to be used by this reader throughout his life.
- Throws:
- DataSourceException
 
 
- 
 - 
Method Detail- 
checkNameprotected boolean checkName(String coverageName) This method is responsible for checking the provided coverage name against the coverage name for thisGridCoverage2DReader.- Parameters:
- coverageName- the coverage name to check.
- Returns:
- trueif this- GridCoverage2DReadercontains the provided coverage name,- falseotherwise.
 
 - 
readpublic GridCoverage2D read(String coverageName, GeneralParameterValue[] parameters) throws IllegalArgumentException, IOException Description copied from interface:GridCoverage2DReaderRetrieves theGridEnvelopeassociated to the specified coverageName for thisGridCoverage2DReader.- Specified by:
- readin interface- GridCoverage2DReader
- Specified by:
- readin interface- GridCoverageReader
- Parameters:
- coverageName- the name of the coverage to work with
- parameters- an array of- GeneralParameterValuethat uses a subset of the available read params for this- GridCoverage2DReaderas specified by the- Format
- Returns:
- a GridCoverage2Dfor the underlying default coverage for thisGridCoverage2DReaderornullin case noGridCoverage2Dcan be read for the provided parameters.
- Throws:
- IllegalArgumentException- if the specified coverageName does not exist
- IOException- if a read operation failed for some other input/output reason, including- FileNotFoundExceptionif no file with the given- namecan be found, or- IIOExceptionif an error was thrown by the underlying image library.
 
 - 
readpublic abstract GridCoverage2D read(GeneralParameterValue[] parameters) throws IllegalArgumentException, IOException Read the current grid coverage from the stream.Example: - Specified by:
- readin interface- GridCoverage2DReader
- Specified by:
- readin interface- GridCoverageReader
- Parameters:
- parameters- Optional parameters matching- Format.getReadParameters().
- Returns:
- a grid coverage from the input source.
- Throws:
- InvalidParameterNameException- if a parameter in- parametersdoesn't have a recognized name.
- InvalidParameterValueException- if a parameter in- parametersdoesn't have a valid value.
- ParameterNotFoundException- if a parameter was required for the operation but was not provided in the- parameterslist.
- 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, including- FileNotFoundExceptionif no file with the given- namecan be found, or- IIOExceptionif an error was thrown by the underlying image library.
- InvalidParameterNameException- if a parameter in- parametersdoesn't have a recognized name.
- InvalidParameterValueException- if a parameter in- parametersdoesn't have a valid value.
- ParameterNotFoundException- if a parameter was required for the operation but was not provided in the- parameterslist.
- IllegalArgumentException
 
 - 
setReadParamsprotected Integer setReadParams(OverviewPolicy overviewPolicy, ImageReadParam readP, GeneralBounds requestedEnvelope, Rectangle requestedDim) throws IOException, TransformException This method is responsible for preparing the read param for doing anImageReader.read(int, ImageReadParam).This method is responsible for preparing the read param for doing an ImageReader.read(int, ImageReadParam). It sets the passedImageReadParamin terms of decimation on reading using the provided requestedEnvelope and requestedDim to evaluate the needed resolution. It also returns andIntegerrepresenting the index of the raster to be read when dealing with multipage raster.- Parameters:
- overviewPolicy- it can be one of- Hints#VALUE_OVERVIEW_POLICY_IGNORE,- Hints#VALUE_OVERVIEW_POLICY_NEAREST,- Hints#VALUE_OVERVIEW_POLICY_QUALITYor- Hints#VALUE_OVERVIEW_POLICY_SPEED. It specifies the policy to compute the overviews level upon request.
- readP- an instance of- ImageReadParamfor setting the subsampling factors.
- requestedEnvelope- the- GeneralBoundswe are requesting.
- requestedDim- the requested dimensions.
- Returns:
- the index of the raster to read in the underlying data source.
- Throws:
- IOException
- TransformException
 
 - 
setReadParamsprotected Integer setReadParams(String coverageName, OverviewPolicy overviewPolicy, ImageReadParam readP, GeneralBounds requestedEnvelope, Rectangle requestedDim) throws IOException, TransformException This method is responsible for preparing the read param for doing anImageReader.read(int, ImageReadParam).This method is responsible for preparing the read param for doing an ImageReader.read(int, ImageReadParam). It sets the passedImageReadParamin terms of decimation on reading using the provided requestedEnvelope and requestedDim to evaluate the needed resolution. It also returns andIntegerrepresenting the index of the raster to be read when dealing with multipage raster.- Parameters:
- overviewPolicy- it can be one of- Hints#VALUE_OVERVIEW_POLICY_IGNORE,- Hints#VALUE_OVERVIEW_POLICY_NEAREST,- Hints#VALUE_OVERVIEW_POLICY_QUALITYor- Hints#VALUE_OVERVIEW_POLICY_SPEED. It specifies the policy to compute the overviews level upon request.
- readP- an instance of- ImageReadParamfor setting the subsampling factors.
- requestedEnvelope- the- GeneralBoundswe are requesting.
- requestedDim- the requested dimensions.
- Returns:
- the index of the raster to read in the underlying data source.
- Throws:
- IOException
- TransformException
 
 - 
getReadingResolutionspublic double[] getReadingResolutions(OverviewPolicy policy, double[] requestedResolution) throws IOException Returns the actual resolution used to read the data given the specified target resolution and the specified overview policy- Specified by:
- getReadingResolutionsin interface- GridCoverage2DReader
- Parameters:
- policy- the- OverviewPolicyto 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.
 
 - 
getReadingResolutionspublic double[] getReadingResolutions(String coverageName, OverviewPolicy policy, double[] requestedResolution) throws IOException Returns the actual resolution used to read the data given the specified target resolution and the specified overview policy- Specified by:
- getReadingResolutionsin interface- GridCoverage2DReader
- Parameters:
- coverageName- the name of the coverage to work on.
- policy- the- OverviewPolicyto 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.
 
 - 
decimationOnReadingControlprotected final void decimationOnReadingControl(String coverageName, Integer imageChoice, ImageReadParam readP, double[] requestedRes) This method is responsible for evaluating possible subsampling factors once the best resolution level has been found, in case we have support for overviews, or starting from the original coverage in case there are no overviews available.Anyhow this method should not be called directly but subclasses should make use of the setReadParams method instead in order to transparently look for overviews. 
 - 
createImageCoverageprotected final GridCoverage createImageCoverage(PlanarImage image) throws IOException Creates aGridCoveragefor the providedPlanarImageusing theoriginalEnvelopethat was provided for this coverage.- Parameters:
- image- contains the data for the coverage to create.
- Returns:
- a GridCoverage
- Throws:
- IOException
 
 - 
createImageCoverageprotected final GridCoverage createImageCoverage(String coverageName, PlanarImage image) throws IOException Creates aGridCoveragefor the providedPlanarImageusing theoriginalEnvelopethat was provided for this coverage.- Parameters:
- image- contains the data for the coverage to create.
- Returns:
- a GridCoverage
- Throws:
- IOException
 
 - 
createImageCoverageprotected final GridCoverage2D createImageCoverage(PlanarImage image, MathTransform raster2Model) throws IOException Creates aGridCoveragefor the providedPlanarImageusing theraster2Modelthat was provided for this coverage.This method is vital when working with coverages that have a raster to model transformation that is not a simple scale and translate. - Parameters:
- image- contains the data for the coverage to create.
- raster2Model- is the- MathTransformthat maps from the raster space to the model space.
- Returns:
- a GridCoverage
- Throws:
- IOException
 
 - 
createImageCoverageprotected final GridCoverage2D createImageCoverage(String coverageName, PlanarImage image, MathTransform raster2Model) throws IOException Creates aGridCoveragefor the providedPlanarImageusing theraster2Modelthat was provided for this coverage.This method is vital when working with coverages that have a raster to model transformation that is not a simple scale and translate. - Parameters:
- image- contains the data for the coverage to create.
- raster2Model- is the- MathTransformthat maps from the raster space to the model space.
- Returns:
- a GridCoverage
- Throws:
- IOException
 
 - 
getResolutionprotected static final double[] getResolution(GeneralBounds envelope, Rectangle2D dim, CoordinateReferenceSystem crs) throws DataSourceException This method is responsible for computing the resolutions in for the provided grid geometry in the provided crs.It is worth to note that the returned resolution array is of length of 2 and it always is lon, lat for the moment. 
 It might be worth to remove the axes reordering code when we are confident enough with the code to handle the north-up crs.TODO use orthodromic distance? - Parameters:
- envelope- the GeneralEnvelope
- Throws:
- DataSourceException
 
 - 
getOriginalGridRangepublic GridEnvelope getOriginalGridRange() Retrieves theGeneralGridEnvelopethat represents the raster grid dimensions of the highest resolution level in this dataset.- Specified by:
- getOriginalGridRangein interface- GridCoverage2DReader
- Returns:
- the GeneralGridEnvelopethat represents the raster grid dimensions of the highest resolution level in this dataset.
 
 - 
getOriginalGridRangepublic GridEnvelope getOriginalGridRange(String coverageName) Retrieves theGeneralGridEnvelopethat represents the raster grid dimensions of the highest resolution level in this dataset.- Specified by:
- getOriginalGridRangein interface- GridCoverage2DReader
- Parameters:
- coverageName- the name of the coverage to work with
- Returns:
- the GeneralGridEnvelopethat represents the raster grid dimensions of the highest resolution level in this dataset.
 
 - 
getCoordinateReferenceSystempublic CoordinateReferenceSystem getCoordinateReferenceSystem() Retrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.- Specified by:
- getCoordinateReferenceSystemin interface- GridCoverage2DReader
- Returns:
- the GeneralBoundsfor thisAbstractGridCoverage2DReader.
 
 - 
getCoordinateReferenceSystempublic CoordinateReferenceSystem getCoordinateReferenceSystem(String coverageName) Retrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.- Specified by:
- getCoordinateReferenceSystemin interface- GridCoverage2DReader
- Returns:
- the GeneralBoundsfor thisAbstractGridCoverage2DReader.
 
 - 
getOriginalEnvelopepublic GeneralBounds getOriginalEnvelope() Retrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.- Specified by:
- getOriginalEnvelopein interface- GridCoverage2DReader
- Returns:
- the GeneralBoundsfor thisAbstractGridCoverage2DReader.
 
 - 
getOriginalEnvelopepublic GeneralBounds getOriginalEnvelope(String coverageName) Retrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.- Specified by:
- getOriginalEnvelopein interface- GridCoverage2DReader
- Parameters:
- coverageName- the name of the coverage to work on.
- Returns:
- the GeneralBoundsfor thisAbstractGridCoverage2DReader.
 
 - 
getOriginalGridToWorldpublic MathTransform getOriginalGridToWorld(PixelInCell pixInCell) Retrieves the original grid to world transformation for thisAbstractGridCoverage2DReader.- Specified by:
- getOriginalGridToWorldin interface- GridCoverage2DReader
- Parameters:
- pixInCell- specifies the datum of the transformation we want.
- Returns:
- the original grid to world transformation for this AbstractGridCoverage2DReader.
 
 - 
getOriginalGridToWorldpublic MathTransform getOriginalGridToWorld(String coverageName, PixelInCell pixInCell) Retrieves the original grid to world transformation for thisAbstractGridCoverage2DReader.- Specified by:
- getOriginalGridToWorldin interface- GridCoverage2DReader
- Parameters:
- pixInCell- specifies the datum of the transformation we want.
- coverageName- the name of the coverage to work with
- Returns:
- the original grid to world transformation for this AbstractGridCoverage2DReader.
 
 - 
getSourcepublic final Object getSource() Retrieves the source for thisAbstractGridCoverage2DReader.- Specified by:
- getSourcein interface- GridCoverageReader
- Returns:
- the source for this AbstractGridCoverage2DReader.
 
 - 
disposepublic void dispose() Disposes this reader.This method just tries to close the underlying ImageInputStream.- Specified by:
- disposein interface- GridCoverageReader
 
 - 
getGridCoverageNamespublic String[] getGridCoverageNames() Description copied from interface:GridCoverageReaderRetrieve 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.- Specified by:
- getGridCoverageNamesin interface- GridCoverageReader
- Returns:
- The list of grid coverages contained within the input source.
 
 - 
getMetadataNamespublic String[] getMetadataNames(String coverageName) Description copied from interface:GridCoverageReaderReturns the list of metadata keywords associated with a specific gridCoverage referred by name. If no metadata is available, the array will be empty.- Specified by:
- getMetadataNamesin interface- GridCoverageReader
- Returns:
- The list of metadata keywords for the input source.
 
 - 
getMetadataNamespublic String[] getMetadataNames() Description copied from interface:GridCoverageReaderReturns 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.- Specified by:
- getMetadataNamesin interface- GridCoverageReader
- Returns:
- The list of metadata keywords for the input source.
- See Also:
- GridCoverageReader.getMetadataNames()
 
 - 
getMetadataValuepublic String getMetadataValue(String name) Description copied from interface:GridCoverageReaderRetrieve the metadata value for a given metadata name.- Specified by:
- getMetadataValuein interface- GridCoverageReader
- 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
     GridCoverageReader.getMetadataNames().
- See Also:
- GridCoverageReader.getMetadataValue(java.lang.String)
 
 - 
getMetadataValuepublic String getMetadataValue(String coverageName, String name) Description copied from interface:GridCoverageReaderRetrieve the metadata value for a given metadata name for a specified coverage.- Specified by:
- getMetadataValuein interface- GridCoverageReader
- 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
     GridCoverageReader.getMetadataNames().
 
 - 
getGridCoverageCountpublic int getGridCoverageCount() Description copied from interface:GridCoverageReaderRetrieve the number of coverages contained within the input source.- Specified by:
- getGridCoverageCountin interface- GridCoverageReader
- Returns:
- The number of coverages contained within the input source.
- See Also:
- GridCoverageReader.getGridCoverageCount()
 
 - 
getInfopublic ServiceInfo getInfo() Information about this source.Subclasses should provide additional format specific information. - Specified by:
- getInfoin interface- GridCoverage2DReader
- Returns:
- ServiceInfo describing getSource().
 
 - 
getFilesprotected List<FileGroupProvider.FileGroup> getFiles() throws IOException Returns a list of files making up the source data for this reader (as a whole). The default implementation returns the source, if it can be made into a File object, or null otherwise.- Throws:
- IOException
 
 - 
getSourceAsFileprotected File getSourceAsFile() Returns the source as a File, if it can be converted to one, and it exists
 - 
getInfopublic ResourceInfo getInfo(String coverageName) Default implementation returns a FileResourceInfo containing same fileGroup list contained in the ServiceInfo object.- Specified by:
- getInfoin interface- GridCoverage2DReader
- Returns:
- ResourceInfo describing a specific coverage.
 
 - 
finalizeprotected void finalize() throws ThrowableForcing disposal of thisAbstractGridCoverage2DReaderwhich may keep anImageInputStreamopen.
 - 
getDynamicParameterspublic Set<ParameterDescriptor<List>> getDynamicParameters() throws IOException Return the set of dynamic parameterDescriptors (the ones related to domains) for this reader. Default implementation returns an empty set of parameters- Specified by:
- getDynamicParametersin interface- GridCoverage2DReader
- Returns:
- the Setof dynamic read parameters supported by thisGridCoverage2DReader.
- Throws:
- IOException- in case an error occurs while creating the- Setof dynamic parameters.
 
 - 
getDynamicParameterspublic Set<ParameterDescriptor<List>> getDynamicParameters(String coverageName) throws IOException Return the set of dynamic parameterDescriptors (the ones related to domains) for this reader. Default implementation returns an empty set of parameters- Specified by:
- getDynamicParametersin interface- GridCoverage2DReader
- 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 the- Setof dynamic parameters.
 
 - 
getDatasetLayoutpublic DatasetLayout getDatasetLayout() Description copied from interface:GridCoverage2DReaderReturns theDatasetLayoutfor the coverage.- Specified by:
- getDatasetLayoutin interface- GridCoverage2DReader
- Returns:
- a DatasetLayoutobject containing info about Overview number and Image masks.
 
 - 
getDatasetLayoutpublic DatasetLayout getDatasetLayout(String coverageName) Description copied from interface:GridCoverage2DReaderReturns theDatasetLayoutfor the specified coverage.- Specified by:
- getDatasetLayoutin interface- GridCoverage2DReader
- Parameters:
- coverageName- the name of the coverage for which we do want to get the- DatasetLayout
- Returns:
- a DatasetLayoutobject containing info about Overview number and Image masks.
 
 - 
getOverviewGridEnvelopepublic GridEnvelope getOverviewGridEnvelope(int overviewIndex) throws IOException - Throws:
- IOException
 
 - 
getOverviewGridEnvelopepublic GridEnvelope getOverviewGridEnvelope(String coverageName, int overviewIndex) throws IOException - Throws:
- IOException
 
 - 
getImageLayoutpublic ImageLayout getImageLayout(String coverageName) throws IOException Description copied from interface:GridCoverage2DReaderRetrieve theImageLayoutfor the specified coverage.Throw an IllegalArgumentExceptionin case the name is wrong and/or no such a coverage exists.- Specified by:
- getImageLayoutin interface- GridCoverage2DReader
- Parameters:
- coverageName- the name of the coverage for which we want to know the- GridEnvelope.
- Returns:
- an ImageLayoutthat is useful for actually knowing theColorModel, theSampleModelas well as the tile grid for a certain coverage.
- Throws:
- IOException
 
 - 
getImageLayoutpublic ImageLayout getImageLayout() throws IOExceptionDescription copied from interface:GridCoverage2DReaderRetrieve theImageLayoutfor the default coverage.Throw an IllegalArgumentExceptionin case the name is wrong and/or no such a coverage exists.- Specified by:
- getImageLayoutin interface- GridCoverage2DReader
- Returns:
- an ImageLayoutthat is useful for actually knowing theColorModel, theSampleModelas well as the tile grid for the default coverage.
- Throws:
- IOException
 
 - 
setLayoutprotected void setLayout(ImageReader reader) throws IOException Extract the ImageLayout from the provided reader for the first available image.- Parameters:
- reader- an istance of- ImageReader
- Throws:
- IOException- in case an error occurs
 
 - 
setlayoutprotected void setlayout(ImageLayout layout) Set the provided layout for thisGridCoverage2DReader-- Parameters:
- layout- the- ImageLayoutto set. It must be nont null
 
 - 
getResolutionLevelspublic double[][] getResolutionLevels() throws IOExceptionDescription copied from interface:GridCoverage2DReaderRetrieve the resolution levels for the default coverage.Throw an IllegalArgumentExceptionin case the name is wrong and/or no such a coverage exists.- Specified by:
- getResolutionLevelsin interface- GridCoverage2DReader
- Returns:
- the resolution levels for the default coverage.
- Throws:
- IOException
 
 - 
getResolutionLevelspublic double[][] getResolutionLevels(String coverageName) throws IOException Description copied from interface:GridCoverage2DReaderRetrieve the resolution levels for the specified coverage.Throw an IllegalArgumentExceptionin case the name is wrong and/or no such a coverage exists.- Specified by:
- getResolutionLevelsin interface- GridCoverage2DReader
- 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:
- IOException
 
 - 
getHighestResprotected double[] getHighestRes(String coverageName) 
 - 
getHighestResprotected double[] getHighestRes() 
 - 
getGroundControlPointspublic GroundControlPoints getGroundControlPoints() Return the ground control points for the default coverage, or null if there are none
 - 
getGroundControlPointspublic GroundControlPoints getGroundControlPoints(String coverageName) Return the ground control points for the specified, or null if there are none
 - 
getRescaledRasterToModelprotected AffineTransform getRescaledRasterToModel(RenderedImage coverageRaster) Computes the raster to model of a rescaled output raster, based on the original transform and output raster scaling factor
 - 
getSiblingprotected static File getSibling(File file, String extension) Retrieves the sibling of the specified file, if available, or null otherwise
 - 
addAllSiblingsprotected void addAllSiblings(File file, List<File> files, String... extensions) Adds all the siblings that could be found to exist to the given file list
 - 
addSiblingsprotected void addSiblings(List<File> files, File... siblings) Adds the specified siblings, if not null, and existing
 - 
getMultiLevelROIProviderprotected MultiLevelROIProvider getMultiLevelROIProvider(String coverageName) 
 - 
collectScaleOffsetprotected void collectScaleOffset(IIOMetadata iioMetadata) Collects the scales and offsets for value rescaling from the metadata, if present
 - 
getPamDatasetpublic static PAMDataset getPamDataset(File sourceFile, IIOMetadata metadata) Method that looks for an externalPAMDatasetfirst, and if not found, checks for an internalGDALMetadatainside a custom tag.The method is tolerant to invalid metadata contents and will log at INFO level in case of invalid metadata structure: there might be files with invalid metadata that used to be read just fine before PAM dataset reading was implemented. 
 - 
getPamDatasetpublic static PAMDataset getPamDataset(TIFFImageMetadata metadata) If available, parses the GDAL_METADATA tag contents and transforms it into a PAMDataset
 
- 
 
-