Class TiledGridResource.Subset

java.lang.Object
org.apache.sis.internal.storage.TiledGridResource.Subset
Enclosing class:
TiledGridResource

public final class TiledGridResource.Subset extends Object
Parameters that describe the resource subset to be accepted by the TiledGridCoverage constructor. This is a temporary class used only for transferring information from TiledGridResource. This class does not perform I/O operations.
  • Field Details

    • sourceExtent

      final GridExtent sourceExtent
      The full size of the coverage in the enclosing TiledGridResource.
    • readExtent

      final GridExtent readExtent
      The area to read in unit of the full coverage (without subsampling). This is the intersection between user-specified domain and enclosing TiledGridResource domain, expanded to an integer number of tiles.
    • domain

      final GridGeometry domain
      The sub-region extent, CRS and conversion from cell indices to CRS. This is the domain of the grid coverage to create.
    • ranges

      final List<? extends SampleDimension> ranges
      Sample dimensions for each image band. This is the range of the grid coverage to create. If includedBands is non-null, then the the size of this list should be equal to includedBands array length. However, bands are not necessarily in the same order: the order of bands in this ranges list is the order specified by user, while the order of bands in includedBands is always increasing index order for efficiency reasons.
    • includedBands

      final int[] includedBands
      Indices of TiledGridResource bands which have been retained for inclusion in the TiledGridCoverage to construct, in strictly increasing order. An "included" band is stored in memory but not necessarily visible to the user, because the SampleModel can be configured for ignoring some bands. This array is null if all bands shall be included.

      If the user specified bands out of order, the change of band order is taken in account by the modelForBandSubset. This includedBands array does not apply any change of order for making sequential readings easier.

      See Also:
    • subsampling

      final int[] subsampling
      Coordinate conversion from subsampled grid to the grid at full resolution. This array contains the factors by which to divide TiledGridResource cell coordinates in order to obtain TiledGridCoverage cell coordinates.
    • subsamplingOffsets

      final int[] subsamplingOffsets
      Remainder of the divisions of TiledGridResource cell coordinates by subsampling factors.
    • tileSize

      final int[] tileSize
      Size of tiles (or chunks) in the resource, without clipping and subsampling.
    • modelForBandSubset

      final SampleModel modelForBandSubset
      The sample model for the bands to read (not the full set of bands in the resource). The width is tileSize[X_DIMENSION] and the height it tileSize[Y_DIMENSION], i.e. subsampling is not applied.
    • colorsForBandSubset

      final ColorModel colorsForBandSubset
      The color model for the bands to read (not the full set of bands in the resource).
    • fillValue

      final Number fillValue
      Value to use for filling empty spaces in rasters, or null if none, not different than zero or not valid for the target data type.
    • cache

      Cache to use for tiles loaded by the TiledGridCoverage. It is a reference to TiledGridResource.rasters if shareable.
  • Constructor Details

    • Subset

      public Subset(GridGeometry domain, int[] range) throws DataStoreException
      Creates parameters for the given domain and range.
      Parameters:
      domain - the domain argument specified by user in a call to GridCoverageResource.read(…).
      range - the range argument specified by user in a call to GridCoverageResource.read(…).
      Throws:
      ArithmeticException - if pixel indices exceed 64 bits integer capacity.
      DataStoreException - if a call to TiledGridResource method failed.
      RasterFormatException - if the sample model is not recognized.
      IllegalArgumentException - if an error occurred in an operation such as creating the SampleModel subset for selected bands.
  • Method Details

    • isXContiguous

      public boolean isXContiguous()
      Returns true if reading data in this subset will read contiguous values on the x axis. This method returns true if all following conditions are met:
      • All bands will be read (ignoring change of band order because this change is handled by the sample model).
      • There is no subsampling on the x axis.
      Note that the first criterion can often be relaxed when the sample model is an instance of BandedSampleModel. This method does not check the sample model type.
      Returns:
      whether the values to read on a row are contiguous.
    • deferredTileReading

      final boolean deferredTileReading()
      Whether the reading of tiles is deferred to RenderedImage.getTile(int, int) time.