Package org.geotools.gce.grassraster
Class GrassBinaryImageReader
Object
ImageReader
GrassBinaryImageReader
ImageIO reader for the grass binary raster format.
The reader extends imageio's ImageReader to support the reading of GRASS raster data.
- Since:
- 3.0
- Author:
- Andrea Antonello (www.hydrologis.com)
- See Also:
-
Field Summary
FieldsFields inherited from class ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales -
Constructor Summary
ConstructorsConstructorDescriptionGrassBinaryImageReader(GrassBinaryImageReaderSpi originatingProvider) constructs anImageReaderable to read grass raster maps. -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Request to abort any current read operation.protected booleanChecks if a request to abort the current read operation has been made.voiddispose()Cleans thisGrassBinaryImageReaderup.intgetHeight(int imageIndex) getImageMetadata(int imageIndex) getImageTypes(int imageIndex) intgetNumImages(boolean allowSearch) A simple method which returns the properGrassBinaryRasterReadHandlerused to perform reading operationsintgetWidth(int imageIndex) read(int imageIndex) read(int imageIndex, ImageReadParam param) read(int imageIndex, ImageReadParam param, boolean useSubSamplingAsRequestedRowcols, boolean castDoubleToFloating, ProgressListener monitor) Performs the read method adding the possibility to override subsampling.readRaster(int imageIndex, ImageReadParam param) voidreset()Resets thisGrassBinaryImageReader.voidsetCastDoubleToFloating(boolean castDoubleToFloating) voidThis method set the input only if the input object is a File.voidsetMonitor(ProgressListener monitor) voidsetUseSubSamplingAsRequestedRowcols(boolean useSubSamplingAsRequestedRowcols) Methods inherited from class ImageReader
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, getTileHeight, getTileWidth, 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, setLocale
-
Field Details
-
ccmdl
theColorModelto be used for the read raster.
-
-
Constructor Details
-
GrassBinaryImageReader
constructs anImageReaderable to read grass raster maps.- Parameters:
originatingProvider- the service provider interface for the reader.
-
-
Method Details
-
setInput
This method set the input only if the input object is a File.- Overrides:
setInputin classImageReader
-
setUseSubSamplingAsRequestedRowcols
public void setUseSubSamplingAsRequestedRowcols(boolean useSubSamplingAsRequestedRowcols) -
setCastDoubleToFloating
public void setCastDoubleToFloating(boolean castDoubleToFloating) -
getHeight
- Specified by:
getHeightin classImageReader- Throws:
IOException
-
getWidth
- Specified by:
getWidthin classImageReader- Throws:
IOException
-
getNumImages
- Specified by:
getNumImagesin classImageReader- Throws:
IOException
-
getImageTypes
- Specified by:
getImageTypesin classImageReader- Throws:
IOException
-
getStreamMetadata
- Specified by:
getStreamMetadatain classImageReader- Throws:
IOException
-
getImageMetadata
- Specified by:
getImageMetadatain classImageReader- Throws:
IOException
-
setMonitor
-
read
public BufferedImage read(int imageIndex, ImageReadParam param, boolean useSubSamplingAsRequestedRowcols, boolean castDoubleToFloating, ProgressListener monitor) throws IOException Performs the read method adding the possibility to override subsampling.- Parameters:
imageIndex- same asread(int, ImageReadParam)param- same asread(int, ImageReadParam)useSubSamplingAsRequestedRowcols- a flag that gives the possibility to bypass the imageio subsampling mechanism. With GRASS maps this is often more performant in some boundary situations. In the case this flag is set to true, the subsampling values will be handled as the requested columns and rows.castDoubleToFloating- a flag that gives the possibility to force the reading of a map as a floating point map. This is necessary right now because of a imageio bug: https://jai-imageio-core.dev.java.net/issues/show_bug.cgi?id=180- Returns:
- same as
read(int, ImageReadParam) - Throws:
IOException- same asread(int, ImageReadParam)
-
read
- Specified by:
readin classImageReader- Throws:
IOException
-
read
- Overrides:
readin classImageReader- Throws:
IOException
-
readRaster
- Overrides:
readRasterin classImageReader- Throws:
IOException
-
getRasterReader
A simple method which returns the properGrassBinaryRasterReadHandlerused to perform reading operations- Returns:
- Returns the rasterReader.
-
dispose
public void dispose()Cleans thisGrassBinaryImageReaderup.- Overrides:
disposein classImageReader
-
reset
public void reset()Resets thisGrassBinaryImageReader.- Overrides:
resetin classImageReader
-
abort
public void abort()Request to abort any current read operation.- Overrides:
abortin classImageReader
-
abortRequested
protected boolean abortRequested()Checks if a request to abort the current read operation has been made.- Overrides:
abortRequestedin classImageReader
-