org.geotools.geopkg.mosaic
Class GeoPackageReader

Object
  extended by AbstractGridCoverage2DReader
      extended by GeoPackageReader
All Implemented Interfaces:
GridCoverage2DReader, GridCoverageReader

public class GeoPackageReader
extends AbstractGridCoverage2DReader


Field Summary
protected  GridCoverageFactory coverageFactory
           
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, coverageName, crs, gzipped, highestRes, hints, inStream, inStreamSPI, numOverviews, originalEnvelope, originalGridRange, overViewResolutions, raster2Model, 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, TIME_DOMAIN, TIME_DOMAIN_MAXIMUM, TIME_DOMAIN_MINIMUM, TIME_DOMAIN_RESOLUTION
 
Constructor Summary
GeoPackageReader(Object source, Hints hints)
           
 
Method Summary
protected  boolean checkName(String coverageName)
          This method is responsible for checking the provided coverage name against the coverage name for this GridCoverage2DReader.
 CoordinateReferenceSystem getCoordinateReferenceSystem(String coverageName)
          Retrieves the GeneralEnvelope for this AbstractGridCoverage2DReader.
 Format getFormat()
          Returns the format handled by this GridCoverageReader.
 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)
           
 GeneralEnvelope getOriginalEnvelope(String coverageName)
          Retrieves the GeneralEnvelope for this AbstractGridCoverage2DReader.
 GridEnvelope getOriginalGridRange(String coverageName)
          Retrieves the GeneralGridEnvelope that represents the raster grid dimensions of the highest resolution level in this dataset.
protected  BufferedImage getStartImage(BufferedImage copyFrom, int width, int height)
           
protected  BufferedImage getStartImage(int width, int height)
           
protected  BufferedImage getStartImage(int imageType, int width, int height)
           
 GridCoverage2D read(GeneralParameterValue[] parameters)
          Read the current grid coverage from the stream.
 GridCoverage2D read(String coverageName, GeneralParameterValue[] parameters)
          Retrieves the GridEnvelope associated to the specified coverageName for this GridCoverage2DReader.
protected static BufferedImage readImage(byte[] data)
           
 
Methods inherited from class AbstractGridCoverage2DReader
createImageCoverage, createImageCoverage, createImageCoverage, createImageCoverage, decimationOnReadingControl, decimationOnReadingControl, dispose, finalize, getCoordinateReferenceSystem, getCrs, getCurrentSubname, getDynamicParameters, getDynamicParameters, getImageLayout, getImageLayout, getInfo, getMetadataNames, getMetadataNames, getMetadataValue, getMetadataValue, getNumOverviews, getNumOverviews, getOriginalEnvelope, getOriginalGridRange, getOriginalGridToWorld, getOriginalGridToWorld, getOverviewGridEnvelope, getOverviewGridEnvelope, getReadingResolutions, getReadingResolutions, getResolution, getResolutionLevels, getResolutionLevels, getSource, hasMoreGridCoverages, listSubNames, setlayout, setLayout, setReadParams, setReadParams, skip
 
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

coverageFactory

protected GridCoverageFactory coverageFactory

sourceFile

protected File sourceFile

tiles

protected Map<String,TileEntry> tiles
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 this GridCoverageReader.


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 this GridCoverage2DReader.

Overrides:
checkName in class AbstractGridCoverage2DReader
Parameters:
coverageName - the coverage name to check.
Returns:
true if this GridCoverage2DReader contains the provided coverage name, false otherwise.

getOriginalEnvelope

public GeneralEnvelope getOriginalEnvelope(String coverageName)
Description copied from class: AbstractGridCoverage2DReader
Retrieves the GeneralEnvelope for this AbstractGridCoverage2DReader.

Specified by:
getOriginalEnvelope in interface GridCoverage2DReader
Overrides:
getOriginalEnvelope in class AbstractGridCoverage2DReader
Parameters:
coverageName - the name of the coverage to work on.
Returns:
the GeneralEnvelope for this AbstractGridCoverage2DReader.

getHighestRes

protected double[] getHighestRes(String coverageName)
Overrides:
getHighestRes in class AbstractGridCoverage2DReader

getOriginalGridRange

public GridEnvelope getOriginalGridRange(String coverageName)
Description copied from class: AbstractGridCoverage2DReader
Retrieves the GeneralGridEnvelope that represents the raster grid dimensions of the highest resolution level in this dataset.

Specified by:
getOriginalGridRange in interface GridCoverage2DReader
Overrides:
getOriginalGridRange in class AbstractGridCoverage2DReader
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 the GeneralEnvelope for this AbstractGridCoverage2DReader.

Specified by:
getCoordinateReferenceSystem in interface GridCoverage2DReader
Overrides:
getCoordinateReferenceSystem in class AbstractGridCoverage2DReader
Returns:
the GeneralEnvelope for this AbstractGridCoverage2DReader.

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 interface GridCoverageReader
Overrides:
getGridCoverageNames in class AbstractGridCoverage2DReader
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 interface GridCoverageReader
Overrides:
getGridCoverageCount in class AbstractGridCoverage2DReader
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 the GridEnvelope associated to the specified coverageName for this GridCoverage2DReader.

Specified by:
read in interface GridCoverage2DReader
Specified by:
read in interface GridCoverageReader
Overrides:
read in class AbstractGridCoverage2DReader
Parameters:
coverageName - the name of the coverage to work with
parameters - an array of GeneralParameterValue that uses a subset of the available read params for this GridCoverage2DReader as specified by the Format
Returns:
a GridCoverage2D for the underlying default coverage for this GridCoverage2DReader or null in case no GridCoverage2D can 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 FileNotFoundException if no file with the given name can be found, or IIOException if an error was thrown by the underlying image library.

readImage

protected static BufferedImage readImage(byte[] data)
                                  throws IOException
Throws:
IOException

getStartImage

protected BufferedImage getStartImage(BufferedImage copyFrom,
                                      int width,
                                      int height)

getStartImage

protected BufferedImage getStartImage(int imageType,
                                      int width,
                                      int height)

getStartImage

protected BufferedImage getStartImage(int width,
                                      int height)

read

public GridCoverage2D read(GeneralParameterValue[] parameters)
                    throws IllegalArgumentException,
                           IOException
Description copied from class: AbstractGridCoverage2DReader
Read the current grid coverage from the stream.

Example:

 
 
 
The method AbstractGridCoverage2DReader.hasMoreGridCoverages() should be invoked first in order to verify that a coverage is available.

Specified by:
read in interface GridCoverage2DReader
Specified by:
read in interface GridCoverageReader
Specified by:
read in class AbstractGridCoverage2DReader
Parameters:
parameters - Optional parameters matching Format.getReadParameters().
Returns:
a grid coverage from the input source.
Throws:
InvalidParameterNameException - if a parameter in parameters doesn't have a recognized name.
InvalidParameterValueException - if a parameter in parameters doesn't have a valid value.
ParameterNotFoundException - if a parameter was required for the operation but was not provided in the parameters list.
IOException - if a read operation failed for some other input/output reason, including FileNotFoundException if no file with the given name can be found, or IIOException if an error was thrown by the underlying image library.
IllegalArgumentException


Copyright © 1996-2014 Geotools. All Rights Reserved.