it.geosolutions.jaiext.zonal
Class ZonalStatsDescriptor

java.lang.Object
  extended by javax.media.jai.OperationDescriptorImpl
      extended by it.geosolutions.jaiext.zonal.ZonalStatsDescriptor
All Implemented Interfaces:
Serializable, javax.media.jai.OperationDescriptor, javax.media.jai.RegistryElementDescriptor

public class ZonalStatsDescriptor
extends javax.media.jai.OperationDescriptorImpl

An OperationDescriptor describing the Zonal Statistics operation.

The ZonalStats operation takes in input a source image, an optional classifier image and a list of geometries on which the selected statistics are calculated. These statistics are defined by the input Statistics.StatsType array. The calculations can NoData. It is important to remember that the classifier must be of integral data type.The possible statistics are:

It is important to remember that if the Median, Mode or Histogram operations must be executed, even their Bounds and Bin numbers must be defined. The source can have all the possible JAI accepted data types. The statistical calculations are performed on every tile with an adequate synchronization and stored inside an instance of the ZoneGeometry class. For avoiding concurrency issues, the statistic calculation is done in a synchronized block. The statistical results are returned by calling the getProperty() method. The calculation happens only the first time for avoiding unnecessary loss of time.

The results are returned by the getProperty() method as a List. Every item contains the results for the related geometry. These results are stored as a Map. The inner map contains the results for every zone indicated by the optional classifier object (if the classifier is not present, the statistics are stored inside the 0-key item). The outer map contains the results for every band. The user must only select the band, the zone(if present) and the index associated to the desired Statistics object and then call the getResult() method for having the result.

Resource List
Name Value
GlobalName Zonal
LocalName Zonal
Vendor it.geosolutions.jaiext.roiaware
Description Image operator for calculating statistics on different image zones supporting ROI and No Data.
DocURL Not Defined
Version 1.0
arg0Desc Classifier image.
arg1Desc Transformation object used for mapping the Source image to the classifier.
arg2Desc List of all the geometries to analyze.
arg3Desc No Data Range used.
arg4Desc ROI Object used.
arg5Desc Boolean indicatin if the ROI RasterAccessor should be used during computations.
arg6Desc Array containing the indexes of the bands to calculate.
arg7Desc Array indicating which statistical operations must be performed on all the selected bands.
arg8Desc Array indicating the minimum bounds for complex statistics on all the selected bands.
arg9Desc Array indicating the maximum bounds for complex statistics on all the selected bands.
arg10Desc Array indicating the number of bins for complex statistics on all the selected bands.
arg11Desc List of the possible ranges for dividing the statistics.
arg12Desc Boolean indicating if the results must be calculated for each range.

Parameter List
Name Class Type Default Value
classifier RenderedImage null
transform AffineTransform null
roilist List null
noData it.geosolutions.jaiext.range.Range null
mask javax.media.jai.ROI null
useROIAccessor Boolean false
bands int[] null
stats it.geosolutions.jaiext.stats.Statistics.StatsType[] null
minbound double[] null
maxbound double[] null
numbin int[] null
rangeData List null
localStats Boolean false

See Also:
Serialized Form

Field Summary
static String ZS_PROPERTY
          Zonal Statistics property name
 
Fields inherited from class javax.media.jai.OperationDescriptorImpl
sourceNames, supportedModes
 
Fields inherited from interface javax.media.jai.OperationDescriptor
NO_PARAMETER_DEFAULT
 
Constructor Summary
ZonalStatsDescriptor()
           
 
Method Summary
static javax.media.jai.RenderedOp create(RenderedImage source, RenderedImage classifier, AffineTransform transform, List<javax.media.jai.ROI> roilist, Range noData, javax.media.jai.ROI mask, boolean useROIAccessor, int[] bands, Statistics.StatsType[] stats, double[] minBound, double[] maxBound, int[] numBins, List<Range> rangeData, boolean localStats, RenderingHints hints)
          Performs statistical operations on different image zones defined by the input geometry list.
static javax.media.jai.RenderedOp create(RenderedImage source, RenderedImage classifier, AffineTransform transform, List<javax.media.jai.ROI> roilist, Range noData, javax.media.jai.ROI mask, boolean useROIAccessor, int[] bands, Statistics.StatsType[] stats, List<Range> rangeData, boolean localStats, RenderingHints hints)
          Performs statistical operations on different image zones defined by the input geometry list.
 
Methods inherited from class javax.media.jai.OperationDescriptorImpl
arePropertiesSupported, getDefaultSourceClass, getDestClass, getDestClass, getInvalidRegion, getName, getNumParameters, getNumSources, getParamClasses, getParamDefaults, getParamDefaultValue, getParameterListDescriptor, getParamMaxValue, getParamMinValue, getParamNames, getPropertyGenerators, getPropertyGenerators, getRenderableDestClass, getRenderableSourceClasses, getResourceBundle, getResources, getSourceClasses, getSourceClasses, getSourceNames, getSupportedModes, isImmediate, isModeSupported, isRenderableSupported, isRenderedSupported, makeDefaultSourceClassList, validateArguments, validateArguments, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources, validateSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZS_PROPERTY

public static final String ZS_PROPERTY
Zonal Statistics property name

See Also:
Constant Field Values
Constructor Detail

ZonalStatsDescriptor

public ZonalStatsDescriptor()
Method Detail

create

public static javax.media.jai.RenderedOp create(RenderedImage source,
                                                RenderedImage classifier,
                                                AffineTransform transform,
                                                List<javax.media.jai.ROI> roilist,
                                                Range noData,
                                                javax.media.jai.ROI mask,
                                                boolean useROIAccessor,
                                                int[] bands,
                                                Statistics.StatsType[] stats,
                                                double[] minBound,
                                                double[] maxBound,
                                                int[] numBins,
                                                List<Range> rangeData,
                                                boolean localStats,
                                                RenderingHints hints)
Performs statistical operations on different image zones defined by the input geometry list.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.create(String,ParameterBlock,RenderingHints).

Parameters:
source - RenderedImage source image.
classifier - RenderedImage optional classifier image(Integral dataType).
transform - affine transformation used for mapping source image on the classifier.
roilist - list of all the geometries.
NoData - No Data range used for calculation.
mask - optional mask for reducing the computations on a selected ROI.
useROIAccessor - boolean indicating if a ROI RasterAccessor should be used during computations with the mask.
bands - Array indicating which band to consider.
stats - Array indicating which statistics to consider.
minBound - Array indicating minimum bounds for complex computations.
maxBound - Array indicating maximum bounds for complex computations.
numBins - Array indicating the number of bins for complex computations.
rangeData - List of the possible range to calculate the statistics.
localStats - Boolean indicating if the statistics must be stored for each range.
hints - The RenderingHints to use.
Returns:
The RenderedOp source image.
Throws:
IllegalArgumentException - if source is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp

create

public static javax.media.jai.RenderedOp create(RenderedImage source,
                                                RenderedImage classifier,
                                                AffineTransform transform,
                                                List<javax.media.jai.ROI> roilist,
                                                Range noData,
                                                javax.media.jai.ROI mask,
                                                boolean useROIAccessor,
                                                int[] bands,
                                                Statistics.StatsType[] stats,
                                                List<Range> rangeData,
                                                boolean localStats,
                                                RenderingHints hints)
Performs statistical operations on different image zones defined by the input geometry list.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.create(String,ParameterBlock,RenderingHints).

Parameters:
source - RenderedImage source image.
classifier - RenderedImage optional classifier image(Integral dataType).
transform - affine transformation used for mapping source image on the classifier.
roilist - list of all the geometries.
NoData - No Data range used for calculation.
mask - optional mask for reducing the computations on a selected ROI.
useROIAccessor - boolean indicating if a ROI RasterAccessor should be used during computations with the mask.
bands - Array indicating which band to consider.
stats - Array indicating which statistics to consider.
rangeData - List of the possible range to calculate the statistics.
localStats - Boolean indicating if the statistics must be stored for each range.
Returns:
The RenderedOp source image.
Throws:
IllegalArgumentException - if source is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp


Copyright © 2006–2014 GeoSolutions. All rights reserved.