public class ZonalStatsOpImage
extends javax.media.jai.OpImage
OpImage
class and executes the "ZonalStats" operation. This operation consists of calculating the image statistics
on different locations, defined by their geometries, on the same image. In addition this operation supports the presence of ROI or No Data. The
calculations are performed only in a rectangle that contains the union of all the input geometries. For every input geometry, a
ZoneGeometry
object is associated to it for storing its statistics. A spatial index is used for fast accessing the geometries that
intersects the selected image pixel (in the case of overlapping). The final results can be returned by calling the getProperty() method with the
ZonalStatsDescriptor.ZS_PROPERTY. This method returns a list containing all the ZoneGeometries objects associated with each input geometry object.
The statistic results can be returned for each band or for each Class(if the classifier is present). It is important to remember that the
classifier must be of integral data type.Modifier and Type | Field and Description |
---|---|
protected static javax.media.jai.BorderExtender |
ROI_EXTENDER
ROI extender
|
Constructor and Description |
---|
ZonalStatsOpImage(RenderedImage source,
javax.media.jai.ImageLayout layout,
Map configuration,
RenderedImage classifier,
AffineTransform transform,
List<javax.media.jai.ROI> rois,
Range noData,
javax.media.jai.ROI mask,
boolean useROIAccessor,
int[] bands,
Statistics.StatsType[] statsTypes,
double[] minBound,
double[] maxBound,
int[] numBins,
List<Range> rangeData,
boolean localStats) |
Modifier and Type | Method and Description |
---|---|
void |
clearStatistic()
This method is used if the user needs to perform again the statistical calculations.
|
Raster |
computeTile(int tileX,
int tileY) |
Object |
getProperty(String name)
Get the specified property.
|
String[] |
getPropertyNames()
Returns a list of property names that are recognized by this image.
|
Raster[] |
getTiles()
Computes and returns all tiles in the image.
|
Rectangle |
mapDestRect(Rectangle destRect,
int index)
OpImage method that returns the destination image bounds, because source and destination images are equals |
Rectangle |
mapSourceRect(Rectangle sourceRect,
int index)
OpImage method that returns the source image bounds, because source and destination images are equals |
addTileToCache, cancelTiles, computeRect, computeRect, computesUniqueTiles, createTile, dispose, getExpandedNumBands, getFormatTags, getOperationComputeType, getTile, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, getTiles, hasExtender, mapDestPoint, mapSourcePoint, prefetchTiles, queueTiles, recycleTile, setTileCache, vectorize, vectorize, vectorize
addPropertyChangeListener, addPropertyChangeListener, addSink, addSink, addSource, addTileComputationListener, copyData, copyData, copyExtendedData, createColorModel, createSnapshot, createWritableRaster, finalize, getAsBufferedImage, getAsBufferedImage, getBounds, getColorModel, getData, getData, getDefaultColorModel, getExtendedData, getGraphics, getHeight, getImageID, getMaxTileX, getMaxTileY, getMaxX, getMaxY, getMinTileX, getMinTileY, getMinX, getMinY, getNumBands, getNumSources, getNumXTiles, getNumYTiles, getProperties, getPropertyClass, getPropertyNames, getSampleModel, getSinks, getSource, getSourceImage, getSourceObject, getSources, getSplits, getTileComputationListeners, getTileFactory, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileIndices, getTileRect, getTileWidth, getWidth, overlapsMultipleTiles, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeSink, removeSink, removeSinks, removeSource, removeSources, removeTileComputationListener, setImageLayout, setProperties, setProperty, setSource, setSources, tileXToX, tileXToX, tileYToY, tileYToY, toString, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY
protected static final javax.media.jai.BorderExtender ROI_EXTENDER
public ZonalStatsOpImage(RenderedImage source, javax.media.jai.ImageLayout layout, Map configuration, RenderedImage classifier, AffineTransform transform, List<javax.media.jai.ROI> rois, Range noData, javax.media.jai.ROI mask, boolean useROIAccessor, int[] bands, Statistics.StatsType[] statsTypes, double[] minBound, double[] maxBound, int[] numBins, List<Range> rangeData, boolean localStats)
public Raster computeTile(int tileX, int tileY)
computeTile
in class javax.media.jai.OpImage
public Rectangle mapDestRect(Rectangle destRect, int index)
OpImage
method that returns the destination image bounds, because source and destination images are equalsmapDestRect
in class javax.media.jai.OpImage
public Rectangle mapSourceRect(Rectangle sourceRect, int index)
OpImage
method that returns the source image bounds, because source and destination images are equalsmapSourceRect
in class javax.media.jai.OpImage
public String[] getPropertyNames()
getPropertyNames
in interface RenderedImage
getPropertyNames
in interface javax.media.jai.PropertySource
getPropertyNames
in class javax.media.jai.PlanarImage
String
s containing valid property names.public void clearStatistic()
public Raster[] getTiles()
getTiles
in class javax.media.jai.PlanarImage
public Object getProperty(String name)
Use this method to retrieve the calculated statistics as an array per band and per statistic types.
getProperty
in interface RenderedImage
getProperty
in interface javax.media.jai.PropertySource
getProperty
in class javax.media.jai.PlanarImage
name
- property nameCopyright © 2006–2015 GeoSolutions. All rights reserved.