Package org.geotools.coverageio
Class BaseGridCoverage2DReader
Object
AbstractGridCoverage2DReader
BaseGridCoverage2DReader
- All Implemented Interfaces:
GridCoverageReader,GridCoverage2DReader
- Direct Known Subclasses:
BaseGDALGridCoverage2DReader
public abstract class BaseGridCoverage2DReader
extends AbstractGridCoverage2DReader
implements GridCoverage2DReader
Base class for GridCoverage data access
- Author:
- Daniele Romagnoli, GeoSolutions, Simone Giannecchini, GeoSolutions
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MultiLevelROIThis reader is made of a single file so the MultiLevelROI is uniqueprotected Doubleprotected ResourceInfoFields inherited from class AbstractGridCoverage2DReader
closeMe, coverageFactory, coverageName, crs, dtLayout, EPS, gzipped, highestRes, hints, inStream, inStreamSPI, numOverviews, offsets, originalEnvelope, originalGridRange, overViewResolutions, raster2Model, scales, sourceFields 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
ConstructorsModifierConstructorDescriptionprotectedBaseGridCoverage2DReader(Object input, Hints hints, String worldFileExtension, ImageReaderSpi formatSpecificSpi) Creates a new instance of aBaseGridCoverage2DReader. -
Method Summary
Modifier and TypeMethodDescriptionintRetrieve the number of coverages contained within the input source.protected double[]Package scope highest resolution serviceInfo accessorgetInfo()Information about this source.Information about the named gridcoverage.protected Fileprotected MultiLevelROIprotected MultiLevelROIProvidergetMultiLevelROIProvider(String coverageName) protected voidGets the coordinate reference system that will be associated to theGridCoverageby looking for a related PRJ.protected voidChecks whether a world file is associated with the data source.read(GeneralParameterValue... params) Returns aGridCoveragefrom this reader in compliance with the specified parameters.protected abstract voidsetCoverageProperties(ImageReader reader) Implement this method to setup the coverage properties (Envelope, CRS, GridRange) using the providedImageReaderMethods inherited from class AbstractGridCoverage2DReader
addAllSiblings, addSiblings, checkName, collectScaleOffset, createImageCoverage, createImageCoverage, createImageCoverage, createImageCoverage, decimationOnReadingControl, dispose, finalize, getCoordinateReferenceSystem, getCoordinateReferenceSystem, getDatasetLayout, getDatasetLayout, getDynamicParameters, getDynamicParameters, getFiles, getGridCoverageNames, getGroundControlPoints, getGroundControlPoints, getHighestRes, getImageLayout, getImageLayout, getMetadataNames, getMetadataNames, getMetadataValue, getMetadataValue, getOriginalEnvelope, getOriginalEnvelope, getOriginalGridRange, getOriginalGridRange, getOriginalGridToWorld, getOriginalGridToWorld, getOverviewGridEnvelope, getOverviewGridEnvelope, getPamDataset, getPamDataset, getReadingResolutions, getReadingResolutions, getRescaledRasterToModel, getResolution, getResolutionLevels, getResolutionLevels, getSibling, getSource, getSourceAsFile, read, setlayout, setLayout, setReadParams, setReadParamsMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GridCoverage2DReader
getCoordinateReferenceSystem, getCoordinateReferenceSystem, getDatasetLayout, getDatasetLayout, getDynamicParameters, getDynamicParameters, getImageLayout, getImageLayout, getOriginalEnvelope, getOriginalEnvelope, getOriginalGridRange, getOriginalGridRange, getOriginalGridToWorld, getOriginalGridToWorld, getReadingResolutions, getReadingResolutions, getResolutionLevels, getResolutionLevels, readMethods inherited from interface GridCoverageReader
dispose, getFormat, getGridCoverageNames, getMetadataNames, getMetadataNames, getMetadataValue, getMetadataValue, getSource
-
Field Details
-
multiLevelRoi
This reader is made of a single file so the MultiLevelROI is unique -
resourceInfo
-
nodata
-
-
Constructor Details
-
BaseGridCoverage2DReader
protected BaseGridCoverage2DReader(Object input, Hints hints, String worldFileExtension, ImageReaderSpi formatSpecificSpi) throws DataSourceException Creates a new instance of aBaseGridCoverage2DReader. I assume nothing about file extension.- Parameters:
input- Source object for which we want to build aBaseGridCoverage2DReader.hints- Hints to be used by this reader throughout his life.worldFileExtension- the specific world file extension of the underlying formatformatSpecificSpi- an instance of a properImageReaderSpi.- Throws:
DataSourceException
-
-
Method Details
-
setCoverageProperties
Implement this method to setup the coverage properties (Envelope, CRS, GridRange) using the providedImageReader- Throws:
IOException
-
getMultiLevelROIProvider
- Overrides:
getMultiLevelROIProviderin classAbstractGridCoverage2DReader
-
getHighestRes
protected double[] getHighestRes()Package scope highest resolution serviceInfo accessor- Overrides:
getHighestResin classAbstractGridCoverage2DReader
-
read
public GridCoverage2D read(GeneralParameterValue... params) throws IllegalArgumentException, IOException Returns aGridCoveragefrom this reader in compliance with the specified parameters.- Specified by:
readin interfaceGridCoverage2DReader- Specified by:
readin interfaceGridCoverageReader- Specified by:
readin classAbstractGridCoverage2DReader- Parameters:
params- aGeneralParameterValuearray to customize the read operation.- 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
-
parsePRJFile
protected void parsePRJFile()Gets the coordinate reference system that will be associated to theGridCoverageby looking for a related PRJ. -
parseWorldFile
protected void parseWorldFile()Checks whether a world file is associated with the data source. If found, set a proper envelope. -
getInfo
Information about this source. Subclasses should provide additional format specific information.- Specified by:
getInfoin interfaceGridCoverage2DReader- Overrides:
getInfoin classAbstractGridCoverage2DReader- Returns:
- ServiceInfo describing getSource().
-
getInfo
Information about the named gridcoverage.- Specified by:
getInfoin interfaceGridCoverage2DReader- Overrides:
getInfoin classAbstractGridCoverage2DReader- Parameters:
subname- Name indicing grid coverage to describe- Returns:
- ResourceInfo describing grid coverage indicated
-
getInputFile
- Returns:
- the input file
-
getCoverageName
- Returns:
- the coverage name
-
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 gridCoverage count
- See Also:
-
getMultiLevelRoi
-
getNodata
-