Class AbstractGridFormat
- All Implemented Interfaces:
Format
- Direct Known Subclasses:
ArcGridFormat
,BaseGDALGridFormat
,GeoPackageFormat
,GeoTiffFormat
,GrassCoverageFormat
,ImageMosaicFormat
,ImagePyramidFormat
,JP2KFormat
,MBTilesFormat
,NetCDFFormat
,PGRasterFormat
,TPKFormat
,UnknownFormat
,WorldImageFormat
For example the ArcGridFormat has the following method which sets up all the required information:
private void setInfo(){ HashMap info=new
HashMap(); info.put("name", "ArcGrid"); info.put("description", "Arc Grid
Coverage Format"); info.put("vendor", "Geotools"); info.put("docURL",
"http://gdal.velocet.ca/projects/aigrid/index.html"); info.put("version",
"1.0"); mInfo=info; readParameters=new GeneralParameterDescriptor[2];
readParameters[0]=ArcGridOperationParameter.getGRASSReadParam();
readParameters[0]=ArcGridOperationParameter.getCompressReadParam();
writeParameters=new GeneralParameterDescriptor[2];
writeParameters[0]=ArcGridOperationParameter.getGRASSWriteParam();
writeParameters[0]=ArcGridOperationParameter.getCompressWriteParam();
}
- Author:
- jeichar, Simone Giannecchini, GeoSolutions
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParameterDescriptor<Color>
Control the background color to be used where the input was transparentstatic final DefaultParameterDescriptor<int[]>
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#read(GeneralParameterValue[])
method to specify the band indices of the input grid coverage that are going to be in the resulting coverage.static final ParameterDescriptor<DecimationPolicy>
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#read(GeneralParameterValue[])
method in order to specify the policy a reader should adopt when setting read parameters when evaluating a needed resolution.static final ParameterDescriptor<List>
Optional Elevation value for this mosaic.static final ParameterDescriptor<String>
Control the footprint management.static final DefaultParameterDescriptor<GeoToolsWriteParams>
ThisGeneralParameterValue
can be provided to theGridCoverageWriter
s through theGridCoverageWriter#write(org.geotools.api.coverage.grid.GridCoverage, GeneralParameterValue[])
method in order to control the writing process in terms of compression, tiling, etc.GridGeometry2Dstatic final ParameterDescriptor<Color>
Control the transparency of the input coverages.static final ParameterDescriptor<Interpolation>
Control the interpolation to be used in the eventual image processing done while reading dataThe Map object is used by the information methods(such as getName()) as a data source.static final DefaultParameterDescriptor<OverviewPolicy>
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#read(GeneralParameterValue[])
method in order to specify the policy a reader should adopt when choosing the right overview during a read operation.static final DefaultParameterDescriptor<ProgressListener>
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#write(GeneralParameterValue[])
method in order to monitor a writing processstatic final DefaultParameterDescriptor<GridGeometry2D>
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#read(GeneralParameterValue[])
method in order to pick up the best matching resolution level and (soon) the best matching area.protected ParameterValueGroup
ParameterValueGroup
that controls the reading process for aGridCoverageReader
through theGridCoverageReader.read(org.geotools.api.parameter.GeneralParameterValue[])
method.static final DefaultParameterDescriptor<Boolean>
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader.read(GeneralParameterValue[])
method in order to specify the whether eventual value rescaling should be performed, or the original pixel value preservedstatic final DefaultParameterDescriptor<String>
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#read(GeneralParameterValue[])
method in order to specify the suggested size of tiles to avoid long time reading occurring with JAI ImageRead on striped images.static final String
static final ParameterDescriptor<List>
Optional Time value for this mosaic.static final DefaultParameterDescriptor<Boolean>
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader.read(GeneralParameterValue[])
method in order to specify the type of image read operation requested: using a JAI ImageRead operation (leveraging on Deferred Execution Model, Tile Caching,...), or the directImageReader
's read methods.protected ParameterValueGroup
ParameterValueGroup
that controls the writing process for aGridCoverageWriter
through theGridCoverageWriter.write(org.geotools.api.coverage.grid.GridCoverage, org.geotools.api.parameter.GeneralParameterValue[])
method. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tells me if thisFormat
can read the providedinput
.abstract boolean
Tells me if thisFormat
can read the providedinput
.boolean
static CoordinateReferenceSystem
getDefaultCRSabstract GeoToolsWriteParams
Returns an instance ofImageWriteParam
that can be used to control a subsequentGridCoverageWriter.write(org.geotools.api.coverage.grid.GridCoverage, org.geotools.api.parameter.GeneralParameterValue[])
;Description of the file format.Documentation URL for the format.getName()
Name of the file format.abstract AbstractGridCoverage2DReader
Gets aGridCoverageReader
for this format able to create coverages out of thesource
object.abstract AbstractGridCoverage2DReader
Gets aGridCoverageReader
for this format able to create coverages out of thesource
object using the providedhints
.Retrieve the parameter information for aread
operation.Vendor or agency for the format.Version number of the format.Retrieve the parameter information for awrite
operation.abstract GridCoverageWriter
Retrieves aGridCoverageWriter
suitable for writing to the provideddestination
with this format.abstract GridCoverageWriter
Call the accepts() method before asking for a writer to determine if the current object is supported.
-
Field Details
-
mInfo
The Map object is used by the information methods(such as getName()) as a data source. The keys in the Map object (for the associated method) are as follows: getName() key = "name" value type=String getDescription() key = "description" value type=String getVendor() key = "vendor" value type=String getDocURL() key = "docURL" value type=String getVersion() key = "version" value type=String Naturally, any methods that are overridden need not have an entry in the Map -
readParameters
ParameterValueGroup
that controls the reading process for aGridCoverageReader
through theGridCoverageReader.read(org.geotools.api.parameter.GeneralParameterValue[])
method. -
writeParameters
ParameterValueGroup
that controls the writing process for aGridCoverageWriter
through theGridCoverageWriter.write(org.geotools.api.coverage.grid.GridCoverage, org.geotools.api.parameter.GeneralParameterValue[])
method. -
READ_GRIDGEOMETRY2D
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#read(GeneralParameterValue[])
method in order to pick up the best matching resolution level and (soon) the best matching area. -
PROGRESS_LISTENER
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#write(GeneralParameterValue[])
method in order to monitor a writing process -
GEOTOOLS_WRITE_PARAMS
ThisGeneralParameterValue
can be provided to theGridCoverageWriter
s through theGridCoverageWriter#write(org.geotools.api.coverage.grid.GridCoverage, GeneralParameterValue[])
method in order to control the writing process in terms of compression, tiling, etc.GridGeometry2D -
USE_JAI_IMAGEREAD
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader.read(GeneralParameterValue[])
method in order to specify the type of image read operation requested: using a JAI ImageRead operation (leveraging on Deferred Execution Model, Tile Caching,...), or the directImageReader
's read methods. -
OVERVIEW_POLICY
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#read(GeneralParameterValue[])
method in order to specify the policy a reader should adopt when choosing the right overview during a read operation. -
DECIMATION_POLICY
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#read(GeneralParameterValue[])
method in order to specify the policy a reader should adopt when setting read parameters when evaluating a needed resolution. -
SUGGESTED_TILE_SIZE
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#read(GeneralParameterValue[])
method in order to specify the suggested size of tiles to avoid long time reading occurring with JAI ImageRead on striped images. (Images with tiles Nx1) Value should be a String in the form of "W,H" (without quotes) where W is a number representing the suggested tileWidth and H is a number representing the suggested tileHeight. -
BANDS
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader#read(GeneralParameterValue[])
method to specify the band indices of the input grid coverage that are going to be in the resulting coverage. The order of the bands on the output coverage is the order of the indices in the parameter. Value should be an integer array (int[]) containing the band indices in the desired order. Duplicate or multiple appearances of the same band index are allowed. -
TILE_SIZE_SEPARATOR
- See Also:
-
INPUT_TRANSPARENT_COLOR
Control the transparency of the input coverages. -
BACKGROUND_COLOR
Control the background color to be used where the input was transparent -
TIME
Optional Time value for this mosaic. -
ELEVATION
Optional Elevation value for this mosaic. -
INTERPOLATION
Control the interpolation to be used in the eventual image processing done while reading data -
FOOTPRINT_BEHAVIOR
Control the footprint management. -
RESCALE_PIXELS
ThisGeneralParameterValue
can be provided to theGridCoverageReader
s through theGridCoverageReader.read(GeneralParameterValue[])
method in order to specify the whether eventual value rescaling should be performed, or the original pixel value preserved
-
-
Constructor Details
-
AbstractGridFormat
public AbstractGridFormat()
-
-
Method Details
-
getName
Description copied from interface:Format
Name of the file format. -
getDescription
Description copied from interface:Format
Description of the file format. If no description, the value will benull
.- Specified by:
getDescription
in interfaceFormat
- See Also:
-
getVendor
Description copied from interface:Format
Vendor or agency for the format. -
getDocURL
Description copied from interface:Format
Documentation URL for the format. -
getVersion
Description copied from interface:Format
Version number of the format.- Specified by:
getVersion
in interfaceFormat
- See Also:
-
getReader
Gets aGridCoverageReader
for this format able to create coverages out of thesource
object.In case this
Format
cannot reader the providedsource
objectnull
is returned.- Parameters:
source
- The source object to parse.- Returns:
- A reader for this
Format
or null.
-
getReader
Gets aGridCoverageReader
for this format able to create coverages out of thesource
object using the providedhints
.In case this
Format
cannot reader the providedsource
objectnull
is returned. -
getWriter
Retrieves aGridCoverageWriter
suitable for writing to the provideddestination
with this format.In case no writers are available
null
is returned.- Parameters:
destination
- The destinatin where to write.- Returns:
- A
GridCoverageWriter
suitable for writing to the provideddestination
with this format.
-
accepts
Tells me if thisFormat
can read the providedinput
.- Parameters:
source
- The input object to test for suitability.- Returns:
- True if this format can read this object, False otherwise.
-
accepts
Tells me if thisFormat
can read the providedinput
.- Parameters:
source
- The input object to test for suitability.hints
-Hints
to control the accepts internal machinery.- Returns:
- True if this format can read this object, False otherwise.
-
equals
- See Also:
-
org.geotools.data.coverage.grid.Format#equals(org.geotools.data.coverage.grid.Format)
-
getReadParameters
Description copied from interface:Format
Retrieve the parameter information for aread
operation.- Specified by:
getReadParameters
in interfaceFormat
-
getWriteParameters
Description copied from interface:Format
Retrieve the parameter information for awrite
operation.- Specified by:
getWriteParameters
in interfaceFormat
-
getDefaultCRS
getDefaultCRSThis method provides the user with a default crs WGS84
-
getDefaultImageIOWriteParameters
Returns an instance ofImageWriteParam
that can be used to control a subsequentGridCoverageWriter.write(org.geotools.api.coverage.grid.GridCoverage, org.geotools.api.parameter.GeneralParameterValue[])
;Be careful with using the
ImageWriteParam
since their usage is still experimental.- Returns:
- an instance of
ImageWriteParam
.
-
getWriter
Call the accepts() method before asking for a writer to determine if the current object is supported.- Parameters:
destination
- the destination object to write a WorldImage tohints
-Hints
to control the internal machinery.- Returns:
- a new WorldImageWriter for the destination
-