Class RasterDataLoop


  • public class RasterDataLoop
    extends Object
    A utility class which is used to iterate over all pixels within a region of a data raster and to evaluate any number of Terms on each pixel.
    • Constructor Detail

      • RasterDataLoop

        public RasterDataLoop​(int offsetX,
                              int offsetY,
                              int regionWidth,
                              int regionHeight,
                              Term[] terms,
                              ProgressMonitor pm)
        Creates an instance of this class for the given region and terms.
        Parameters:
        offsetX - the X-offset of the region.
        offsetY - the Y-offset of the region.
        regionWidth - the width of the region.
        regionHeight - the height of the region.
        terms - an array of terms.
        pm - a monitor to inform the user about progress
      • RasterDataLoop

        public RasterDataLoop​(RasterDataEvalEnv rasterDataEvalEnv,
                              Term[] terms,
                              ProgressMonitor pm)
        Creates an instance of this class for the given region and terms.
        Parameters:
        rasterDataEvalEnv - the raster data evaluation environment passed to the term evaluation
        terms - an array of terms.
        pm - a monitor to inform the user about progress
    • Method Detail

      • getOffsetX

        public int getOffsetX()
      • getOffsetY

        public int getOffsetY()
      • getRegionWidth

        public int getRegionWidth()
      • getRegionHeight

        public int getRegionHeight()
      • getTerms

        public Term[] getTerms()
      • forEachPixel

        public void forEachPixel​(RasterDataLoop.Body body,
                                 String message)
                          throws IOException
        Evaluates the body by calling its eval() method.
        Parameters:
        body - the object whose eval method is called.
        message - the progress message
        Throws:
        IOException - if the raster data could not be read.