public class GeographicImageInterpolator extends ImageInterpolator
ImageInterpolator to
correctly map from geographic coordinates to image coordinates. Unlike its superclass, which works in Cartesian
coordinates, GeographicImageInterpolator handles the singularities of geographic coordinates. For example,
GeographicImageInterpolator can map images which cross the international dateline.| Modifier and Type | Class and Description |
|---|---|
protected static class |
GeographicImageInterpolator.GeographicCell
GeographicCell extends
ImageInterpolator.Cell to correctly handle image cells
which have geographic coordinates. |
ImageInterpolator.Cell, ImageInterpolator.ContainingCell| Constructor and Description |
|---|
GeographicImageInterpolator(Dimension gridSize,
float[] xs,
float[] ys,
int depth,
int cellSize)
Creates a new GeographicImageInterpolator, initializing this interpolator's internal image cell tree with root
cell dimensions of
(gridSize.width * gridSize.height) and with the specified depth. |
| Modifier and Type | Method and Description |
|---|---|
protected double[] |
computeBilinearCoordinates(float x,
float y,
ImageInterpolator.Cell cell)
Overridden to correctly compute bilinear interpolation coordinates for image cells which cross the international
dateline.
|
Sector |
getSector()
Returns the sector containing the image's geographic coordinates.
|
protected ImageInterpolator.Cell |
makeRootCell(int m0,
int m1,
int n0,
int n1)
Overridden to create a
GeographicImageInterpolator.GeographicCell. |
checkContainment, findContainingCell, findContainingCell, getFieldIndicespublic GeographicImageInterpolator(Dimension gridSize, float[] xs, float[] ys, int depth, int cellSize)
(gridSize.width * gridSize.height) and with the specified depth.gridSize - the image's dimensions.xs - the x-coordinates of the image's pixels. Must contain at least gridSize.width *
gridSize.height elements.ys - the y-coordinates of the image's pixels. Must contain at least gridSize.width *
gridSize.height elements.depth - the initial depth of this interpolator's image cell tree.cellSize - the size of a leaf cell in this interpolator's image cell tree, in pixels.IllegalStateException - if any of the the gridSize, x-coordinates, or y-coordinates are null, if either the
x-coordinates or y-coordinates contain less than gridSize.width *
gridSize.height elements, if the depth is less than zero, or if the cell
size is less than one.protected double[] computeBilinearCoordinates(float x,
float y,
ImageInterpolator.Cell cell)
computeBilinearCoordinates in class ImageInterpolatorx - the x-component of the point to compute bilinear coordinate for.y - the y-component of the point to compute bilinear coordinate for.cell - the cell to compute bilinear coordinates for.public Sector getSector()
protected ImageInterpolator.Cell makeRootCell(int m0, int m1, int n0, int n1)
GeographicImageInterpolator.GeographicCell.makeRootCell in class ImageInterpolatorm0 - the root cell's left image coordinate.m1 - the root cell's right image coordinate.n0 - the root cell's bottom image coordinate.n1 - the root cell's top image coordinate.