Package org.apache.sis.coverage.grid
Class BufferedGridCoverage.CellAccessor
java.lang.Object
org.apache.sis.coverage.grid.DefaultEvaluator
org.apache.sis.coverage.grid.BufferedGridCoverage.CellAccessor
- All Implemented Interfaces:
Function<org.opengis.geometry.DirectPosition,,double[]> BandedCoverage.Evaluator,GridCoverage.Evaluator
- Enclosing class:
- BufferedGridCoverage
Implementation of evaluator returned by
BandedCoverage.evaluator().-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleantruefor banded sample model, orfalsefor pixel interleaved sample model.private final DataBufferA copy ofBufferedGridCoverage.datareference.private final long[]The grid lower values.private final long[]Grid size with shifted index.Fields inherited from class org.apache.sis.coverage.grid.DefaultEvaluator
values -
Constructor Summary
ConstructorsConstructorDescriptionCellAccessor(BufferedGridCoverage coverage) Creates a new evaluator for the specified coverage. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]apply(org.opengis.geometry.DirectPosition point) Returns a sequence of double values for a given point in the coverage.Methods inherited from class org.apache.sis.coverage.grid.DefaultEvaluator
evaluate, getCoverage, getDefaultSlice, isNullIfOutside, isWraparoundEnabled, setDefaultSlice, setNullIfOutside, setWraparoundEnabled, toGridCoordinates, toGridPosition
-
Field Details
-
data
A copy ofBufferedGridCoverage.datareference. -
lower
private final long[] lowerThe grid lower values. Those values need to be subtracted to each grid coordinate before to compute index indatabuffer. -
sizes
private final long[] sizesGrid size with shifted index. The size of dimension 0 is stored at index 1, the size of dimension 1 is stored in index 2, etc.. Element 0 contains the number of banks. This layout is convenient for computing index inDataBuffer. -
banded
private final boolean bandedtruefor banded sample model, orfalsefor pixel interleaved sample model.
-
-
Constructor Details
-
CellAccessor
CellAccessor(BufferedGridCoverage coverage) Creates a new evaluator for the specified coverage.
-
-
Method Details
-
apply
Returns a sequence of double values for a given point in the coverage. The CRS of the given point may be any coordinate reference system, ornullfor the same CRS than the coverage.- Specified by:
applyin interfaceBandedCoverage.Evaluator- Specified by:
applyin interfaceFunction<org.opengis.geometry.DirectPosition,double[]> - Overrides:
applyin classDefaultEvaluator- Parameters:
point- the position where to evaluate.- Returns:
- the sample values at the specified point, or
nullif the point is outside the coverage. For performance reason, this method may return the same array on every method call by overwriting previous values. Callers should not assume that the array content stay valid for a long time. - Throws:
PointOutsideCoverageException- if the evaluation failed because the input point has invalid coordinates and theDefaultEvaluator.isNullIfOutside()flag isfalse.CannotEvaluateException- if the values cannot be computed at the specified coordinates for another reason. This exception may be thrown if the coverage data type cannot be converted todoubleby an identity or widening conversion. Subclasses may relax this constraint if appropriate.
-