public abstract class GDALImageReader extends ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales| Constructor and Description |
|---|
GDALImageReader(GDALImageReaderSpi originatingProvider)
Constructs a
GDALImageReader using a
GDALImageReaderSpi. |
GDALImageReader(GDALImageReaderSpi originatingProvider,
int numSubdatasets)
Constructs a
GDALImageReader using a
GDALImageReaderSpi. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkImageIndex(int imageIndex)
Checks if the specified ImageIndex is valid.
|
protected GDALCommonIIOImageMetadata |
createDatasetMetadata(org.gdal.gdal.Dataset mainDataset,
String mainDatasetFileName)
Build a proper
GDALCommonIIOImageMetadata given an input dataset
as well as the file name containing such a dataset. |
protected GDALCommonIIOImageMetadata |
createDatasetMetadata(String datasetName)
Build a proper
GDALCommonIIOImageMetadata given the name of a
dataset. |
void |
dispose()
Allows resources to be released
|
GDALCommonIIOImageMetadata |
getDatasetMetadata(int imageIndex)
Retrieves a
GDALCommonIIOImageMetadata by index. |
protected File |
getDatasetSource(Object myInput)
Tries to retrieve the Dataset Source for the ImageReader's input.
|
int |
getGCPCount(int imageIndex)
Returns the number of Ground Control Points of the
Dataset
at index imageIndex. |
String |
getGCPProjection(int imageIndex)
Returns the Ground Control Points projection definition string of the
Dataset at index imageIndex. |
List<? extends GCP> |
getGCPs(int imageIndex)
Returns Ground Control Points of the
Dataset at index
imageIndex. |
double[] |
getGeoTransform(int imageIndex)
Retrieves the GeoTransformation coefficients for the
Dataset
at index imageIndex. |
int |
getHeight(int imageIndex)
Returns the height of the raster of the
Dataset at index
imageIndex. |
IIOMetadata |
getImageMetadata(int imageIndex)
Returns an
IIOMetadata object containing metadata
associated with the given image, specified by the imageIndex
parameter |
Iterator<ImageTypeSpecifier> |
getImageTypes(int imageIndex)
Returns an
Iterator containing possible image types to
which the given image may be decoded, in the form of
ImageTypeSpecifierss. |
double |
getMaximum(int imageIndex,
int band)
Returns the optional Maximum Value of the specified band of the
Dataset at index imageIndex. |
double |
getMinimum(int imageIndex,
int band)
Returns the optional Minimum Value of the specified band of the
Dataset at index imageIndex. |
double |
getNoDataValue(int imageIndex,
int band)
Returns the NoDataValue of the specified Band of the specified image
|
int |
getNumImages(boolean allowSearch)
Returns the number of images (subdatasets) contained within the data
source.
|
double |
getOffset(int imageIndex,
int band)
Returns the optional Offset Value of the specified band of the
Dataset at index imageIndex. |
String |
getProjection(int imageIndex)
Retrieves the WKT projection
String for the
Dataset at index imageIndex. |
double |
getScale(int imageIndex,
int band)
Returns the optional Scale Value of the specified band of the
Dataset at index imageIndex. |
IIOMetadata |
getStreamMetadata()
Returns an
IIOMetadata object representing the metadata
associated with the input source as a whole. |
int |
getTileHeight(int imageIndex)
Returns the tile height of the raster of the
Dataset at
index imageIndex. |
int |
getTileWidth(int imageIndex)
Returns the tile width of the raster of the
Dataset at
index imageIndex. |
int |
getWidth(int imageIndex)
Returns the width of the raster of the
Dataset at index
imageIndex. |
BufferedImage |
read(int imageIndex)
Performs a full read operation.
|
BufferedImage |
read(int imageIndex,
ImageReadParam param)
Read the raster and returns a
BufferedImage |
Raster |
readRaster(int imageIndex,
ImageReadParam param)
Implements the
ImageRead.readRaster method which returns a
new Raster object containing the raw pixel data from the
image stream, without any color conversion applied. |
void |
reset()
Reset main values
|
void |
setInput(Object input,
boolean seekForwardOnly,
boolean ignoreMetadata)
Sets the input for the specialized reader.
|
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, getAspectRatio, getAvailableLocales, getDefaultReadParam, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, setInput, setInput, setLocalepublic GDALImageReader(GDALImageReaderSpi originatingProvider)
GDALImageReader using a
GDALImageReaderSpi.originatingProvider - The GDALImageReaderSpi to use for building this
GDALImageReader.public GDALImageReader(GDALImageReaderSpi originatingProvider, int numSubdatasets)
GDALImageReader using a
GDALImageReaderSpi.originatingProvider - The GDALImageReaderSpi to use for building this
GDALImageReader.public GDALCommonIIOImageMetadata getDatasetMetadata(int imageIndex)
GDALCommonIIOImageMetadata by index.imageIndex - is the index of the required
GDALCommonIIOImageMetadata.GDALCommonIIOImageMetadataprotected void checkImageIndex(int imageIndex)
imageIndex - the specified imageIndexprotected GDALCommonIIOImageMetadata createDatasetMetadata(String datasetName)
GDALCommonIIOImageMetadata given the name of a
dataset. The default implementation return a
GDALCommonIIOImageMetadata instance.This method should be
overridden by the specialized GDALImageReader in case you need to
obtain a specific GDALCommonIIOImageMetadata's subclassdatasetName - the name of the datasetprotected GDALCommonIIOImageMetadata createDatasetMetadata(org.gdal.gdal.Dataset mainDataset, String mainDatasetFileName)
GDALCommonIIOImageMetadata given an input dataset
as well as the file name containing such a dataset.protected File getDatasetSource(Object myInput)
public void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)
setInput in class ImageReaderIllegalArgumentException - if the provided input is nullpublic void dispose()
dispose in class ImageReaderpublic void reset()
reset in class ImageReaderpublic Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IOException
Iterator containing possible image types to
which the given image may be decoded, in the form of
ImageTypeSpecifierss. At least one legal image type will
be returned. This implementation simply returns an
ImageTypeSpecifier set in compliance with the property of
the dataset contained within the underlying data source.getImageTypes in class ImageReaderimageIndex - the index of the image to be retrieved.Iterator containing possible image types to
which the given image may be decoded, in the form of
ImageTypeSpecifierssIOExceptionpublic BufferedImage read(int imageIndex, ImageReadParam param) throws IOException
BufferedImageread in class ImageReaderimageIndex - the index of the image to be retrieved.param - an ImageReadParam used to control the
reading process, or null. Actually,
setting a destinationType allows to specify the number of
bands in the destination image.BufferedImageIllegalArgumentException - if param contains an invalid specification
of a source and/or destination band subset or of a
destination image.IOException - if an error occurs when acquiring access to the
underlying datasourcepublic Raster readRaster(int imageIndex, ImageReadParam param) throws IOException
ImageRead.readRaster method which returns a
new Raster object containing the raw pixel data from the
image stream, without any color conversion applied.readRaster in class ImageReaderimageIndex - the index of the image to be retrieved.param - an ImageReadParam used to control the
reading process, or null.Raster.IOExceptionpublic BufferedImage read(int imageIndex) throws IOException
read in class ImageReaderimageIndex - the index of the image to be retrieved.IOExceptionpublic int getNumImages(boolean allowSearch)
throws IOException
getNumImages in class ImageReaderIOExceptionpublic int getWidth(int imageIndex)
throws IOException
Dataset at index
imageIndex.getWidth in class ImageReaderimageIndex - the index of the specified rasterIOExceptionpublic int getHeight(int imageIndex)
throws IOException
Dataset at index
imageIndex.getHeight in class ImageReaderimageIndex - the index of the specified rasterIOExceptionpublic int getTileHeight(int imageIndex)
throws IOException
Dataset at
index imageIndex.getTileHeight in class ImageReaderimageIndex - the index of the specified rasterIOExceptionpublic int getTileWidth(int imageIndex)
throws IOException
Dataset at
index imageIndex.getTileWidth in class ImageReaderimageIndex - the index of the specified rasterIOExceptionpublic String getProjection(int imageIndex)
String for the
Dataset at index imageIndex.imageIndex - the index of the dataset we want to get the projections
for.String for the
Dataset at index imageIndex.public double[] getGeoTransform(int imageIndex)
Dataset
at index imageIndex.imageIndex - the index of the dataset we want to get the coefficients
for.public List<? extends GCP> getGCPs(int imageIndex)
Dataset at index
imageIndex.imageIndex - the index of the specified DatasetList containing the Ground Control Points.public String getGCPProjection(int imageIndex)
Dataset at index imageIndex.imageIndex - the index of the specified Datasetpublic int getGCPCount(int imageIndex)
Dataset
at index imageIndex.imageIndex - the index of the specified DatasetDataset.public double getNoDataValue(int imageIndex,
int band)
imageIndex - the specified imageband - the specified bandIllegalArgumentException - in case the specified band number is out of range or
noData value has not been foundpublic double getOffset(int imageIndex,
int band)
Dataset at index imageIndex.imageIndex - the index of the specified Datasetband - the specified bandIllegalArgumentException - in case the specified band number is out of range or
Offset value has not been foundpublic double getScale(int imageIndex,
int band)
Dataset at index imageIndex.imageIndex - the index of the specified Datasetband - the specified bandIllegalArgumentException - in case the specified band number is out of range or
scale value has not been foundpublic double getMinimum(int imageIndex,
int band)
Dataset at index imageIndex.imageIndex - the index of the specified Datasetband - the specified bandIllegalArgumentException - in case the specified band number is out of range or
minimum value has not been foundpublic double getMaximum(int imageIndex,
int band)
Dataset at index imageIndex.imageIndex - the index of the specified Datasetband - the specified bandIllegalArgumentException - in case the specified band number is out of range or
maximum value has not been foundpublic IIOMetadata getStreamMetadata() throws IOException
IIOMetadata object representing the metadata
associated with the input source as a whole.getStreamMetadata in class ImageReaderIIOMetadata object.IOExceptionpublic IIOMetadata getImageMetadata(int imageIndex) throws IOException
IIOMetadata object containing metadata
associated with the given image, specified by the imageIndex
parametergetImageMetadata in class ImageReaderimageIndex - the index of the required imageIIOMetadata objectIOExceptionCopyright © 2006–2019 GeoSolutions. All rights reserved.