public abstract class EarthTransform2D extends EarthTransform
EarthTransform2D
class adds extra functionality to
its super class common to two-dimensional earth transforms. It
also allows the use of a raster-is-point transform mode rather than
the default raster-is-area mode. In raster-is-area mode, the Earth
location returned by EarthTransform.transform(DataLocation,EarthLocation)
refers to the center of the raster pixel area. In raster-is-point
mode, the extra method transformToPoint(noaa.coastwatch.util.DataLocation, noaa.coastwatch.util.EarthLocation)
may be used to
retrieve the earth location of the point data, which may not be at
the center of the raster pixel area.dims
AIRY, AUS_NAT, BESSEL, CLARKE1866, CLARKE1880, EVEREST, GRS1980, HOUGH, INT1909, INT1967, KRASS, MAX_SPHEROIDS, MERCURY1960, MOD_AIRY, MOD_EVEREST, MOD_MER1968, SE_ASIA, SPHERE, SPHEROID_INV_FLAT, SPHEROID_NAMES, SPHEROID_SEMI_MAJOR, SPHEROID_SEMI_MINOR, STD_RADIUS, WGS66, WGS72
Constructor and Description |
---|
EarthTransform2D() |
Modifier and Type | Method and Description |
---|---|
EarthTransform2D |
get2DVersion()
Gets a version of this transform that can be used with 2D data
locations.
|
LineFeature |
getBoundingBox(DataLocation upperLeft,
DataLocation lowerRight,
int segments)
Gets a polygon bounding box for this transform using the
specified data coordinate limits.
|
void |
getWorldAxes(EarthLocation earthLoc,
double[] northVector,
double[] eastVector)
Gets the world axes for this transform at the specified location.
|
boolean |
isOrientable()
Gets the orientation hint.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
void |
setPointTransform(EarthTransform2D pointTrans)
Sets the data to geographic transform used when
transformToPoint(noaa.coastwatch.util.DataLocation, noaa.coastwatch.util.EarthLocation) is called. |
EarthLocation |
transformToPoint(DataLocation dataLoc,
EarthLocation earthLoc)
Converts data coordinates to geographic coordinates (raster point
mode).
|
clone, describe, distance, getDatum, getDimensions, getResolution, getSpheroid, getSpheroid, getSubset, transform, transform, transform, transform, transformImpl, transformImpl
getMetadataMap
public EarthTransform2D get2DVersion()
EarthTransform
get2DVersion
in class EarthTransform
public boolean isOrientable()
public void setPointTransform(EarthTransform2D pointTrans)
transformToPoint(noaa.coastwatch.util.DataLocation, noaa.coastwatch.util.EarthLocation)
is called. This transform is different from
the normal 2D transform in that it returns earth locations that
correspond to a raster-is-point style model rather than
raster-is-area. By default, transformToPoint(noaa.coastwatch.util.DataLocation, noaa.coastwatch.util.EarthLocation)
returns
the same value as EarthTransform.transform(DataLocation,EarthLocation)
.pointTrans
- the point transform to use for raster-is-point
coordinate transformations.public LineFeature getBoundingBox(DataLocation upperLeft, DataLocation lowerRight, int segments)
upperLeft
- the upper-left corner of the data window.lowerRight
- the lower-right corner of the data window.segments
- the number of segments along each side of the
data window.public void getWorldAxes(EarthLocation earthLoc, double[] northVector, double[] eastVector)
earthLoc
- the earth location to get the world axes. The location
must transform to a valid data location, or the output vectors may contain
NaN values.northVector
- the north-pointing vector array of length 2 (modified).eastVector
- the east-pointing vector array of length 2 (modified).public EarthLocation transformToPoint(DataLocation dataLoc, EarthLocation earthLoc)
EarthTransform.transform(DataLocation,EarthLocation)
if no point transform is
set with a call to setPointTransform(noaa.coastwatch.util.trans.EarthTransform2D)
. Otherwise, it
passes the data location to the stored point transform.dataLoc
- the data location.earthLoc
- the earth location or null. If null, an object
is created and returned. If non-null, the object is simply
modified.Double.NaN
if no conversion is possible.EarthTransform.transform(DataLocation)
public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception