public class GrassCoverageReader extends AbstractGridCoverage2DReader implements GridCoverage2DReader
The class reads a GRASS raster map from a GRASS workspace (see package documentation for further info). The reading is really done via Imageio extended classes.
GrassBinaryImageReader
,
GrassBinaryRasterReadHandler
closeMe, coverageFactory, coverageName, crs, dtLayout, EPS, gzipped, highestRes, hints, inStream, inStreamSPI, numOverviews, originalEnvelope, originalGridRange, overViewResolutions, raster2Model, source
ELEVATION_DOMAIN, ELEVATION_DOMAIN_MAXIMUM, ELEVATION_DOMAIN_MINIMUM, ELEVATION_DOMAIN_RESOLUTION, FILE_SOURCE_PROPERTY, HAS_ELEVATION_DOMAIN, HAS_TIME_DOMAIN, MULTICRS_READER, REPROJECTING_READER, SOURCE_URL_PROPERTY, TIME_DOMAIN, TIME_DOMAIN_MAXIMUM, TIME_DOMAIN_MINIMUM, TIME_DOMAIN_RESOLUTION
Constructor and Description |
---|
GrassCoverageReader(Object input)
Sets the input source to use to the given
file object . |
Modifier and Type | Method and Description |
---|---|
String |
getCategoriesString()
Getter for the categories string.
|
Format |
getFormat()
Returns the format handled by this
GridCoverageReader . |
String |
getLegendString()
Getter for the legend string.
|
double[] |
getRange()
Gets the range.
|
GridCoverage2D |
read(GeneralParameterValue[] params)
Read the current grid coverage from the stream.
|
GridCoverage2D |
readRaster(JGrassRegion region)
Performs the reading of the coverage.
|
void |
setParams(PixelInCell cellAnchor,
Interpolation interpolation,
boolean useSubSamplingAsColsRows,
boolean castDoubleToFloating,
ProgressListener monitor)
Constructor for the
GrassCoverageReader . |
addAllSiblings, addSiblings, checkName, createImageCoverage, createImageCoverage, createImageCoverage, createImageCoverage, decimationOnReadingControl, dispose, finalize, getCoordinateReferenceSystem, getCoordinateReferenceSystem, getCrs, getCurrentSubname, getDatasetLayout, getDatasetLayout, getDynamicParameters, getDynamicParameters, getFiles, getGridCoverageCount, getGridCoverageNames, getGroundControlPoints, getGroundControlPoints, getHighestRes, getImageLayout, getImageLayout, getInfo, getInfo, getMetadataNames, getMetadataNames, getMetadataValue, getMetadataValue, getMultiLevelROIProvider, getNumOverviews, getNumOverviews, getOriginalEnvelope, getOriginalEnvelope, getOriginalGridRange, getOriginalGridRange, getOriginalGridToWorld, getOriginalGridToWorld, getOverviewGridEnvelope, getOverviewGridEnvelope, getReadingResolutions, getReadingResolutions, getRescaledRasterToModel, getResolution, getResolutionLevels, getResolutionLevels, getSibling, getSource, getSourceAsFile, hasMoreGridCoverages, listSubNames, read, setlayout, setLayout, setReadParams, setReadParams, skip
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCoordinateReferenceSystem, getCoordinateReferenceSystem, getDatasetLayout, getDatasetLayout, getDynamicParameters, getDynamicParameters, getImageLayout, getImageLayout, getInfo, getInfo, getNumOverviews, getNumOverviews, getOriginalEnvelope, getOriginalEnvelope, getOriginalGridRange, getOriginalGridRange, getOriginalGridToWorld, getOriginalGridToWorld, getReadingResolutions, getReadingResolutions, getResolutionLevels, getResolutionLevels, read
dispose, getCurrentSubname, getGridCoverageCount, getGridCoverageNames, getMetadataNames, getMetadataNames, getMetadataValue, getMetadataValue, getSource, hasMoreGridCoverages, listSubNames, skip
public GrassCoverageReader(Object input)
file object
.
The input source must be set before any of the query or read methods are used.
input
- the File
to use for future decoding.public void setParams(PixelInCell cellAnchor, Interpolation interpolation, boolean useSubSamplingAsColsRows, boolean castDoubleToFloating, ProgressListener monitor)
GrassCoverageReader
.cellAnchor
- the object defining whether to assume the pixel value to be read in the
grid's cell corner or center.interpolation
- the type of interpolation to be used in the case some scaling or padding
has to be done.useSubSamplingAsColsRows
- 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.monitor
- a monitor
for logging purposes. This can be null,
in which case a dummy one will be used.public GridCoverage2D readRaster(JGrassRegion region) throws IOException
This method read the grass file with a special image I/O class. If the image support the tiling read the data with a special operation which are written for this case. The step are:
region
- the region
to read. If null, the map is read in its
original boundary and resolution.read coverage
.IOException
public String getLegendString()
public String getCategoriesString()
public double[] getRange()
Note that the range is available only if the raster was read once.
public GridCoverage2D read(GeneralParameterValue[] params) throws IllegalArgumentException, IOException
AbstractGridCoverage2DReader
Example:
The method AbstractGridCoverage2DReader.hasMoreGridCoverages()
should be invoked first in order to verify that a
coverage is available.read
in interface GridCoverage2DReader
read
in interface GridCoverageReader
read
in class AbstractGridCoverage2DReader
params
- Optional parameters matching Format.getReadParameters()
.InvalidParameterNameException
- if a parameter in parameters
doesn't have a
recognized name.InvalidParameterValueException
- if a parameter in parameters
doesn't have a
valid value.ParameterNotFoundException
- if a parameter was required for the operation but was not
provided in the parameters
list.IOException
- if a read operation failed for some other input/output reason, including
FileNotFoundException
if no file with the given name
can be found, or
IIOException
if an error was thrown by the underlying image
library.IllegalArgumentException
public Format getFormat()
GridCoverageReader
GridCoverageReader
.getFormat
in interface GridCoverageReader
Copyright © 1996–2019 Geotools. All rights reserved.