Package org.apache.sis.internal.storage
Class TiledGridResource.Subset
java.lang.Object
org.apache.sis.internal.storage.TiledGridResource.Subset
- Enclosing class:
TiledGridResource
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 Summary
FieldsModifier and TypeFieldDescription(package private) final WeakValueHashMap
<TiledGridResource.CacheKey, Raster> Cache to use for tiles loaded by theTiledGridCoverage
.(package private) final ColorModel
The color model for the bands to read (not the full set of bands in the resource).(package private) final GridGeometry
The sub-region extent, CRS and conversion from cell indices to CRS.(package private) final Number
Value to use for filling empty spaces in rasters, ornull
if none, not different than zero or not valid for the target data type.(package private) final int[]
Indices ofTiledGridResource
bands which have been retained for inclusion in theTiledGridCoverage
to construct, in strictly increasing order.(package private) final SampleModel
The sample model for the bands to read (not the full set of bands in the resource).(package private) final List
<? extends SampleDimension> Sample dimensions for each image band.(package private) final GridExtent
The area to read in unit of the full coverage (without subsampling).(package private) final GridExtent
The full size of the coverage in the enclosingTiledGridResource
.(package private) final int[]
Coordinate conversion from subsampled grid to the grid at full resolution.(package private) final int[]
Remainder of the divisions ofTiledGridResource
cell coordinates by subsampling factors.(package private) final int[]
Size of tiles (or chunks) in the resource, without clipping and subsampling. -
Constructor Summary
ConstructorsConstructorDescriptionSubset
(GridGeometry domain, int[] range) Creates parameters for the given domain and range. -
Method Summary
Modifier and TypeMethodDescription(package private) final boolean
Whether the reading of tiles is deferred toRenderedImage.getTile(int, int)
time.boolean
Returnstrue
if reading data in this subset will read contiguous values on the x axis.
-
Field Details
-
sourceExtent
The full size of the coverage in the enclosingTiledGridResource
. -
readExtent
The area to read in unit of the full coverage (without subsampling). This is the intersection between user-specified domain and enclosingTiledGridResource
domain, expanded to an integer number of tiles. -
domain
The sub-region extent, CRS and conversion from cell indices to CRS. This is the domain of the grid coverage to create. -
ranges
Sample dimensions for each image band. This is the range of the grid coverage to create. IfincludedBands
is non-null, then the the size of this list should be equal toincludedBands
array length. However, bands are not necessarily in the same order: the order of bands in thisranges
list is the order specified by user, while the order of bands inincludedBands
is always increasing index order for efficiency reasons. -
includedBands
final int[] includedBandsIndices ofTiledGridResource
bands which have been retained for inclusion in theTiledGridCoverage
to construct, in strictly increasing order. An "included" band is stored in memory but not necessarily visible to the user, because theSampleModel
can be configured for ignoring some bands. This array isnull
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
. ThisincludedBands
array does not apply any change of order for making sequential readings easier.- See Also:
-
subsampling
final int[] subsamplingCoordinate conversion from subsampled grid to the grid at full resolution. This array contains the factors by which to divideTiledGridResource
cell coordinates in order to obtainTiledGridCoverage
cell coordinates. -
subsamplingOffsets
final int[] subsamplingOffsetsRemainder of the divisions ofTiledGridResource
cell coordinates by subsampling factors. -
tileSize
final int[] tileSizeSize of tiles (or chunks) in the resource, without clipping and subsampling. -
modelForBandSubset
The sample model for the bands to read (not the full set of bands in the resource). The width istileSize[X_DIMENSION]
and the height ittileSize[Y_DIMENSION]
, i.e. subsampling is not applied. -
colorsForBandSubset
The color model for the bands to read (not the full set of bands in the resource). -
fillValue
Value to use for filling empty spaces in rasters, ornull
if none, not different than zero or not valid for the target data type. -
cache
Cache to use for tiles loaded by theTiledGridCoverage
. It is a reference toTiledGridResource.rasters
if shareable.
-
-
Constructor Details
-
Subset
Creates parameters for the given domain and range.- Parameters:
domain
- the domain argument specified by user in a call toGridCoverageResource.read(…)
.range
- the range argument specified by user in a call toGridCoverageResource.read(…)
.- Throws:
ArithmeticException
- if pixel indices exceed 64 bits integer capacity.DataStoreException
- if a call toTiledGridResource
method failed.RasterFormatException
- if the sample model is not recognized.IllegalArgumentException
- if an error occurred in an operation such as creating theSampleModel
subset for selected bands.
-
-
Method Details
-
isXContiguous
public boolean isXContiguous()Returnstrue
if reading data in this subset will read contiguous values on the x axis. This method returnstrue
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.
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 toRenderedImage.getTile(int, int)
time.
-