Package org.apache.sis.coverage.grid
Interface GridCoverage.Evaluator
- All Superinterfaces:
BandedCoverage.Evaluator
,Function<org.opengis.geometry.DirectPosition,
double[]>
- All Known Implementing Classes:
BufferedGridCoverage.CellAccessor
,ConvertedGridCoverage.SampleConverter
,DefaultEvaluator
,EvaluatorWrapper
,GridCoverage2D.PixelAccessor
- Enclosing class:
GridCoverage
Interpolates values of sample dimensions at given positions.
Values are computed by calls to
BandedCoverage.Evaluator.apply(DirectPosition)
and are returned as double[]
.
This method extends BandedCoverage.Evaluator
with the addition of some methods specific to
gridded data.
Multi-threading
Evaluators are not thread-safe. An instance ofEvaluator
should be created
for each thread that need to interpolate sample values.- Since:
- 1.3
- Version:
- 1.3
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the coverage from which this evaluator is fetching sample values.Returns the default slice where to perform evaluation, or an empty map if unspecified.void
setDefaultSlice
(Map<Integer, Long> slice) Sets the default slice where to perform evaluation when the points do not have enough dimensions.toGridCoordinates
(org.opengis.geometry.DirectPosition point) Converts the specified geospatial position to grid coordinates.Methods inherited from interface org.apache.sis.coverage.BandedCoverage.Evaluator
apply, isNullIfOutside, isWraparoundEnabled, setNullIfOutside, setWraparoundEnabled
-
Method Details
-
getCoverage
GridCoverage getCoverage()Returns the coverage from which this evaluator is fetching sample values. This is the coverage on which theGridCoverage.evaluator()
method has been invoked.- Specified by:
getCoverage
in interfaceBandedCoverage.Evaluator
- Returns:
- the source of sample values for this evaluator.
-
getDefaultSlice
Returns the default slice where to perform evaluation, or an empty map if unspecified. Keys are dimensions from 0 inclusive toGridGeometry.getDimension()
exclusive, and values are the grid coordinates of the slice in the dimension specified by the key.This information allows to invoke
BandedCoverage.Evaluator.apply(DirectPosition)
with for example two-dimensional points even if the underlying coverage is three-dimensional. The missing coordinate values are replaced by the values provided in the map.- Returns:
- the default slice where to perform evaluation, or an empty map if unspecified.
-
setDefaultSlice
Sets the default slice where to perform evaluation when the points do not have enough dimensions. Anull
argument restores the default value, which is to infer the slice from the coverage grid geometry.- Parameters:
slice
- the default slice where to perform evaluation, or an empty map if none.- Throws:
IllegalArgumentException
- if the map contains an illegal dimension or grid coordinate value.- See Also:
-
toGridCoordinates
FractionalGridCoordinates toGridCoordinates(org.opengis.geometry.DirectPosition point) throws org.opengis.referencing.operation.TransformException Converts the specified geospatial position to grid coordinates. If the given position is associated to a non-null coordinate reference system (CRS) different than the coverage CRS, then this method automatically transforms that position to the coverage CRS before to compute grid coordinates.This method does not put any restriction on the grid coordinates result. The result may be outside the grid extent if the grid to CRS transform allows it.
- Parameters:
point
- geospatial coordinates (in arbitrary CRS) to transform to grid coordinates.- Returns:
- the grid coordinates for the given geospatial coordinates.
- Throws:
IncompleteGridGeometryException
- if the grid geometry does not define a "grid to CRS" transform, or if the given point has a non-null CRS but the coverage does not have a CRS.org.opengis.referencing.operation.TransformException
- if the given coordinates cannot be transformed.- See Also:
-