Package org.geotools.coverage.grid
Class Interpolator2D
Object
PropertySourceImpl
AbstractCoverage
AbstractGridCoverage
GridCoverage2D
Interpolator2D
- All Implemented Interfaces:
Serializable
,PropertySource
,Coverage
,GridCoverage
A grid coverage using an interpolation for evaluating points. This interpolator is not
used for nearest-neighbor interpolation (use the plain
GridCoverage2D
class
for that). It should work for other kinds of interpolation however.- Since:
- 2.2
- Author:
- Martin Desruisseaux (IRD)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class GridCoverage2D
GridCoverage2D.Renderable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int
DefaultBorderExtender
isBorderExtenderCopy
.protected final GridCoverage2D
The source grid coverage which was specified at construction time (nevernull
).Fields inherited from class GridCoverage2D
gridGeometry, image
Fields inherited from class AbstractGridCoverage
LOGGER
Fields inherited from class AbstractCoverage
crs
Fields inherited from class PropertySourceImpl
cachedPropertyNames, properties, propertySources
-
Method Summary
Modifier and TypeMethodDescriptionstatic GridCoverage2D
create
(GridCoverage2D coverage) Constructs a new interpolator using default interpolations.static GridCoverage2D
create
(GridCoverage2D coverage, Interpolation interpolation) Constructs a new interpolator for a single interpolation.static GridCoverage2D
create
(GridCoverage2D coverage, Interpolation[] interpolations) Constructs a new interpolator for an interpolation and its fallbacks.static GridCoverage2D
create
(GridCoverage2D coverage, Interpolation[] interpolations, BorderExtender be) Constructs a new interpolator for an interpolation and its fallbacks.double[]
Returns a sequence of double values for a given two-dimensional point in the coverage.float[]
Returns a sequence of float values for a given two-dimensional point in the coverage.int[]
Returns a sequence of integer values for a given two-dimensional point in the coverage.Interpolation
Returns the primary interpolation used by thisInterpolator2D
.Interpolation[]
Returns interpolations.Methods inherited from class GridCoverage2D
dispose, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, getCoordinateReferenceSystem2D, getDebugString, getEnvelope, getEnvelope2D, getGridGeometry, getNumSampleDimensions, getOptimalDataBlockSizes, getRenderableImage, getRenderedImage, getSampleDimension, getSampleDimensions, isDataEditable, prefetch, show, show, toString
Methods inherited from class AbstractGridCoverage
formatEvaluateError, formatEvaluateError, getNumOverviews, getOverview, getOverviewGridGeometry, getSources
Methods inherited from class AbstractCoverage
evaluate, evaluate, getCoordinateReferenceSystem, getDimension, getLocale, getName, getRangeType, show
Methods inherited from class PropertySourceImpl
getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNames
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface Coverage
evaluate, evaluate, getCoordinateReferenceSystem, getRangeType
-
Field Details
-
source
The source grid coverage which was specified at construction time (nevernull
). -
DEFAULT_BORDER_EXTENDER_TYPE
public static int DEFAULT_BORDER_EXTENDER_TYPEDefaultBorderExtender
isBorderExtenderCopy
.
-
-
Method Details
-
create
Constructs a new interpolator using default interpolations.- Parameters:
coverage
- The coverage to interpolate.
-
create
Constructs a new interpolator for a single interpolation.- Parameters:
coverage
- The coverage to interpolate.interpolation
- The interpolation to use.
-
create
Constructs a new interpolator for an interpolation and its fallbacks. The fallbacks are used if the primary interpolation failed because of NaN values in the interpolated point neighbor.- Parameters:
coverage
- The coverage to interpolate.interpolations
- The interpolation to use and its fallback (if any).
-
create
public static GridCoverage2D create(GridCoverage2D coverage, Interpolation[] interpolations, BorderExtender be) Constructs a new interpolator for an interpolation and its fallbacks. The fallbacks are used if the primary interpolation failed because of NaN values in the interpolated point neighbor.- Parameters:
coverage
- The coverage to interpolate.interpolations
- The interpolation to use and its fallback (if any).
-
getInterpolations
public Interpolation[] getInterpolations()Returns interpolations. The first array's element is the interpolation for this grid coverage. Other elements (if any) are fallbacks. -
getInterpolation
public Interpolation getInterpolation()Returns the primary interpolation used by thisInterpolator2D
.- Overrides:
getInterpolation
in classGridCoverage2D
- Returns:
- The interpolation.
-
evaluate
Returns a sequence of integer values for a given two-dimensional point in the coverage.- Overrides:
evaluate
in classGridCoverage2D
- Parameters:
coord
- The coordinate point where to evaluate.dest
- An array in which to store values, ornull
.- Returns:
- An array containing values.
- Throws:
CannotEvaluateException
- if the values can't be computed at the specified coordinate. More specifically,PointOutsideCoverageException
is thrown if the evaluation failed because the input point has invalid coordinates.
-
evaluate
Returns a sequence of float values for a given two-dimensional point in the coverage.- Overrides:
evaluate
in classGridCoverage2D
- Parameters:
coord
- The coordinate point where to evaluate.dest
- An array in which to store values, ornull
.- Returns:
- An array containing values.
- Throws:
CannotEvaluateException
- if the values can't be computed at the specified coordinate. More specifically,PointOutsideCoverageException
is thrown if the evaluation failed because the input point has invalid coordinates.
-
evaluate
Returns a sequence of double values for a given two-dimensional point in the coverage.- Overrides:
evaluate
in classGridCoverage2D
- Parameters:
coord
- The coordinate point where to evaluate.dest
- An array in which to store values, ornull
.- Returns:
- An array containing values.
- Throws:
CannotEvaluateException
- if the values can't be computed at the specified coordinate. More specifically,PointOutsideCoverageException
is thrown if the evaluation failed because the input point has invalid coordinates.
-