Class EarthTransform2D

All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
CDMGridMappedProjection, DataProjection, GeoVectorProjection, MapProjection, SensorScanProjection, SwathProjection

public abstract class EarthTransform2D extends EarthTransform
The 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.
Since:
3.2.0
Author:
Peter Hollemans
  • Constructor Details

    • EarthTransform2D

      public EarthTransform2D()
  • Method Details

    • get2DVersion

      public EarthTransform2D get2DVersion()
      Description copied from class: EarthTransform
      Gets a version of this transform that can be used with 2D data locations.
      Specified by:
      get2DVersion in class EarthTransform
      Returns:
      the 2D version of this transform.
    • isOrientable

      public boolean isOrientable()
      Gets the orientation hint. If a transform is orientable, then it may be better for the user to have it rotated for display so that northerly locations occur where data locations have smaller row values and southerly locations occur where data locations have larger row values. If a transform is not orientable, then it should be presented to the user exactly as-is.
      Returns:
      true if the transform is orientable, or false if not. Unless overridden by the subclass, this method returns true.
      Since:
      3.3.1
    • setPointTransform

      public void setPointTransform(EarthTransform2D pointTrans)
      Sets the data to geographic transform used when 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).
      Parameters:
      pointTrans - the point transform to use for raster-is-point coordinate transformations or null to use this transform.
    • getBoundingBox

      public LineFeature getBoundingBox(DataLocation upperLeft, DataLocation lowerRight, int segments)
      Gets a polygon bounding box for this transform using the specified data coordinate limits.
      Parameters:
      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.
    • getWorldAxes

      public void getWorldAxes(EarthLocation earthLoc, double[] northVector, double[] eastVector)
      Gets the world axes for this transform at the specified location. The world axes are the north-pointing unit vector and east-pointing unit vector in data coordinates.
      Parameters:
      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).
      Since:
      3.3.1
    • transformToPoint

      public EarthLocation transformToPoint(DataLocation dataLoc, EarthLocation earthLoc)
      Converts data coordinates to geographic coordinates (raster point mode). By default, this method simply calls EarthTransform.transform(DataLocation,EarthLocation) if no point transform has been set with a call to setPointTransform(noaa.coastwatch.util.trans.EarthTransform2D). Otherwise, it passes the data location to the stored point transform.
      Parameters:
      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.
      Returns:
      the earth location. The earth location may contain Double.NaN if no conversion is possible.
      See Also:
    • main

      public static void main(String[] argv) throws Exception
      Tests this class.
      Parameters:
      argv - the array of command line parameters.
      Throws:
      Exception