Package org.apache.sis.coverage.grid
Class TranslatedGridCoverage
java.lang.Object
org.apache.sis.coverage.BandedCoverage
org.apache.sis.coverage.grid.GridCoverage
org.apache.sis.coverage.grid.DerivedGridCoverage
org.apache.sis.coverage.grid.TranslatedGridCoverage
A grid coverage with the same data than the source coverage,
with only a translation applied on grid coordinates.
- Since:
- 1.3
- Version:
- 1.3
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.coverage.grid.GridCoverage
GridCoverage.Evaluator, GridCoverage.Lazy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long[]
The translation to apply on the argument given torender(GridExtent)
before to delegate to the source.Fields inherited from class org.apache.sis.coverage.grid.DerivedGridCoverage
source
Fields inherited from class org.apache.sis.coverage.grid.GridCoverage
gridGeometry
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
TranslatedGridCoverage
(GridCoverage source, GridGeometry domain, long[] translation) Constructs a new grid coverage which will delegate the rendering operation to the given source. -
Method Summary
Modifier and TypeMethodDescription(package private) static GridCoverage
create
(GridCoverage source, GridGeometry domain, long[] translation, boolean allowSourceReplacement) Returns a grid coverage which will use thedomain
grid geometry.protected final GridCoverage
createConvertedValues
(boolean converted) Returns a grid coverage that contains real values or sample values, depending ifconverted
istrue
orfalse
respectively.render
(GridExtent sliceExtent) Returns a two-dimensional slice of grid data as a rendered image.Methods inherited from class org.apache.sis.coverage.grid.DerivedGridCoverage
evaluator, getBandType, IsNotRepleacable, toTree
Methods inherited from class org.apache.sis.coverage.grid.GridCoverage
appendDataLayout, convert, forConvertedValues, getCoordinateReferenceSystem, getEnvelope, getGridGeometry, getSampleDimensions, toString
-
Field Details
-
translation
private final long[] translationThe translation to apply on the argument given torender(GridExtent)
before to delegate to the source. This is the conversion from this coverage to the source coverage.
-
-
Constructor Details
-
TranslatedGridCoverage
Constructs a new grid coverage which will delegate the rendering operation to the given source. This coverage will take the same sample dimensions than the source. Thedomain
size must be the same than the source grid geometry size.- Parameters:
source
- the source on which to delegate rendering operations.domain
- the grid extent, CRS and conversion from cell indices to CRS.translation
- translation to apply on the argument given torender(GridExtent)
.
-
-
Method Details
-
create
static GridCoverage create(GridCoverage source, GridGeometry domain, long[] translation, boolean allowSourceReplacement) Returns a grid coverage which will use thedomain
grid geometry. This coverage will take the same sample dimensions than the source.If
domain
is non-null, then it should have the same size than the source grid geometry size. If this is not the case, then this method returnsnull
.- Parameters:
source
- the source on which to delegate rendering operations.domain
- the geometry of the grid coverage to return, ornull
for automatic.translation
- translation to apply on the argument given torender(GridExtent)
.- Returns:
- the coverage, or
null
ifdomain
is non-null but does not have the expected size. May be thesource
returned as-is.
-
createConvertedValues
Returns a grid coverage that contains real values or sample values, depending ifconverted
istrue
orfalse
respectively. This method delegates to the source and wraps the result in aTranslatedGridCoverage
with the same translation.- Overrides:
createConvertedValues
in classGridCoverage
- Parameters:
converted
-true
for a coverage containing converted values, orfalse
for a coverage containing packed values.- Returns:
- a new coverage containing converted or packed values, depending on
converted
argument value. May bethis
but nevernull
.
-
render
Returns a two-dimensional slice of grid data as a rendered image. This method translates thesliceExtent
argument, then delegates to the source. It is okay to use the source result as-is because image coordinates are relative to the request; the rendered image shall not be translated.- Specified by:
render
in classGridCoverage
- Parameters:
sliceExtent
- a subspace of this grid coverage extent where all dimensions except two have a size of 1 cell. May benull
if this grid coverage has only two dimensions with a size greater than 1 cell.- Returns:
- the grid slice as a rendered image. Image location is relative to
sliceExtent
. - Throws:
CannotEvaluateException
- if this method cannot produce the rendered image for another reason.
-