org.geotools.coverage.processing.operation
Class Histogram
Object
AbstractOperation
Operation2D
OperationJAI
AbstractStatisticsOperationJAI
Histogram
- All Implemented Interfaces:
- Serializable, Operation
public class Histogram
- extends AbstractStatisticsOperationJAI
* This operation simply wraps JAI Histogram operations described by
HistogramDescriptor 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: HistogramDescriptor
Histogram of the source coverage.
final OperationJAI op=new OperationJAI("Histogram");
ParameterValueGroup params = op.getParameters();
params.parameter("Source").setValue(coverage);
coverage=(GridCoverage2D) op.doOperation(params,null);
System.out.println(((double[])coverage.getProperty("histogram")));
- Since:
- 2.4
- Author:
- Simone Giannecchini
- See Also:
Histogram,
Serialized Form
| Methods inherited from class OperationJAI |
createRenderedImage, deriveCategory, deriveGridCoverage, deriveName, deriveRange, deriveSampleDimension, deriveUnit, doOperation, equals, getJAI, getOperationDescriptor, getQuantitative, resampleToCommonGeometry |
GT_SYNTHETIC_PROPERTY_HISTOGRAM
public static final String GT_SYNTHETIC_PROPERTY_HISTOGRAM
String key for getting the Histogram
object.
- See Also:
- Constant Field Values
Histogram
public Histogram()
throws OperationNotFoundException
- Default constructor for the
Histogram operation.
- Throws:
OperationNotFoundException
computeOnGeophysicsValues
protected boolean computeOnGeophysicsValues(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 Map<String,?> getProperties(RenderedImage data,
CoordinateReferenceSystem crs,
InternationalString name,
MathTransform toCRS,
GridCoverage2D[] sources,
OperationJAI.Parameters parameters)
- Prepare the
Histogram property for this histogram
operation.
See HistogramDescriptor
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),
prepareParameters
protected ParameterBlockJAI prepareParameters(ParameterValueGroup parameters)
- Description copied from class:
AbstractStatisticsOperationJAI
- Copies parameter values from the specified
ParameterValueGroup to the
ParameterBlockJAI
- Overrides:
prepareParameters in class AbstractStatisticsOperationJAI
- Parameters:
parameters - The ParameterValueGroup to be copied.
- Returns:
- A copy of the provided
ParameterValueGroup as a JAI block. - See Also:
OperationJAI.prepareParameters(org.opengis.parameter.ParameterValueGroup)
Copyright © 1996-2013 Geotools. All Rights Reserved.