org.geotools.coverage.grid
Class Interpolator2D

java.lang.Object
  extended by javax.media.jai.PropertySourceImpl
      extended by org.geotools.coverage.AbstractCoverage
          extended by org.geotools.coverage.grid.AbstractGridCoverage
              extended by org.geotools.coverage.grid.GridCoverage2D
                  extended by org.geotools.coverage.grid.Calculator2D
                      extended by org.geotools.coverage.grid.Interpolator2D
All Implemented Interfaces:
java.io.Serializable, javax.media.jai.PropertySource, RenderedCoverage, org.opengis.coverage.Coverage, org.opengis.coverage.grid.GridCoverage

public final class Interpolator2D
extends Calculator2D

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
Version:
$Id: Interpolator2D.java 35445 2010-05-10 20:52:26Z simonegiannecchini $
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.geotools.coverage.grid.GridCoverage2D
GridCoverage2D.Renderable
 
Field Summary
static int DEFAULT_BORDER_EXTENDER_TYPE
          Default BorderExtender is BorderExtenderCopy.
 
Fields inherited from class org.geotools.coverage.grid.Calculator2D
source
 
Fields inherited from class org.geotools.coverage.grid.GridCoverage2D
gridGeometry, image
 
Fields inherited from class org.geotools.coverage.grid.AbstractGridCoverage
LOGGER
 
Fields inherited from class org.geotools.coverage.AbstractCoverage
crs
 
Fields inherited from class javax.media.jai.PropertySourceImpl
cachedPropertyNames, properties, propertySources
 
Method Summary
static GridCoverage2D create(GridCoverage2D coverage)
          Constructs a new interpolator using default interpolations.
static GridCoverage2D create(GridCoverage2D coverage, javax.media.jai.Interpolation interpolation)
          Constructs a new interpolator for a single interpolation.
static GridCoverage2D create(GridCoverage2D coverage, javax.media.jai.Interpolation[] interpolations)
          Constructs a new interpolator for an interpolation and its fallbacks.
static GridCoverage2D create(GridCoverage2D coverage, javax.media.jai.Interpolation[] interpolations, javax.media.jai.BorderExtender be)
          Constructs a new interpolator for an interpolation and its fallbacks.
 double[] evaluate(java.awt.geom.Point2D coord, double[] dest)
          Returns a sequence of double values for a given two-dimensional point in the coverage.
 float[] evaluate(java.awt.geom.Point2D coord, float[] dest)
          Returns a sequence of float values for a given two-dimensional point in the coverage.
 int[] evaluate(java.awt.geom.Point2D coord, int[] dest)
          Returns a sequence of integer values for a given two-dimensional point in the coverage.
 javax.media.jai.Interpolation getInterpolation()
          Returns the primary interpolation used by this Interpolator2D.
 javax.media.jai.Interpolation[] getInterpolations()
          Returns interpolations.
protected  GridCoverage2D specialize(GridCoverage2D view)
          Invoked by view(type) when the packed, geophysics or photographic view of this grid coverage needs to be created.
 
Methods inherited from class org.geotools.coverage.grid.GridCoverage2D
dispose, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, geophysics, getCoordinateReferenceSystem2D, getDebugString, getEnvelope, getEnvelope2D, getGridGeometry, getNumSampleDimensions, getOptimalDataBlockSizes, getRenderableImage, getRenderedImage, getSampleDimension, getSampleDimensions, getViewTypes, isDataEditable, prefetch, show, show, toString, view
 
Methods inherited from class org.geotools.coverage.grid.AbstractGridCoverage
formatEvaluateError, formatEvaluateError, getDataBlock, getDataBlock, getDataBlock, getDataBlock, getDataBlock, getDataBlock, getGridPacking, getNumOverviews, getOverview, getOverviewGridGeometry, getPackedDataBlock, getSources, setDataBlock, setDataBlock, setDataBlock, setDataBlock, setDataBlock, setDataBlock, setPackedDataBlock
 
Methods inherited from class org.geotools.coverage.AbstractCoverage
evaluate, evaluate, evaluateInverse, find, find, getCommonPointRule, getCoordinateReferenceSystem, getDimension, getDomainElements, getDomainExtents, getLocale, getName, getRangeElements, getRangeType, list, select, show
 
Methods inherited from class javax.media.jai.PropertySourceImpl
getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengis.coverage.grid.GridCoverage
getDataBlock, getDataBlock, getDataBlock, getDataBlock, getDataBlock, getDataBlock, getGridPacking, getNumOverviews, getOverview, getOverviewGridGeometry, getPackedDataBlock, getSources, setDataBlock, setDataBlock, setDataBlock, setDataBlock, setDataBlock, setDataBlock
 
Methods inherited from interface org.opengis.coverage.Coverage
evaluate, evaluate, evaluateInverse, find, find, getCommonPointRule, getCoordinateReferenceSystem, getDomainElements, getDomainExtents, getRangeElements, getRangeType, list, select
 
Methods inherited from interface javax.media.jai.PropertySource
getProperty, getPropertyClass, getPropertyNames, getPropertyNames
 

Field Detail

DEFAULT_BORDER_EXTENDER_TYPE

public static int DEFAULT_BORDER_EXTENDER_TYPE
Default BorderExtender is BorderExtenderCopy.

Method Detail

create

public static GridCoverage2D create(GridCoverage2D coverage)
Constructs a new interpolator using default interpolations.

Parameters:
coverage - The coverage to interpolate.

create

public static GridCoverage2D create(GridCoverage2D coverage,
                                    javax.media.jai.Interpolation interpolation)
Constructs a new interpolator for a single interpolation.

Parameters:
coverage - The coverage to interpolate.
interpolation - The interpolation to use.

create

public static GridCoverage2D create(GridCoverage2D coverage,
                                    javax.media.jai.Interpolation[] interpolations)
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,
                                    javax.media.jai.Interpolation[] interpolations,
                                    javax.media.jai.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).

specialize

protected GridCoverage2D specialize(GridCoverage2D view)
Invoked by view(type) when the packed, geophysics or photographic view of this grid coverage needs to be created. This method applies to the new grid coverage the same interpolations than this grid coverage.

Specified by:
specialize in class Calculator2D
Parameters:
view - A view derived from the source coverage.
Returns:
The grid coverage to be returned by view.
Since:
2.5

getInterpolations

public javax.media.jai.Interpolation[] getInterpolations()
Returns interpolations. The first array's element is the interpolation for this grid coverage. Other elements (if any) are fallbacks.


getInterpolation

public javax.media.jai.Interpolation getInterpolation()
Returns the primary interpolation used by this Interpolator2D.

Overrides:
getInterpolation in class GridCoverage2D
Returns:
The interpolation.

evaluate

public int[] evaluate(java.awt.geom.Point2D coord,
                      int[] dest)
               throws org.opengis.coverage.CannotEvaluateException
Returns a sequence of integer values for a given two-dimensional point in the coverage.

Overrides:
evaluate in class GridCoverage2D
Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or null.
Returns:
An array containing values.
Throws:
org.opengis.coverage.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

public float[] evaluate(java.awt.geom.Point2D coord,
                        float[] dest)
                 throws org.opengis.coverage.CannotEvaluateException
Returns a sequence of float values for a given two-dimensional point in the coverage.

Overrides:
evaluate in class GridCoverage2D
Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or null.
Returns:
An array containing values.
Throws:
org.opengis.coverage.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

public double[] evaluate(java.awt.geom.Point2D coord,
                         double[] dest)
                  throws org.opengis.coverage.CannotEvaluateException
Returns a sequence of double values for a given two-dimensional point in the coverage.

Overrides:
evaluate in class GridCoverage2D
Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or null.
Returns:
An array containing values.
Throws:
org.opengis.coverage.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.


Copyright © 1996-2010 Geotools. All Rights Reserved.