|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.metadata.iso.spatial.PixelTranslation
public final class PixelTranslation
The translation to apply for different values of PixelOrientation
.
Field Summary | |
---|---|
double |
dx
The translation among the x axis relative to pixel center. |
double |
dy
The translation among the y axis relative to pixel center. |
org.opengis.metadata.spatial.PixelOrientation |
orientation
The pixel orientation for this translation. |
Method Summary | |
---|---|
static org.opengis.metadata.spatial.PixelOrientation |
getPixelOrientation(double dx,
double dy)
Returns the pixel orientation for the given offset, or null if none. |
static org.opengis.metadata.spatial.PixelOrientation |
getPixelOrientation(org.opengis.referencing.datum.PixelInCell anchor)
Returns the pixel orientation for the given PixelInCell code. |
static double |
getPixelTranslation(org.opengis.referencing.datum.PixelInCell anchor)
Returns the position relative to the pixel center. |
static PixelTranslation |
getPixelTranslation(org.opengis.metadata.spatial.PixelOrientation anchor)
Returns the specified position relative to the pixel center. |
java.lang.String |
toString()
Returns a string representation of this pixel translation. |
static org.opengis.referencing.operation.MathTransform |
translate(org.opengis.referencing.operation.MathTransform gridToCRS,
org.opengis.referencing.datum.PixelInCell current,
org.opengis.referencing.datum.PixelInCell expected)
Translates the specified math transform according the specified pixel orientations. |
static org.opengis.referencing.operation.MathTransform |
translate(org.opengis.referencing.operation.MathTransform gridToCRS,
org.opengis.metadata.spatial.PixelOrientation current,
org.opengis.metadata.spatial.PixelOrientation expected,
int xDimension,
int yDimension)
Translates the specified math transform according the specified pixel orientations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final org.opengis.metadata.spatial.PixelOrientation orientation
public final double dx
public final double dy
Method Detail |
---|
public static org.opengis.metadata.spatial.PixelOrientation getPixelOrientation(org.opengis.referencing.datum.PixelInCell anchor) throws java.lang.IllegalArgumentException
PixelInCell
code.
anchor
- The PixelInCell
code, or null
.
null
if the argument was null.
java.lang.IllegalArgumentException
- if the given code is unknown.public static double getPixelTranslation(org.opengis.referencing.datum.PixelInCell anchor)
Pixel in cell | offset |
---|---|
CELL_CENTER | 0.0 |
CELL_CORNER | -0.5 |
This method is typically used for n-dimensional grids, where the number of dimension is unknown.
anchor
- The "pixel in cell" value.
public static PixelTranslation getPixelTranslation(org.opengis.metadata.spatial.PixelOrientation anchor) throws java.lang.IllegalArgumentException
Pixel orientation | x | y |
---|---|---|
CENTER | 0.0 | 0.0 |
UPPER_LEFT | -0.5 | -0.5 |
UPPER_RIGHT | +0.5 | -0.5 |
LOWER_LEFT | -0.5 | +0.5 |
LOWER_RIGHT | +0.5 | +0.5 |
This method can be used for grid restricted to 2 dimensions.
anchor
- The pixel orientation.
java.lang.IllegalArgumentException
- if the specified orientation is unknown.public static org.opengis.metadata.spatial.PixelOrientation getPixelOrientation(double dx, double dy)
null
if none.
This is the reverse of getPixelTranslation(PixelOrientation)
.
dx
- The translation along x axis.dy
- The translation along y axis.
null
if none.public static org.opengis.referencing.operation.MathTransform translate(org.opengis.referencing.operation.MathTransform gridToCRS, org.opengis.referencing.datum.PixelInCell current, org.opengis.referencing.datum.PixelInCell expected)
gridToCRS
- A math transform from pixel coordinates to any CRS.current
- The pixel orientation of the given gridToCRS
transform.expected
- The pixel orientation of the desired transform.
current
to expected
.public static org.opengis.referencing.operation.MathTransform translate(org.opengis.referencing.operation.MathTransform gridToCRS, org.opengis.metadata.spatial.PixelOrientation current, org.opengis.metadata.spatial.PixelOrientation expected, int xDimension, int yDimension)
gridToCRS
- A math transform from pixel coordinates to any CRS.current
- The pixel orientation of the given gridToCRS
transform.expected
- The pixel orientation of the desired transform.xDimension
- The dimension of x coordinates (pixel columns). Often 0.yDimension
- The dimension of y coordinates (pixel rows). Often 1.
current
to expected
.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |