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 intDEFAULT_TILE_SIZEprotected FilesourceFileprotected Map<String,TileEntry>tilesprotected static intZOOM_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 booleancheckName(String coverageName)This method is responsible for checking the provided coverage name against the coverage name for thisGridCoverage2DReader.voiddispose()Disposes this reader.CoordinateReferenceSystemgetCoordinateReferenceSystem(String coverageName)Retrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.FormatgetFormat()Returns the format handled by thisGridCoverageReader.intgetGridCoverageCount()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)GeneralBoundsgetOriginalEnvelope(String coverageName)Retrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.GridEnvelopegetOriginalGridRange(String coverageName)Retrieves theGeneralGridEnvelopethat represents the raster grid dimensions of the highest resolution level in this dataset.GridCoverage2Dread(String coverageName, GeneralParameterValue[] parameters)Retrieves theGridEnvelopeassociated to the specified coverageName for thisGridCoverage2DReader.GridCoverage2Dread(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:GridCoverageReaderReturns the format handled by thisGridCoverageReader.
-
checkName
protected boolean checkName(String coverageName)
Description copied from class:AbstractGridCoverage2DReaderThis method is responsible for checking the provided coverage name against the coverage name for thisGridCoverage2DReader.- Overrides:
checkNamein classAbstractGridCoverage2DReader- Parameters:
coverageName- the coverage name to check.- Returns:
trueif thisGridCoverage2DReadercontains the provided coverage name,falseotherwise.
-
getOriginalEnvelope
public GeneralBounds getOriginalEnvelope(String coverageName)
Description copied from class:AbstractGridCoverage2DReaderRetrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.- Specified by:
getOriginalEnvelopein interfaceGridCoverage2DReader- Overrides:
getOriginalEnvelopein classAbstractGridCoverage2DReader- Parameters:
coverageName- the name of the coverage to work on.- Returns:
- the
GeneralBoundsfor thisAbstractGridCoverage2DReader.
-
getHighestRes
protected double[] getHighestRes(String coverageName)
- Overrides:
getHighestResin classAbstractGridCoverage2DReader
-
getOriginalGridRange
public GridEnvelope getOriginalGridRange(String coverageName)
Description copied from class:AbstractGridCoverage2DReaderRetrieves theGeneralGridEnvelopethat represents the raster grid dimensions of the highest resolution level in this dataset.- Specified by:
getOriginalGridRangein interfaceGridCoverage2DReader- Overrides:
getOriginalGridRangein classAbstractGridCoverage2DReader- 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.
-
getCoordinateReferenceSystem
public CoordinateReferenceSystem getCoordinateReferenceSystem(String coverageName)
Description copied from class:AbstractGridCoverage2DReaderRetrieves theGeneralBoundsfor thisAbstractGridCoverage2DReader.- Specified by:
getCoordinateReferenceSystemin interfaceGridCoverage2DReader- Overrides:
getCoordinateReferenceSystemin classAbstractGridCoverage2DReader- Returns:
- the
GeneralBoundsfor thisAbstractGridCoverage2DReader.
-
getGridCoverageNames
public 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 interfaceGridCoverageReader- Overrides:
getGridCoverageNamesin classAbstractGridCoverage2DReader- Returns:
- The list of grid coverages contained within the input source.
-
getGridCoverageCount
public int getGridCoverageCount()
Description copied from interface:GridCoverageReaderRetrieve the number of coverages contained within the input source.- Specified by:
getGridCoverageCountin interfaceGridCoverageReader- Overrides:
getGridCoverageCountin 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:GridCoverage2DReaderRetrieves theGridEnvelopeassociated to the specified coverageName for thisGridCoverage2DReader.- Specified by:
readin interfaceGridCoverage2DReader- Specified by:
readin interfaceGridCoverageReader- Overrides:
readin classAbstractGridCoverage2DReader- 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:
IllegalArgumentException- 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.
-
read
public GridCoverage2D read(GeneralParameterValue[] parameters) throws IllegalArgumentException, IOException
Description copied from class:AbstractGridCoverage2DReaderRead the current grid coverage from the stream.Example:
- Specified by:
readin interfaceGridCoverage2DReader- Specified by:
readin interfaceGridCoverageReader- Specified by:
readin classAbstractGridCoverage2DReader- Parameters:
parameters- Optional parameters matchingFormat.getReadParameters().- Returns:
- a grid coverage from the input source.
- Throws:
InvalidParameterNameException- if a parameter inparametersdoesn't have a recognized name.InvalidParameterValueException- if a parameter inparametersdoesn't have a valid value.ParameterNotFoundException- if a parameter was required for the operation but was not provided in theparameterslist.IOException- 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.IllegalArgumentException
-
dispose
public void dispose()
Description copied from class:AbstractGridCoverage2DReaderDisposes this reader.This method just tries to close the underlying
ImageInputStream.- Specified by:
disposein interfaceGridCoverageReader- Overrides:
disposein classAbstractGridCoverage2DReader
-
-