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 classThe 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 booleanWhether this grid coverage should be considered as converted.private final ConcatenatedGridCoverage.LoaderThe object in charge of loading and caching grid coverages, ornullif none.private final GridSliceLocatorThe object for identifying indices in theslicesarray.private final Object[]The slices of this coverage, in the same order thanGridSliceLocator.sliceLows.private final intIndex of the first slice inlocator.private final MergeStrategyAlgorithm 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
ConstructorsModifierConstructorDescriptionprivateConcatenatedGridCoverage(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 GridCoveragecreateConvertedValues(boolean converted) Returns a grid coverage that contains real values or sample values, depending ifconvertedistrueorfalserespectively.private booleanisDeferred(int i) Returnstrueif 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 theslicesarray. -
startAt
private final int startAtIndex of the first slice inlocator. -
loader
The object in charge of loading and caching grid coverages, ornullif none. The same loader may be shared by manyConcatenatedGridCoverageinstances. -
slices
The slices of this coverage, in the same order thanGridSliceLocator.sliceLows. Array elements shall be instances ofGridCoverageorGridCoverageResource. 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 isnullif 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 ofGridCoverageorGridCoverageResource.startAt- index of the first slice inlocator.deferred- whether loading of grid coverages should be deferred to rendering time, ornullif none.request- grid geometry to request when loading data. Used only ifslicesare lazily loaded.ranges- bands to request when loading coverages. Used only ifslicesare 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) Returnstrueif 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 ifconvertedistrueorfalserespectively. This method delegates to all slices in this concatenated coverage.- Overrides:
createConvertedValuesin classGridCoverage- Parameters:
converted-truefor a coverage containing converted values, orfalsefor a coverage containing packed values.- Returns:
- a coverage containing requested values. May be
thisbut 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:
renderin 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.
-