org.geotools.coverage.processing
Class DefaultProcessor

java.lang.Object
  extended byorg.geotools.coverage.processing.AbstractProcessor
      extended byorg.geotools.coverage.processing.DefaultProcessor
Direct Known Subclasses:
AbstractGridCoverageProcessor

public class DefaultProcessor
extends AbstractProcessor

Default implementation of a coverage processor. This default implementation makes the following assumptions:

Note: This implementation do not caches produced coverages. Since coverages may be big, consider wrapping instances in BufferedProcessor.

Since:
2.2
Version:
$Id: DefaultProcessor.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux

Field Summary
 
Fields inherited from class org.geotools.coverage.processing.AbstractProcessor
LOGGER, OPERATION
 
Constructor Summary
DefaultProcessor(java.awt.RenderingHints hints)
          Constructs a default coverage processor.
 
Method Summary
protected  void addOperation(org.opengis.coverage.processing.Operation operation)
          Add the specified operation to this processor.
 org.opengis.coverage.Coverage doOperation(org.opengis.parameter.ParameterValueGroup parameters)
          Applies a process operation to a coverage.
 org.opengis.coverage.processing.Operation getOperation(java.lang.String name)
          Returns the operation for the specified name.
 java.util.Collection getOperations()
          Retrieves grid processing operations information.
 java.lang.Object getRenderingHint(java.awt.RenderingHints.Key key)
          Returns a rendering hint.
 void scanForPlugins()
          Scans for factory plug-ins on the application class path.
 
Methods inherited from class org.geotools.coverage.processing.AbstractProcessor
getInstance, getLocale, listOperations, main, printOperations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProcessor

public DefaultProcessor(java.awt.RenderingHints hints)
Constructs a default coverage processor. The scanForPlugins() method will be automatically invoked the first time an operation is required. Additional operations can be added by subclasses with the addOperation(org.opengis.coverage.processing.Operation) method. Rendering hints will be initialized with the following hints:

Parameters:
hints - A set of additional rendering hints, or if none.
Method Detail

addOperation

protected void addOperation(org.opengis.coverage.processing.Operation operation)
                     throws java.lang.IllegalStateException
Add the specified operation to this processor. This method is usually invoked at construction time before this processor is made accessible.

Parameters:
operation - The operation to add.
Throws:
java.lang.IllegalStateException - if an operation already exists with the same name.

getOperations

public java.util.Collection getOperations()
Retrieves grid processing operations information. Each operation information contains the name of the operation as well as a list of its parameters.

Specified by:
getOperations in class AbstractProcessor

getOperation

public org.opengis.coverage.processing.Operation getOperation(java.lang.String name)
                                                       throws org.opengis.coverage.processing.OperationNotFoundException
Returns the operation for the specified name.

Specified by:
getOperation in class AbstractProcessor
Parameters:
name - Name of the operation (case insensitive).
Returns:
The operation for the given name.
Throws:
org.opengis.coverage.processing.OperationNotFoundException - if there is no operation for the specified name.

getRenderingHint

public final java.lang.Object getRenderingHint(java.awt.RenderingHints.Key key)
Returns a rendering hint.

Parameters:
key - The hint key (e.g. Hints.JAI_INSTANCE).
Returns:
The hint value for the specified key, or if there is no hint for the specified key.

doOperation

public org.opengis.coverage.Coverage doOperation(org.opengis.parameter.ParameterValueGroup parameters)
                                          throws org.opengis.coverage.processing.OperationNotFoundException
Applies a process operation to a coverage. The default implementation checks if source coverages use an interpolation, and then invokes AbstractOperation.doOperation(org.opengis.parameter.ParameterValueGroup, org.geotools.factory.Hints). If all source coverages used the same interpolation, then this interpolation is applied to the resulting coverage (except if the resulting coverage has already an interpolation).

Specified by:
doOperation in class AbstractProcessor
Parameters:
parameters - Parameters required for the operation. The easiest way to construct them is to invoke operation.getParameters() and to modify the returned group.
Returns:
The result as a coverage.
Throws:
org.opengis.coverage.processing.OperationNotFoundException - if there is no operation for the parameter group name.

scanForPlugins

public void scanForPlugins()
Scans for factory plug-ins on the application class path. This method is needed because the application class path can theoretically change, or additional plug-ins may become available. Rather than re-scanning the classpath on every invocation of the API, the class path is scanned automatically only on the first invocation. Clients can call this method to prompt a re-scan. Thus this method need only be invoked by sophisticated applications which dynamically make new plug-ins available at runtime.



Copyright © GeoTools. All Rights Reserved.