public class CoverageProcessor extends Object
Modifier and Type | Field and Description |
---|---|
protected Hints |
hints
The rendering hints for JAI operations (never
null ). |
static Logger |
LOGGER
The logger for coverage processing operations.
|
static Level |
OPERATION
The logging level for reporting coverage operations.
|
protected FactoryRegistry |
registry
The service registry for finding
Operation implementations. |
Constructor and Description |
---|
CoverageProcessor()
Constructs a coverage processor.
|
CoverageProcessor(RenderingHints hints)
Constructs a default coverage processor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addOperation(Operation operation)
Add the specified operation to this processor.
|
Coverage |
doOperation(ParameterValueGroup parameters)
Applies a process operation to a coverage.
|
Coverage |
doOperation(ParameterValueGroup parameters,
Hints hints)
Applies a process operation to a coverage.
|
static CoverageProcessor |
getInstance()
Returns a default processor instance.
|
static CoverageProcessor |
getInstance(Hints hints)
Returns a default processor instance.
|
Locale |
getLocale()
The locale for logging message or reporting errors.
|
Operation |
getOperation(String name)
Returns the operation for the specified name.
|
Collection<Operation> |
getOperations()
Retrieves grid processing operations information.
|
static Object |
getParameter(ParameterBlockJAI parameters,
String paramName) |
Object |
getRenderingHint(RenderingHints.Key key)
Returns a rendering hint.
|
void |
listOperations(Writer out)
Lists a summary of all operations to the specified stream.
|
static void |
main(String[] args)
Dumps to the standard output stream a list of operations for the
default processor.
|
void |
printOperations(Writer out,
String[] names)
Prints a description of operations to the specified stream.
|
protected void |
removeOperation(Operation operation)
Removes the specified operation to this processor.
|
static void |
removeOperationFromProcessors(String operationName)
This method is called when the user has registered another
OperationDescriptor and
must remove the old operation instance from the processors. |
void |
scanForPlugins()
Scans for factory plug-ins on the application class path.
|
static void |
updateProcessors()
This method is called when the user has registered another
OperationDescriptor for an
operation and requires to update the various CoverageProcessors. |
public static final Logger LOGGER
public static final Level OPERATION
Level.INFO
.protected final Hints hints
null
). This field is usually given as
argument to OperationJAI
methods.protected final FactoryRegistry registry
Operation
implementations.public CoverageProcessor()
public CoverageProcessor(RenderingHints hints)
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:
JAI.KEY_REPLACE_INDEX_COLOR_MODEL
set to Boolean.FALSE
.
JAI.KEY_TRANSFORM_ON_COLORMAP
set to Boolean.FALSE
.
hints
- A set of additional rendering hints, or null
if none.public static CoverageProcessor getInstance()
Note: this is a temporary method, until we have GeoAPI interface for coverage processor and a factory finder for their implementations.
public static CoverageProcessor getInstance(Hints hints)
Note: this is a temporary method, until we have GeoAPI interface for coverage processor and a factory finder for their implementations.
public static void updateProcessors()
OperationDescriptor
for an
operation and requires to update the various CoverageProcessors.public static void removeOperationFromProcessors(String operationName)
OperationDescriptor
and
must remove the old operation instance from the processors.operationName
- Name of the operation to removepublic Locale getLocale()
public void listOperations(Writer out) throws IOException
out
- The destination stream.IOException
- if an error occured will writing to the stream.public void printOperations(Writer out, String[] names) throws OperationNotFoundException, IOException
names
array is
non-null, then only the specified operations are printed. Otherwise, all operations are
printed. The description details include operation names and lists of parameters.out
- The destination stream.names
- The operation to print, or an empty array for none, or null
for all.IOException
- if an error occured will writing to the stream.OperationNotFoundException
- if an operation named in names
was not found.protected void addOperation(Operation operation) throws IllegalStateException
operation
- The operation to add.IllegalStateException
- if an operation already exists with the same name.protected void removeOperation(Operation operation)
operation
- The operation to remove.public Collection<Operation> getOperations()
public Operation getOperation(String name) throws OperationNotFoundException
name
- Name of the operation (case insensitive).OperationNotFoundException
- if there is no operation for the specified name.public final Object getRenderingHint(RenderingHints.Key key)
key
- The hint key (e.g. Hints.JAI_INSTANCE
).null
if there is no hint for the
specified key.public Coverage doOperation(ParameterValueGroup parameters, Hints hints)
AbstractOperation.doOperation(org.opengis.parameter.ParameterValueGroup, org.geotools.util.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).parameters
- Parameters required for the operation. The easiest way to construct them is
to invoke operation.getParameters
()
and to
modify the returned group.OperationNotFoundException
- if there is no operation for the parameter group name.public Coverage doOperation(ParameterValueGroup parameters) throws OperationNotFoundException
AbstractOperation.doOperation(org.opengis.parameter.ParameterValueGroup, org.geotools.util.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).parameters
- Parameters required for the operation. The easiest way to construct them is
to invoke operation.getParameters
()
and to
modify the returned group.OperationNotFoundException
- if there is no operation for the parameter group name.public void scanForPlugins()
public static void main(String[] args)
Note for Windows users: If the output contains strange symbols, try to supply an "java org.geotools.coverage.processing.DefaultProcessor Interpolate
-encoding
" argument. Example:
The codepage number (850 in the previous example) can be fetch from the DOS command line by entering the "java org.geotools.coverage.processing.DefaultProcessor -encoding Cp850
chcp
" command with no arguments.Copyright © 1996–2019 Geotools. All rights reserved.