Package org.geotools.gce.image
Class WorldImageReader
Object
AbstractGridCoverage2DReader
WorldImageReader
- All Implemented Interfaces:
GridCoverageReader,GridCoverage2DReader
public final class WorldImageReader
extends AbstractGridCoverage2DReader
implements GridCoverage2DReader
Reads a GridCoverage from a given source. WorldImage sources only support one GridCoverage so hasMoreGridCoverages()
will return true until the only GridCoverage is read. No metadata is currently supported, so all related methods
return null. In the early future we will start (hopefully supporting them).
- Author:
- simone giannecchini, alessio fabiani, rgould
-
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
ConstructorsConstructorDescriptionWorldImageReader(Object input) Class constructor.WorldImageReader(Object input, Hints hints) Class constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the file extension of the image.protected List<FileGroupProvider.FileGroup>getFiles()Returns a list of files making up the source data for this reader (as a whole).Returns the format that this Reader accepts.intNumber of coverages for this reader is 1read(GeneralParameterValue... params) Reads an image from a source stream.Methods inherited from class AbstractGridCoverage2DReader
addAllSiblings, addSiblings, checkName, collectScaleOffset, createImageCoverage, createImageCoverage, createImageCoverage, createImageCoverage, decimationOnReadingControl, dispose, finalize, getCoordinateReferenceSystem, getCoordinateReferenceSystem, getDatasetLayout, getDatasetLayout, getDynamicParameters, getDynamicParameters, getGridCoverageNames, getGroundControlPoints, getGroundControlPoints, getHighestRes, 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
dispose, getGridCoverageNames, getMetadataNames, getMetadataNames, getMetadataValue, getMetadataValue, getSource
-
Constructor Details
-
WorldImageReader
Class constructor. Construct a new ImageWorldReader to read a GridCoverage from the source object. The source must point to the raster file itself, not the world file. If the source is a Java URL it checks if it is ponting to a file and if so it converts the url into a file.- Parameters:
input- The source of a GridCoverage, can be a File, a URL or an input stream.- Throws:
DataSourceException
-
WorldImageReader
Class constructor. Construct a new ImageWorldReader to read a GridCoverage from the source object. The source must point to the raster file itself, not the world file. If the source is a Java URL it checks if it is ponting to a file and if so it converts the url into a file.- Parameters:
input- The source of a GridCoverage, can be a File, a URL or an input stream.- Throws:
DataSourceException
-
-
Method Details
-
getFormat
Returns the format that this Reader accepts.- Specified by:
getFormatin interfaceGridCoverageReader- Returns:
- a new WorldImageFormat class
-
read
public GridCoverage2D read(GeneralParameterValue... params) throws IllegalArgumentException, IOException Reads an image from a source stream. Loads an image from a source stream, then loads the values from the world file and constructs a new GridCoverage from this information. When reading from a remote stream we do not look for a world fiel but we suppose those information comes from a different way (xml, gml, pigeon?)- Specified by:
readin interfaceGridCoverage2DReader- Specified by:
readin interfaceGridCoverageReader- Specified by:
readin classAbstractGridCoverage2DReader- Parameters:
params- WorldImageReader supports no parameters, it just ignores them.- Returns:
- a new GridCoverage read from the 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
-
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:
-
getExtension
Returns the file extension of the image.- Since:
- 2.7
-
getFiles
Description copied from class:AbstractGridCoverage2DReaderReturns a list of files making up the source data for this reader (as a whole). The default implementation returns the source, if it can be made into a File object, or null otherwise.- Overrides:
getFilesin classAbstractGridCoverage2DReader
-