Package org.apache.sis.internal.storage
Class TiledGridCoverage.Snapshot
java.lang.Object
org.apache.sis.internal.storage.TiledGridCoverage.Snapshot
- Direct Known Subclasses:
DataSubset.Tile
- Enclosing class:
- TiledGridCoverage
Snapshot of a
TiledGridCoverage.AOI
iterator position. Those snapshots can be created during an iteration
for processing a tile later. For example, a TiledGridCoverage.readTiles(AOI)
method implementation may want
to create a list of all tiles to load before to start the actual reading process in order to read
the tiles in some optimal order, or for combining multiple read operations in a single operation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TiledGridCoverage
The source coverage.final int
Index of this tile in the array of tiles returned byTiledGridCoverage.readTiles(AOI)
.final int
Index of this tile in theTiledGridResource
.final int
Pixel coordinates of the upper-left corner of the tile.final int
Pixel coordinates of the upper-left corner of the tile.private final int[]
Tile Matrix Coordinates (TMC) relative to the enclosingTiledGridCoverage
. -
Constructor Summary
ConstructorsConstructorDescriptionSnapshot
(TiledGridCoverage.AOI iterator) Stores information about a tile to be loaded. -
Method Summary
Modifier and TypeMethodDescriptionStores the given raster in the cache.boolean
getRegionInsideTile
(long[] lower, long[] upper, int[] subsampling, int dimension) Returns the coordinate of the pixel to read inside the tile, ignoring subsampling.
-
Field Details
-
coverage
The source coverage. -
tmcInSubset
private final int[] tmcInSubsetTile Matrix Coordinates (TMC) relative to the enclosingTiledGridCoverage
. Tile (0,0) is the tile in the upper-left corner of thisTiledGridCoverage
, not necessarily the tile in the upper-left corner of the image in the resource. -
indexInResultArray
public final int indexInResultArrayIndex of this tile in the array of tiles returned byTiledGridCoverage.readTiles(AOI)
. -
indexInTileVector
public final int indexInTileVectorIndex of this tile in theTiledGridResource
. In a GeoTIFF image, this is the index of the tile in thetileOffsets
andtileByteCounts
vectors. This index is also used as key in theTiledGridCoverage.rasters
map. -
originX
public final int originXPixel coordinates of the upper-left corner of the tile. -
originY
public final int originYPixel coordinates of the upper-left corner of the tile.
-
-
Constructor Details
-
Snapshot
Stores information about a tile to be loaded.- Parameters:
iterator
- the iterator for which to create a snapshot of its current position.
-
-
Method Details
-
getRegionInsideTile
public boolean getRegionInsideTile(long[] lower, long[] upper, int[] subsampling, int dimension) Returns the coordinate of the pixel to read inside the tile, ignoring subsampling. The tile upper-left corner is assumed (0,0). Consequently, the lower coordinates are usually (0,0) and the upper coordinates are usually the tile size, but those value may be different if the enclosingTiledGridCoverage
contains only one (potentially big) tile. In that case, the reading process is more like untiled image reading.The
TiledGridCoverage
subsampling is provided for convenience, but is constant for all tiles regardless the subregion to read. The same values can be obtained byTiledGridCoverage.getSubsampling(int)
.- Parameters:
lower
- a pre-allocated array where to store relative coordinates of the first pixel.upper
- a pre-allocated array where to store relative coordinates after the last pixel.subsampling
- a pre-allocated array where to store subsampling.dimension
- number of elements to write in thelower
andupper
arrays.- Returns:
true
on success, orfalse
if the tile is empty.
-
cache
Stores the given raster in the cache. If another raster existed previously in the cache, the old raster will be reused if it has the same size and model, or discarded otherwise. The latter case may happen ifTiledGridCoverage.AOI.getCachedTile()
determined that a cached raster exists but cannot be reused.- Parameters:
tile
- the raster to cache.- Returns:
- the cached raster. Should be the given
raster
instance, but this method check for concurrent caching as a paranoiac check. - See Also:
-