org.geotools.coverageio.gdal
Class BaseGDALGridFormat

Object
  extended by AbstractGridFormat
      extended by BaseGDALGridFormat
All Implemented Interfaces:
Format
Direct Known Subclasses:
AIGFormat, DTEDFormat, ECWFormat, EnviHdrFormat, ErdasImgFormat, EsriHdrFormat, IDRISIFormat, JP2ECWFormat, JP2KFormat, JP2MrSIDFormat, MrSIDFormat, NITFFormat, RPFTOCFormat

public abstract class BaseGDALGridFormat
extends AbstractGridFormat
implements Format

A Base abstract class implementing Format, to be extended by Formats leveraging on GDAL.

Author:
Daniele Romagnoli, GeoSolutions, Simone Giannecchini, GeoSolutions

Field Summary
static DefaultParameterDescriptor<Boolean> USE_MULTITHREADING
          This GeneralParameterValue can be provided to the GridCoverageReaders through the GridCoverageReader.read(GeneralParameterValue[]) method in order to specify to use multithreading when leveraging on a JAI ImageRead operation.
 
Fields inherited from class AbstractGridFormat
BACKGROUND_COLOR, DECIMATION_POLICY, ELEVATION, GEOTOOLS_WRITE_PARAMS, INPUT_TRANSPARENT_COLOR, mInfo, OVERVIEW_POLICY, PROGRESS_LISTENER, READ_GRIDGEOMETRY2D, readParameters, SUGGESTED_TILE_SIZE, TILE_SIZE_SEPARATOR, TIME, USE_JAI_IMAGEREAD, writeParameters
 
Constructor Summary
protected BaseGDALGridFormat(ImageReaderSpi spi)
          Constructor for the BaseGDALGridFormat.
 
Method Summary
 boolean accepts(Object input, Hints hints)
          Tells me if this Format can read the provided input.
 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.
protected static ParameterGroup getDefaultParameterGroup(Map<String,String> mInfo)
          Return a ParameterGroup with default General Parameter Descriptors.
 AbstractGridCoverage2DReader getReader(Object source)
          Gets a GridCoverageReader for this format able to create coverages out of the source object.
 GridCoverageWriter getWriter(Object destination)
          Retrieves a GridCoverageWriter suitable for writing to the provided destination with this format.
 GridCoverageWriter getWriter(Object destination, Hints hints)
          Call the accepts() method before asking for a writer to determine if the current object is supported.
protected abstract  void setInfo()
          Each plugin needs to implement this method defining format specific properties
 
Methods inherited from class AbstractGridFormat
accepts, equals, getDefaultCRS, getDescription, getDocURL, getName, getReader, getReadParameters, getVendor, getVersion, getWriteParameters
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Format
getDescription, getDocURL, getName, getReadParameters, getVendor, getVersion, getWriteParameters
 

Field Detail

USE_MULTITHREADING

public static final DefaultParameterDescriptor<Boolean> USE_MULTITHREADING
This GeneralParameterValue can be provided to the GridCoverageReaders through the GridCoverageReader.read(GeneralParameterValue[]) method in order to specify to use multithreading when leveraging on a JAI ImageRead operation. This will be achieved with the use of the ImageReadMT operation of the ImageIO-Ext.

Constructor Detail

BaseGDALGridFormat

protected BaseGDALGridFormat(ImageReaderSpi spi)
Constructor for the BaseGDALGridFormat. It is invoked by the underlying implementations.

Parameters:
spi - the format specific ImageReaderSpi instance
Method Detail

setInfo

protected abstract void setInfo()
Each plugin needs to implement this method defining format specific properties


getWriter

public GridCoverageWriter getWriter(Object destination)
Description copied from class: AbstractGridFormat
Retrieves a GridCoverageWriter suitable for writing to the provided destination with this format.

In case no writers are availaible null is returned.

Specified by:
getWriter in class AbstractGridFormat
Parameters:
destination - The destinatin where to write.
Returns:
A GridCoverageWriter suitable for writing to the provided destination with this format.
See Also:
Actually, the plugin does not support write capabilities. The method throws an {@code UnsupportedOperationException}.

getDefaultImageIOWriteParameters

public GeoToolsWriteParams getDefaultImageIOWriteParameters()
Description copied from class: AbstractGridFormat
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.

Specified by:
getDefaultImageIOWriteParameters in class AbstractGridFormat
Returns:
an instance of ImageWriteParam.
See Also:
Actually, the plugin does not support write capabilities. The method throws an {@code UnsupportedOperationException}.

getWriter

public GridCoverageWriter getWriter(Object destination,
                                    Hints hints)
Description copied from class: AbstractGridFormat
Call the accepts() method before asking for a writer to determine if the current object is supported.

Specified by:
getWriter in class AbstractGridFormat
Parameters:
destination - the destination object to write a WorldImage to
hints - Hints to control the internal machinery.
Returns:
a new WorldImageWriter for the destination
See Also:
Actually, the plugin does not support write capabilities. The method throws an {@code UnsupportedOperationException}.

accepts

public boolean accepts(Object input,
                       Hints hints)
Description copied from class: AbstractGridFormat
Tells me if this Format can read the provided input.

Specified by:
accepts in class AbstractGridFormat
hints - Hints to control the accepts internal machinery.
Returns:
True if this format can read this object, False otherwise.
See Also:
org.geotools.data.coverage.grid.AbstractGridFormat#accepts(java.lang.Object input)

getDefaultParameterGroup

protected static ParameterGroup getDefaultParameterGroup(Map<String,String> mInfo)
Return a ParameterGroup with default General Parameter Descriptors.

Parameters:
mInfo - Set of properties info
Returns:
a ParameterGroup with Default GeneralParameterDescriptors.

getReader

public AbstractGridCoverage2DReader getReader(Object source)
Description copied from class: AbstractGridFormat
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.

Specified by:
getReader in class AbstractGridFormat
Parameters:
source - The source object to parse.
Returns:
A reader for this Format or null.
See Also:
org.geotools.data.coverage.grid.AbstractGridFormat#getReader(Object source)


Copyright © 1996-2014 Geotools. All Rights Reserved.