Package org.esa.snap.core.dataop.resamp
Interface Resampling
- All Known Implementing Classes:
BilinearInterpolationResampling
public interface Resampling
An interface used to implement different resampling strategies.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classAn index is used to provide resampling information at a given raster position x,y.static interfaceA raster is a rectangular grid which provides sample values at a given raster position x,y. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ResamplingThe bicubic spline interpolation resampling method.static final ResamplingThe bilinear interpolation resampling method.static final Resamplingstatic final Resamplingstatic final ResamplingThe bisinc interpolation resampling method.static final ResamplingThe cubic convolution resampling method.static final ResamplingThe nearest neighbour resampling method. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidcomputeCornerBasedIndex(double x, double y, int width, int height, Resampling.Index index) Computes the index's properties for the given non-pixel coordinate without pixel center intensity assumption.voidcomputeIndex(double x, double y, int width, int height, Resampling.Index index) Computes the index's properties for the given pixel coordinate.Factory method which creates an appropriate index for raster access.default intgetName()Gets a unique identifier for this resampling method, e.g.doubleresample(Resampling.Raster raster, Resampling.Index index) Performs the actual resampling operation.
-
Field Details
-
NEAREST_NEIGHBOUR
The nearest neighbour resampling method. -
BILINEAR_INTERPOLATION
The bilinear interpolation resampling method. -
CUBIC_CONVOLUTION
The cubic convolution resampling method. -
BISINC_5_POINT_INTERPOLATION
The bisinc interpolation resampling method. -
BISINC_11_POINT_INTERPOLATION
-
BISINC_21_POINT_INTERPOLATION
-
BICUBIC_INTERPOLATION
The bicubic spline interpolation resampling method.
-
-
Method Details
-
getName
String getName()Gets a unique identifier for this resampling method, e.g. "BILINEAR_INTERPOLATION".- Returns:
- a unique name
-
createIndex
Resampling.Index createIndex()Factory method which creates an appropriate index for raster access.- Returns:
- an appropriate index, never null
-
computeIndex
Computes the index's properties for the given pixel coordinate.- Parameters:
x- the raster's x coordinatey- the raster's y coordinatewidth- the raster's widthheight- the raster's heightindex- the index object to which the results are to be assigned
-
computeCornerBasedIndex
default void computeCornerBasedIndex(double x, double y, int width, int height, Resampling.Index index) Computes the index's properties for the given non-pixel coordinate without pixel center intensity assumption. The default implementation computes the resampling index for given coordinate without pixel center intensity assumption. It adds 0.5 to coordinates to counter the consideration of pixel center in base function.- Parameters:
x- the raster's x coordinatey- the raster's y coordinatewidth- the raster's widthheight- the raster's heightindex- the index object to which the results are to be assigned
-
resample
Performs the actual resampling operation. If a sample value could not be computed at the given index, e.g. in case of missing data, the method returns the special valueFloat.NaN.- Parameters:
raster- the rasterindex- the index, must be computed using thecomputeIndex(double, double, int, int, org.esa.snap.core.dataop.resamp.Resampling.Index)method- Returns:
- either the re-sampled sample value or
Float.NaN. - Throws:
Exception- if a non-runtime error occurs, e.g I/O error
-
getKernelSize
default int getKernelSize()
-