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 ColorModelThe color model for the bands to read (not the full set of bands in the resource).(package private) final GridGeometryThe sub-region extent, CRS and conversion from cell indices to CRS.(package private) final NumberValue to use for filling empty spaces in rasters, ornullif none, not different than zero or not valid for the target data type.(package private) final int[]Indices ofTiledGridResourcebands which have been retained for inclusion in theTiledGridCoverageto construct, in strictly increasing order.(package private) final SampleModelThe 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 GridExtentThe area to read in unit of the full coverage (without subsampling).(package private) final GridExtentThe 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 ofTiledGridResourcecell 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 booleanWhether the reading of tiles is deferred toRenderedImage.getTile(int, int)time.booleanReturnstrueif 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 enclosingTiledGridResourcedomain, 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. IfincludedBandsis non-null, then the the size of this list should be equal toincludedBandsarray length. However, bands are not necessarily in the same order: the order of bands in thisrangeslist is the order specified by user, while the order of bands inincludedBandsis always increasing index order for efficiency reasons. -
includedBands
final int[] includedBandsIndices ofTiledGridResourcebands which have been retained for inclusion in theTiledGridCoverageto construct, in strictly increasing order. An "included" band is stored in memory but not necessarily visible to the user, because theSampleModelcan be configured for ignoring some bands. This array isnullif 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. ThisincludedBandsarray 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 divideTiledGridResourcecell coordinates in order to obtainTiledGridCoveragecell coordinates. -
subsamplingOffsets
final int[] subsamplingOffsetsRemainder of the divisions ofTiledGridResourcecell 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, ornullif 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.rastersif 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 toTiledGridResourcemethod failed.RasterFormatException- if the sample model is not recognized.IllegalArgumentException- if an error occurred in an operation such as creating theSampleModelsubset for selected bands.
-
-
Method Details
-
isXContiguous
public boolean isXContiguous()Returnstrueif reading data in this subset will read contiguous values on the x axis. This method returnstrueif 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.
-