org.geotools.coverage.grid.io
Class AbstractGridFormat

Object
  extended by AbstractGridFormat
All Implemented Interfaces:
Format
Direct Known Subclasses:
ArcGridFormat, ArcSDERasterFormat, BaseGDALGridFormat, GeoTiffFormat, GTopo30Format, ImageMosaicFormat, ImageMosaicJDBCFormat, ImagePyramidFormat, UnknownFormat, WorldImageFormat

public abstract class AbstractGridFormat
extends Object
implements Format

AbstractGridFormat is a convenience class so subclasses only need to populate a Map class and set the read and write parameter fields. 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
Module:

Field Summary
static DefaultParameterDescriptor<GeoToolsWriteParams> GEOTOOLS_WRITE_PARAMS
          This GeneralParameterValue cacn be provided to the GridCoverageWriters through the GridCoverageWriter.write(org.opengis.coverage.grid.GridCoverage, GeneralParameterValue[]) method in order to control the writing process in terms of compression, tiling, etc.GridGeometry2D
protected  Map<String,String> mInfo
          The Map object is used by the information methods(such as getName()) as a data source.
static DefaultParameterDescriptor<OverviewPolicy> OVERVIEW_POLICY
          This GeneralParameterValue can be provided to the GridCoverageReaders through the GridCoverageReader.read(GeneralParameterValue[]) method in order to specify the policy a reader should adopt when chhosing the right overview during a read operation.
static DefaultParameterDescriptor<GridGeometry2D> READ_GRIDGEOMETRY2D
          This GeneralParameterValue cacn be provided to the GridCoverageReaders through the GridCoverageReader.read(GeneralParameterValue[]) methid in order to pick up the best matching resolution level and (soon) the best matching area.
protected  ParameterValueGroup readParameters
          ParameterValueGroup that controls the reading process for a GridCoverageReader through the GridCoverageReader.read(org.opengis.parameter.GeneralParameterValue[]) method.
static DefaultParameterDescriptor<Boolean> USE_JAI_IMAGEREAD
          This GeneralParameterValue can be provided to the GridCoverageReaders through the GridCoverageReader.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 direct ImageReader's read methods.
protected  ParameterValueGroup writeParameters
          ParameterValueGroup that controls the writing process for a GridCoverageWriter through the GridCoverageWriter.write(org.opengis.coverage.grid.GridCoverage, org.opengis.parameter.GeneralParameterValue[]) method.
 
Constructor Summary
AbstractGridFormat()
           
 
Method Summary
abstract  boolean accepts(Object input)
          Tells me if this Format can read the provided input.
 boolean equals(Format f)
           
static CoordinateReferenceSystem getDefaultCRS()
          getDefaultCRS This method provides the user with a default crs WGS84
abstract  GeoToolsWriteParams getDefaultImageIOWriteParameters()
          Returns an instance of ImageWriteParam that can be used to control a subsequent GridCoverageWriter.write(org.opengis.coverage.grid.GridCoverage, org.opengis.parameter.GeneralParameterValue[]); Be careful with using the ImageWriteParam since their usage is still experimental.
 String getDescription()
           
 String getDocURL()
           
 String getName()
           
abstract  AbstractGridCoverage2DReader getReader(Object source)
          Gets a GridCoverageReader for this format able to create coverages out of the source object.
abstract  AbstractGridCoverage2DReader getReader(Object source, Hints hints)
          Gets a GridCoverageReader for this format able to create coverages out of the source object using the provided hints.
 ParameterValueGroup getReadParameters()
           
 String getVendor()
           
 String getVersion()
           
 ParameterValueGroup getWriteParameters()
           
abstract  GridCoverageWriter getWriter(Object destination)
          Retrieves a GridCoverageWriter suitable for writing to the provided destination with this format.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mInfo

protected Map<String,String> 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

protected ParameterValueGroup readParameters
ParameterValueGroup that controls the reading process for a GridCoverageReader through the GridCoverageReader.read(org.opengis.parameter.GeneralParameterValue[]) method.


writeParameters

protected ParameterValueGroup writeParameters
ParameterValueGroup that controls the writing process for a GridCoverageWriter through the GridCoverageWriter.write(org.opengis.coverage.grid.GridCoverage, org.opengis.parameter.GeneralParameterValue[]) method.


READ_GRIDGEOMETRY2D

public static final DefaultParameterDescriptor<GridGeometry2D> READ_GRIDGEOMETRY2D
This GeneralParameterValue cacn be provided to the GridCoverageReaders through the GridCoverageReader.read(GeneralParameterValue[]) methid in order to pick up the best matching resolution level and (soon) the best matching area.


GEOTOOLS_WRITE_PARAMS

public static final DefaultParameterDescriptor<GeoToolsWriteParams> GEOTOOLS_WRITE_PARAMS
This GeneralParameterValue cacn be provided to the GridCoverageWriters through the GridCoverageWriter.write(org.opengis.coverage.grid.GridCoverage, GeneralParameterValue[]) method in order to control the writing process in terms of compression, tiling, etc.GridGeometry2D


USE_JAI_IMAGEREAD

public static final DefaultParameterDescriptor<Boolean> USE_JAI_IMAGEREAD
This GeneralParameterValue can be provided to the GridCoverageReaders through the GridCoverageReader.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 direct ImageReader's read methods.


OVERVIEW_POLICY

public static final DefaultParameterDescriptor<OverviewPolicy> OVERVIEW_POLICY
This GeneralParameterValue can be provided to the GridCoverageReaders through the GridCoverageReader.read(GeneralParameterValue[]) method in order to specify the policy a reader should adopt when chhosing the right overview during a read operation.

Constructor Detail

AbstractGridFormat

public AbstractGridFormat()
Method Detail

getName

public String getName()
Specified by:
getName in interface Format
See Also:
Format.getName()

getDescription

public String getDescription()
Specified by:
getDescription in interface Format
See Also:
Format.getDescription()

getVendor

public String getVendor()
Specified by:
getVendor in interface Format
See Also:
Format.getVendor()

getDocURL

public String getDocURL()
Specified by:
getDocURL in interface Format
See Also:
Format.getDocURL()

getVersion

public String getVersion()
Specified by:
getVersion in interface Format
See Also:
Format.getVersion()

getReader

public abstract AbstractGridCoverage2DReader getReader(Object source)
Gets a GridCoverageReader for this format able to create coverages out of the source object.

In case this Format cannot reader the provided source object null is returned.

Parameters:
source - The source object to parse.
Returns:
A reader for this Format or null.

getReader

public abstract AbstractGridCoverage2DReader getReader(Object source,
                                                       Hints hints)
Gets a GridCoverageReader for this format able to create coverages out of the source object using the provided hints.

In case this Format cannot reader the provided source object null is returned.

Parameters:
source - The source object to parse. *
hints - The Hints to use when trying to instantiate this reader.
Returns:
A reader for this Format or null.

getWriter

public abstract GridCoverageWriter getWriter(Object destination)
Retrieves a GridCoverageWriter suitable for writing to the provided destination with this format.

In case no writers are availaible null is returned.

Parameters:
destination - The destinatin where to write.
Returns:
A GridCoverageWriter suitable for writing to the provided destination with this format.

accepts

public abstract boolean accepts(Object input)
Tells me if this Format can read the provided input.

Parameters:
input - The input object to test for suitablilty.
Returns:
True if this format can read this object, False otherwise.

equals

public boolean equals(Format f)
See Also:
org.geotools.data.coverage.grid.Format#equals(org.geotools.data.coverage.grid.Format)

getReadParameters

public ParameterValueGroup getReadParameters()
Specified by:
getReadParameters in interface Format

getWriteParameters

public ParameterValueGroup getWriteParameters()
Specified by:
getWriteParameters in interface Format

getDefaultCRS

public static CoordinateReferenceSystem getDefaultCRS()
getDefaultCRS This method provides the user with a default crs WGS84


getDefaultImageIOWriteParameters

public abstract GeoToolsWriteParams getDefaultImageIOWriteParameters()
Returns an instance of ImageWriteParam that can be used to control a subsequent GridCoverageWriter.write(org.opengis.coverage.grid.GridCoverage, org.opengis.parameter.GeneralParameterValue[]);

Be careful with using the ImageWriteParam since their usage is still experimental.

Returns:
an instance of ImageWriteParam.


Copyright © 1996-2009 Geotools. All Rights Reserved.