Class TiledGridCoverage.AOI

java.lang.Object
org.apache.sis.internal.storage.TiledGridCoverage.AOI
Enclosing class:
TiledGridCoverage

protected final class TiledGridCoverage.AOI extends Object
The Area Of Interest specified by user in a call to TiledGridCoverage.render(GridExtent). This class is also an iterator over tiles in the region of interest.
  • Field Details

    • tileCountInQuery

      public final int tileCountInQuery
      Total number of tiles in the AOI, from tileLower inclusive to tileUpper exclusive. This is the length of the array to be returned by TiledGridCoverage.readTiles(AOI).
  • Method Details

    • subset

      public TiledGridCoverage.AOI subset(int[] tileLower, int[] tileUpper)
      Returns a new AOI instance over a sub-region of this Area Of Interest. The region is specified by tile indices, with (0,0) being the first tile of the enclosing grid coverage. The given region is intersected with the region of this AOI. The tileLower and tileUpper array can have any length; extra indices are ignored and missing indices are inherited from this AOI. This method is independent to the iterator position of this AOI.
      Parameters:
      tileLower - indices (relative to enclosing TiledGridCoverage) of the upper-left tile to read.
      tileUpper - indices (relative to enclosing TiledGridCoverage) after the bottom-right tile to read.
      Returns:
      a new AOI instance for the specified sub-region.
    • getIndexInResultArray

      public final int getIndexInResultArray()
      Returns the current iterator position as an index in the array of tiles to be returned by TiledGridCoverage.readTiles(AOI). The initial position is zero. The position is incremented by 1 in each call to next().
      Returns:
      current iterator position in result array.
    • getCachedTile

      public Raster getCachedTile()
      Returns the cached tile for current iterator position.
      Returns:
      cached tile at current iterator position, or null if none.
      See Also:
    • next

      public boolean next()
      Moves the iterator position to next tile. This method should be invoked in a loop as below:
      Returns:
      true on success, or false if the iteration is finished.