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
sourceFields inherited from class org.apache.sis.coverage.grid.GridCoverage
gridGeometry -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTranslatedGridCoverage(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 GridCoveragecreate(GridCoverage source, GridGeometry domain, long[] translation, boolean allowSourceReplacement) Returns a grid coverage which will use thedomaingrid geometry.protected final GridCoveragecreateConvertedValues(boolean converted) Returns a grid coverage that contains real values or sample values, depending ifconvertedistrueorfalserespectively.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, toTreeMethods 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. Thedomainsize 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 thedomaingrid geometry. This coverage will take the same sample dimensions than the source.If
domainis 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, ornullfor automatic.translation- translation to apply on the argument given torender(GridExtent).- Returns:
- the coverage, or
nullifdomainis non-null but does not have the expected size. May be thesourcereturned as-is.
-
createConvertedValues
Returns a grid coverage that contains real values or sample values, depending ifconvertedistrueorfalserespectively. This method delegates to the source and wraps the result in aTranslatedGridCoveragewith the same translation.- Overrides:
createConvertedValuesin classGridCoverage- Parameters:
converted-truefor a coverage containing converted values, orfalsefor a coverage containing packed values.- Returns:
- a new coverage containing converted or packed values, depending on
convertedargument value. May bethisbut nevernull.
-
render
Returns a two-dimensional slice of grid data as a rendered image. This method translates thesliceExtentargument, 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:
renderin classGridCoverage- Parameters:
sliceExtent- a subspace of this grid coverage extent where all dimensions except two have a size of 1 cell. May benullif 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:
SubspaceNotSpecifiedException- if the given argument is not sufficient for reducing the grid to a two-dimensional slice.CannotEvaluateException- if this method cannot produce the rendered image for another reason.
-