Package org.apache.sis.storage.aggregate
Class ConcatenatedGridCoverage
java.lang.Object
org.apache.sis.coverage.BandedCoverage
org.apache.sis.coverage.grid.GridCoverage
org.apache.sis.storage.aggregate.ConcatenatedGridCoverage
A grid coverage where a single dimension is the concatenation of many grid coverages.
All components must have the same "grid to CRS" transform, except for a translation term.
- Since:
- 1.3
- Version:
- 1.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
The class in charge of loading and caching grid coverages.Nested classes/interfaces inherited from class org.apache.sis.coverage.grid.GridCoverage
GridCoverage.Evaluator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
Whether this grid coverage should be considered as converted.private final ConcatenatedGridCoverage.Loader
The object in charge of loading and caching grid coverages, ornull
if none.private final GridSliceLocator
The object for identifying indices in theslices
array.private final Object[]
The slices of this coverage, in the same order thanGridSliceLocator.sliceLows
.private final int
Index of the first slice inlocator
.private final MergeStrategy
Algorithm to apply when more than one grid coverage can be found at the same grid index.Fields inherited from class org.apache.sis.coverage.grid.GridCoverage
gridGeometry
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ConcatenatedGridCoverage
(ConcatenatedGridCoverage source, Object[] slices, List<SampleDimension> sampleDimensions, boolean converted) Creates a new aggregated coverage for the result of a conversion from/to packed values.(package private)
ConcatenatedGridCoverage
(ConcatenatedGridResource source, GridGeometry domain, Object[] slices, int startAt, int[] deferred, GridGeometry request, int[] ranges) Creates a new aggregated coverage. -
Method Summary
Modifier and TypeMethodDescriptionprotected GridCoverage
createConvertedValues
(boolean converted) Returns a grid coverage that contains real values or sample values, depending ifconverted
istrue
orfalse
respectively.private boolean
isDeferred
(int i) Returnstrue
if the loading of the coverage at the given index is deferred.render
(GridExtent extent) Returns a two-dimensional slice of grid data as a rendered image.Methods inherited from class org.apache.sis.coverage.grid.GridCoverage
evaluator, forConvertedValues, getCoordinateReferenceSystem, getEnvelope, getGridGeometry, getSampleDimensions, toString, toTree
-
Field Details
-
locator
The object for identifying indices in theslices
array. -
startAt
private final int startAtIndex of the first slice inlocator
. -
loader
The object in charge of loading and caching grid coverages, ornull
if none. The same loader may be shared by manyConcatenatedGridCoverage
instances. -
slices
The slices of this coverage, in the same order thanGridSliceLocator.sliceLows
. Array elements shall be instances ofGridCoverage
orGridCoverageResource
. Each slice is not necessarily 1 cell tick; larger slices are accepted. The length of this array shall be at least 2. Shall be read-only. -
isConverted
private final boolean isConvertedWhether this grid coverage should be considered as converted. This is used only if the slices are lazily loaded. -
strategy
Algorithm to apply when more than one grid coverage can be found at the same grid index. This isnull
if no merge should be attempted.
-
-
Constructor Details
-
ConcatenatedGridCoverage
ConcatenatedGridCoverage(ConcatenatedGridResource source, GridGeometry domain, Object[] slices, int startAt, int[] deferred, GridGeometry request, int[] ranges) Creates a new aggregated coverage.- Parameters:
source
- the concatenated resource which is creating this coverage.domain
- domain of the coverage to create.slices
- each slice as instances ofGridCoverage
orGridCoverageResource
.startAt
- index of the first slice inlocator
.deferred
- whether loading of grid coverages should be deferred to rendering time, ornull
if none.request
- grid geometry to request when loading data. Used only ifslices
are lazily loaded.ranges
- bands to request when loading coverages. Used only ifslices
are lazily loaded.
-
ConcatenatedGridCoverage
private ConcatenatedGridCoverage(ConcatenatedGridCoverage source, Object[] slices, List<SampleDimension> sampleDimensions, boolean converted) Creates a new aggregated coverage for the result of a conversion from/to packed values. This constructor assumes that all slices use the same sample dimensions.
-
-
Method Details
-
isDeferred
private boolean isDeferred(int i) Returnstrue
if the loading of the coverage at the given index is deferred. Iftrue
, thenslices[i]
shall be an instance ofGridCoverageResource
. Iffalse
, thenslices[i]
shall be an instance ofGridCoverage
. -
createConvertedValues
Returns a grid coverage that contains real values or sample values, depending ifconverted
istrue
orfalse
respectively. This method delegates to all slices in this concatenated coverage.- Overrides:
createConvertedValues
in classGridCoverage
- Parameters:
converted
-true
for a coverage containing converted values, orfalse
for a coverage containing packed values.- Returns:
- a coverage containing requested values. May be
this
but nevernull
.
-
render
Returns a two-dimensional slice of grid data as a rendered image. Invoking this method may cause the loading of data fromConcatenatedGridResource
. Most recently used slices are cached for future invocations of this method.- Specified by:
render
in classGridCoverage
- Parameters:
extent
- a subspace of this grid coverage extent where all dimensions except two have a size of 1 cell.- Returns:
- the grid slice as a rendered image. Image location is relative to
sliceExtent
.
-