Package org.geotools.coverageio.jp2k
Class JP2KReader
Object
AbstractGridCoverage2DReader
JP2KReader
- All Implemented Interfaces:
GridCoverageReader,GridCoverage2DReader
This class can read a JP2K data source and create a
GridCoverage2D from the data.- Author:
- Daniele Romagnoli, GeoSolutions., Simone Giannecchini (simboss), GeoSolutions
-
Field Summary
Fields 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
ConstructorsConstructorDescriptionJP2KReader(Object input) Creates a new instance of aJP2KReader.JP2KReader(Object source, Hints uHints) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Releases resources held by this reader.protected GeneralBoundsprotected GridEnvelope2DReturns the format handled by thisGridCoverageReader.intNumber of coverages for this reader is 1protected double[]Package private accessor for the highest resolution values.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) Read the current grid coverage from the stream.protected voidsetCoverageEnvelope(GeneralBounds coverageEnvelope) protected voidsetCoverageGridRange(GridEnvelope2D coverageGridRange) protected voidsetCoverageProperties(ImageReader reader) Setting Envelope, GridRange and CRS from the givenImageReaderMethods inherited from class AbstractGridCoverage2DReader
addAllSiblings, addSiblings, checkName, collectScaleOffset, createImageCoverage, createImageCoverage, createImageCoverage, createImageCoverage, decimationOnReadingControl, finalize, getCoordinateReferenceSystem, getCoordinateReferenceSystem, getDatasetLayout, getDatasetLayout, getDynamicParameters, getDynamicParameters, getFiles, getGridCoverageNames, getGroundControlPoints, getGroundControlPoints, getHighestRes, getImageLayout, getImageLayout, getInfo, getInfo, getMetadataNames, getMetadataNames, getMetadataValue, getMetadataValue, getMultiLevelROIProvider, 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, getInfo, getInfo, getOriginalEnvelope, getOriginalEnvelope, getOriginalGridRange, getOriginalGridRange, getOriginalGridToWorld, getOriginalGridToWorld, getReadingResolutions, getReadingResolutions, getResolutionLevels, getResolutionLevels, readMethods inherited from interface GridCoverageReader
getGridCoverageNames, getMetadataNames, getMetadataNames, getMetadataValue, getMetadataValue, getSource
-
Constructor Details
-
JP2KReader
Creates a new instance of aJP2KReader. I assume nothing about file extension.- Parameters:
input- Source object for which we want to build an JP2KReader.- Throws:
IOException
-
JP2KReader
Constructor.- Parameters:
source- The source object.- Throws:
IOException
-
-
Method Details
-
setCoverageProperties
Setting Envelope, GridRange and CRS from the givenImageReader- Parameters:
reader- theImageReaderfrom which to retrieve metadata (if available) for setting properties- Throws:
IOException
-
setCoverageEnvelope
- Parameters:
coverageEnvelope- the envelope to set
-
getCoverageEnvelope
- Returns:
- the nativeEnvelope
-
setCoverageGridRange
- Parameters:
coverageGridRange- the coverage grid range to set
-
getCoverageGridRange
- Returns:
- the nativeGridRange
-
getGridCoverageCount
public int getGridCoverageCount()Number of coverages for this reader is 1- Specified by:
getGridCoverageCountin interfaceGridCoverageReader- Overrides:
getGridCoverageCountin classAbstractGridCoverage2DReader- Returns:
- the number of coverages for this reader.
- See Also:
-
dispose
public void dispose()Releases resources held by this reader.- Specified by:
disposein interfaceGridCoverageReader- Overrides:
disposein classAbstractGridCoverage2DReader
-
getFormat
Description copied from interface:GridCoverageReaderReturns the format handled by thisGridCoverageReader.- Specified by:
getFormatin interfaceGridCoverageReader- See Also:
-
read
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:
params- Optional parameters matchingFormat.getReadParameters().- Returns:
- a grid coverage from the input source.
- Throws:
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.- See Also:
-
getHighestRes
protected double[] getHighestRes()Package private accessor for the highest resolution values.- Overrides:
getHighestResin classAbstractGridCoverage2DReader- Returns:
- the highest resolution values.
-
parsePRJFile
Gets the coordinate reference system that will be associated to theGridCoverageby looking for a related PRJ.- Throws:
UnsupportedEncodingException
-
parseWorldFile
Checks whether a world file is associated with the data source. If found, set a proper envelope.- Throws:
IOException
-