Package org.geotools.geopkg.mosaic
Class GeoPackageReader
- Object
-
- AbstractGridCoverage2DReader
-
- GeoPackageReader
-
- All Implemented Interfaces:
GridCoverageReader
,GridCoverage2DReader
public class GeoPackageReader extends AbstractGridCoverage2DReader
GeoPackage Grid Reader (supports the GP mosaic datastore).- Author:
- Justin Deoliveira, Niels Charlier
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
DEFAULT_TILE_SIZE
protected File
sourceFile
protected Map<String,TileEntry>
tiles
protected static int
ZOOM_LEVEL_BASE
-
Fields inherited from class AbstractGridCoverage2DReader
closeMe, coverageFactory, coverageName, crs, dtLayout, EPS, gzipped, highestRes, hints, inStream, inStreamSPI, numOverviews, offsets, originalEnvelope, originalGridRange, overViewResolutions, raster2Model, scales, source
-
Fields inherited from interface GridCoverage2DReader
ELEVATION_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 Summary
Constructors Constructor Description GeoPackageReader(Object source, Hints hints)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkName(String coverageName)
This method is responsible for checking the provided coverage name against the coverage name for thisGridCoverage2DReader
.void
dispose()
Disposes this reader.CoordinateReferenceSystem
getCoordinateReferenceSystem(String coverageName)
Retrieves theGeneralBounds
for thisAbstractGridCoverage2DReader
.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.protected double[]
getHighestRes(String coverageName)
GeneralBounds
getOriginalEnvelope(String coverageName)
Retrieves theGeneralBounds
for thisAbstractGridCoverage2DReader
.GridEnvelope
getOriginalGridRange(String coverageName)
Retrieves theGeneralGridEnvelope
that represents the raster grid dimensions of the highest resolution level in this dataset.GridCoverage2D
read(String coverageName, GeneralParameterValue[] parameters)
Retrieves theGridEnvelope
associated to the specified coverageName for thisGridCoverage2DReader
.GridCoverage2D
read(GeneralParameterValue[] parameters)
Read the current grid coverage from the stream.-
Methods inherited from class AbstractGridCoverage2DReader
addAllSiblings, addSiblings, collectScaleOffset, createImageCoverage, createImageCoverage, createImageCoverage, createImageCoverage, decimationOnReadingControl, finalize, getCoordinateReferenceSystem, getDatasetLayout, getDatasetLayout, getDynamicParameters, getDynamicParameters, getFiles, getGroundControlPoints, getGroundControlPoints, getHighestRes, getImageLayout, getImageLayout, getInfo, getInfo, getMetadataNames, getMetadataNames, getMetadataValue, getMetadataValue, getMultiLevelROIProvider, getOriginalEnvelope, getOriginalGridRange, getOriginalGridToWorld, getOriginalGridToWorld, getOverviewGridEnvelope, getOverviewGridEnvelope, getPamDataset, getPamDataset, getReadingResolutions, getReadingResolutions, getRescaledRasterToModel, getResolution, getResolutionLevels, getResolutionLevels, getSibling, getSource, getSourceAsFile, setlayout, setLayout, setReadParams, setReadParams
-
-
-
-
Field Detail
-
DEFAULT_TILE_SIZE
protected static final int DEFAULT_TILE_SIZE
- See Also:
- Constant Field Values
-
ZOOM_LEVEL_BASE
protected static final int ZOOM_LEVEL_BASE
- See Also:
- Constant Field Values
-
sourceFile
protected File sourceFile
-
-
Constructor Detail
-
GeoPackageReader
public GeoPackageReader(Object source, Hints hints) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getFormat
public Format getFormat()
Description copied from interface:GridCoverageReader
Returns the format handled by thisGridCoverageReader
.
-
checkName
protected boolean checkName(String coverageName)
Description copied from class:AbstractGridCoverage2DReader
This method is responsible for checking the provided coverage name against the coverage name for thisGridCoverage2DReader
.- Overrides:
checkName
in classAbstractGridCoverage2DReader
- Parameters:
coverageName
- the coverage name to check.- Returns:
true
if thisGridCoverage2DReader
contains the provided coverage name,false
otherwise.
-
getOriginalEnvelope
public GeneralBounds getOriginalEnvelope(String coverageName)
Description copied from class:AbstractGridCoverage2DReader
Retrieves theGeneralBounds
for thisAbstractGridCoverage2DReader
.- Specified by:
getOriginalEnvelope
in interfaceGridCoverage2DReader
- Overrides:
getOriginalEnvelope
in classAbstractGridCoverage2DReader
- Parameters:
coverageName
- the name of the coverage to work on.- Returns:
- the
GeneralBounds
for thisAbstractGridCoverage2DReader
.
-
getHighestRes
protected double[] getHighestRes(String coverageName)
- Overrides:
getHighestRes
in classAbstractGridCoverage2DReader
-
getOriginalGridRange
public GridEnvelope getOriginalGridRange(String coverageName)
Description copied from class:AbstractGridCoverage2DReader
Retrieves theGeneralGridEnvelope
that represents the raster grid dimensions of the highest resolution level in this dataset.- Specified by:
getOriginalGridRange
in interfaceGridCoverage2DReader
- Overrides:
getOriginalGridRange
in classAbstractGridCoverage2DReader
- Parameters:
coverageName
- the name of the coverage to work with- Returns:
- the
GeneralGridEnvelope
that represents the raster grid dimensions of the highest resolution level in this dataset.
-
getCoordinateReferenceSystem
public CoordinateReferenceSystem getCoordinateReferenceSystem(String coverageName)
Description copied from class:AbstractGridCoverage2DReader
Retrieves theGeneralBounds
for thisAbstractGridCoverage2DReader
.- Specified by:
getCoordinateReferenceSystem
in interfaceGridCoverage2DReader
- Overrides:
getCoordinateReferenceSystem
in classAbstractGridCoverage2DReader
- Returns:
- the
GeneralBounds
for thisAbstractGridCoverage2DReader
.
-
getGridCoverageNames
public String[] getGridCoverageNames()
Description copied from interface:GridCoverageReader
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.- Specified by:
getGridCoverageNames
in interfaceGridCoverageReader
- Overrides:
getGridCoverageNames
in classAbstractGridCoverage2DReader
- Returns:
- The list of grid coverages contained within the input source.
-
getGridCoverageCount
public int getGridCoverageCount()
Description copied from interface:GridCoverageReader
Retrieve the number of coverages contained within the input source.- Specified by:
getGridCoverageCount
in interfaceGridCoverageReader
- Overrides:
getGridCoverageCount
in classAbstractGridCoverage2DReader
- Returns:
- The number of coverages contained within the input source.
- See Also:
GridCoverageReader.getGridCoverageCount()
-
read
public GridCoverage2D read(String coverageName, GeneralParameterValue[] parameters) throws IllegalArgumentException, IOException
Description copied from interface:GridCoverage2DReader
Retrieves theGridEnvelope
associated to the specified coverageName for thisGridCoverage2DReader
.- Specified by:
read
in interfaceGridCoverage2DReader
- Specified by:
read
in interfaceGridCoverageReader
- Overrides:
read
in classAbstractGridCoverage2DReader
- Parameters:
coverageName
- the name of the coverage to work withparameters
- an array ofGeneralParameterValue
that uses a subset of the available read params for thisGridCoverage2DReader
as specified by theFormat
- Returns:
- a
GridCoverage2D
for the underlying default coverage for thisGridCoverage2DReader
ornull
in case noGridCoverage2D
can be read for the provided parameters. - Throws:
IllegalArgumentException
- if the specified coverageName does not existIOException
- 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.
-
read
public GridCoverage2D read(GeneralParameterValue[] parameters) throws IllegalArgumentException, IOException
Description copied from class:AbstractGridCoverage2DReader
Read the current grid coverage from the stream.Example:
- Specified by:
read
in interfaceGridCoverage2DReader
- Specified by:
read
in interfaceGridCoverageReader
- Specified by:
read
in classAbstractGridCoverage2DReader
- Parameters:
parameters
- Optional parameters matchingFormat.getReadParameters()
.- Returns:
- a 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.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
public void dispose()
Description copied from class:AbstractGridCoverage2DReader
Disposes this reader.This method just tries to close the underlying
ImageInputStream
.- Specified by:
dispose
in interfaceGridCoverageReader
- Overrides:
dispose
in classAbstractGridCoverage2DReader
-
-