org.geotools.coverage.processing.operation
Class Extrema
java.lang.Object
org.geotools.coverage.processing.AbstractOperation
org.geotools.coverage.processing.Operation2D
org.geotools.coverage.processing.OperationJAI
org.geotools.coverage.processing.AbstractStatisticsOperationJAI
org.geotools.coverage.processing.operation.Extrema
- All Implemented Interfaces:
- java.io.Serializable, org.opengis.coverage.processing.Operation
public class Extrema
- extends AbstractStatisticsOperationJAI
This operation simply wraps JAI Extrema operations described by
ExtremaDescriptor
inside a GeoTools operation in order to make it
spatial-aware.
For the moment this is a very simple wrap. Plans on the 2.4 and successive
versions of this operation are to add the ability to use spatial ROIs and
to specific Spatial subsampling. As of now, ROI has to be a Java2D
Shape
subclass and the parameters to control x and y subsamplings got
to be Integer, which means pixel-aware.
For more information on how the underlying JAI
operators works you
can have a look here: ExtremaDescriptor
How to use this operation Here is a very simple example on
how to use this operation in order to the minimum and maximum of the source
coverage.
final OperationJAI op=new OperationJAI("Extrema");
ParameterValueGroup params = op.getParameters();
params.parameter("Source").setValue(coverage);
coverage=(GridCoverage2D) op.doOperation(params,null);
System.out.println(((double[])coverage.getProperty("minimum"))[0]);
System.out.println(((double[])coverage.getProperty("minimum"))[1]);
System.out.println(((double[])coverage.getProperty("minimum"))[2]);
System.out.println(((double[])coverage.getProperty("maximum"))[0]);
System.out.println(((double[])coverage.getProperty("maximum"))[1]);
System.out.println(((double[])coverage.getProperty("maximum"))[2]);
- Since:
- 2.4
- Author:
- Simone Giannecchini
- See Also:
- Serialized Form
Constructor Summary |
Extrema()
Constructs a default "Extrema" operation. |
Method Summary |
protected boolean |
computeOnGeophysicsValues(org.opengis.parameter.ParameterValueGroup parameters)
This operation MUST be performed on the geophysics data for this
GridCoverage2D . |
protected java.util.Map<java.lang.String,?> |
getProperties(java.awt.image.RenderedImage data,
org.opengis.referencing.crs.CoordinateReferenceSystem crs,
org.opengis.util.InternationalString name,
org.opengis.referencing.operation.MathTransform toCRS,
GridCoverage2D[] sources,
OperationJAI.Parameters parameters)
Prepare the minimum and maximum properties for this extream operation. |
Methods inherited from class org.geotools.coverage.processing.OperationJAI |
createRenderedImage, deriveCategory, deriveGridCoverage, deriveName, deriveRange, deriveSampleDimension, deriveUnit, doOperation, equals, getJAI, getOperationDescriptor, getQuantitative, resampleToCommonGeometry |
Methods inherited from class org.geotools.coverage.processing.AbstractOperation |
ensureNonNull, getDescription, getDocURL, getName, getNumSources, getParameters, getProcessor, getVendor, getVersion, hashCode, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
LOGGER
public static final java.util.logging.Logger LOGGER
Logger
for this class.
GT_SYNTHETIC_PROPERTY_MINIMUM
public static final java.lang.String GT_SYNTHETIC_PROPERTY_MINIMUM
String
key for getting the minimum vector.
- See Also:
- Constant Field Values
GT_SYNTHETIC_PROPERTY_MAXIMUM
public static final java.lang.String GT_SYNTHETIC_PROPERTY_MAXIMUM
String
key for getting the maximum vector.
- See Also:
- Constant Field Values
GT_SYNTHETIC_PROPERTY_MIN_LOCATIONS
public static final java.lang.String GT_SYNTHETIC_PROPERTY_MIN_LOCATIONS
- Locations of min values.
- See Also:
- Constant Field Values
GT_SYNTHETIC_PROPERTY_MAX_LOCATIONS
public static final java.lang.String GT_SYNTHETIC_PROPERTY_MAX_LOCATIONS
- Locations of max values.
- See Also:
- Constant Field Values
Extrema
public Extrema()
throws org.opengis.coverage.processing.OperationNotFoundException
- Constructs a default
"Extrema"
operation.
- Throws:
org.opengis.coverage.processing.OperationNotFoundException
computeOnGeophysicsValues
protected boolean computeOnGeophysicsValues(org.opengis.parameter.ParameterValueGroup parameters)
- This operation MUST be performed on the geophysics data for this
GridCoverage2D
.
- Overrides:
computeOnGeophysicsValues
in class Operation2D
- Parameters:
parameters
- ParameterValueGroup
that describes this operation
- Returns:
- always true.
- See Also:
GridCoverage2D.geophysics(boolean)
getProperties
protected java.util.Map<java.lang.String,?> getProperties(java.awt.image.RenderedImage data,
org.opengis.referencing.crs.CoordinateReferenceSystem crs,
org.opengis.util.InternationalString name,
org.opengis.referencing.operation.MathTransform toCRS,
GridCoverage2D[] sources,
OperationJAI.Parameters parameters)
- Prepare the minimum and maximum properties for this extream operation.
See ExtremaDescriptor
for more info.
- Overrides:
getProperties
in class OperationJAI
- Parameters:
data
- The RenderedImage
created by this operation.crs
- The coordinate reference system assigned to the coverage this
OperationJAI
will produce.name
- The name assigned to the coverage this OperationJAI
will produce.toCRS
- The transform from grid to crs
to be
assigned to the coverage this OperationJAI
will produce.sources
- The sources to be assigned to the coverage this OperationJAI
will
produce.parameters
- The parameters that were used by this OperationJAI
.
- Returns:
- a
Map
with the properties generated by this
OperationJAI
or null if we haven't any. - See Also:
OperationJAI#getProperties(RenderedImage, CoordinateReferenceSystem,
InternationalString, MathTransform, GridCoverage2D[],
org.geotools.coverage.processing.OperationJAI.Parameters),
Copyright © 1996-2010 Geotools. All Rights Reserved.