Class RasterDataLoop

java.lang.Object
org.esa.snap.core.dataop.barithm.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 Details

    • 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 Details

    • 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) throws IOException
      Evaluates the body by calling its eval() method. This method just delegates to forEachPixel(body, null).
      Parameters:
      body - the object whose eval method is called.
      Throws:
      IOException - if the raster data could not be read.
    • 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.