Package ucar.visad

Class ProjectionCoordinateSystem

All Implemented Interfaces:
Serializable, XmlPersistable

public class ProjectionCoordinateSystem extends MapProjection implements XmlPersistable
Adapts a ucar.unidata.Projection into a VisAD MapProjection CoordinateSystem. Transforms between world coordinates (x,y) in km and lat/lon in degrees. Reference is lat/lon (RealTupleType.LatitudeLongitudeTuple)
Version:
$Revision: 1.25 $ $Date: 2006/08/18 17:28:41 $
Author:
Don Murray
See Also:
  • Field Details

    • debug

      public static boolean debug
      _more_
  • Constructor Details

    • ProjectionCoordinateSystem

      public ProjectionCoordinateSystem(ucar.unidata.geoloc.ProjectionImpl projection) throws VisADException
      Constructs an instance from the supplied Projection. The reference coordinate system is RealTupleType.LatitudeLongitudeTuple; the incoming units are assumed to be km (1000 m).
      Parameters:
      projection - projection to adapt
      Throws:
      VisADException
    • ProjectionCoordinateSystem

      public ProjectionCoordinateSystem(ucar.unidata.geoloc.ProjectionImpl projection, Unit[] units) throws VisADException
      Constructs an instance from the supplied Projection. The reference coordinate system is RealTupleType.LatitudeLongitudeTuple; the incoming units are assumed to be km (1000 m).
      Parameters:
      projection - projection to adapt
      units - units to use
      Throws:
      VisADException
  • Method Details

    • toString

      public String toString()
      Override the parent toString method to use the contained ProjectionImpl's name
      Overrides:
      toString in class MapProjection
      Returns:
      string representation
    • getDefaultMapArea

      public Rectangle2D getDefaultMapArea()
      Get a reasonable bounding box in this coordinate system. MapProjections are typically specific to an area of the world; there's no bounding box that works for all projections so each subclass must implement this method.
      Specified by:
      getDefaultMapArea in class MapProjection
      Returns:
      the default MapArea of the Projection
    • getProjection

      public ucar.unidata.geoloc.ProjectionImpl getProjection()
      Get the Projection used for the transformations.
      Returns:
      projection
    • toReference

      public double[][] toReference(double[][] world) throws VisADException
      Convert world coordinates to lat/lon. Input coords are in km.
      Specified by:
      toReference in class CoordinateSystem
      Parameters:
      world - world projection coordinates (x = world[0][i])
      Returns:
      corresponding lat/lon values (lat = latlon[0][i])
      Throws:
      VisADException - world coordinate array length != 2
    • fromReference

      public double[][] fromReference(double[][] latlon) throws VisADException
      Convert lat/lon coordinates to world (projection) coords.
      Specified by:
      fromReference in class CoordinateSystem
      Parameters:
      latlon - lat/lon values (lat = latlon[0][i])
      Returns:
      world projection coordinates (x = world[0][i])
      Throws:
      VisADException - latlon coordinate array length != 2
    • toReference

      public float[][] toReference(float[][] world) throws VisADException
      Convert world coordinates to lat/lon. Input coords are in km.
      Overrides:
      toReference in class CoordinateSystem
      Parameters:
      world - world projection coordinates (x = world[0][i])
      Returns:
      corresponding lat/lon values (lat = latlon[0][i])
      Throws:
      VisADException - world coordinate array length != 2
    • fromReference

      public float[][] fromReference(float[][] latlon) throws VisADException
      Convert lat/lon coordinates to world (projection) coords.
      Overrides:
      fromReference in class CoordinateSystem
      Parameters:
      latlon - lat/lon values (lat = latlon[0][i])
      Returns:
      world projection coordinates (x = world[0][i])
      Throws:
      VisADException - latlon coordinate array length != 2
    • equals

      public boolean equals(Object obj)
      Check for equality of CoordinateSystem objects
      Specified by:
      equals in class CoordinateSystem
      Parameters:
      obj - other object in question
      Returns:
      true if the object in question is a ProjectionCoordinateSystem and it's Projection is equal the this object's Projection
    • createElement

      public Element createElement(XmlEncoder encoder)
      Create the XML to represent this object.
      Specified by:
      createElement in interface XmlPersistable
      Parameters:
      encoder - encoder to use
      Returns:
      Element that represents this object.
    • initFromXml

      public boolean initFromXml(XmlEncoder encoder, Element node)
      Do nothing, return true to tell the encoder that it is ok to process any methods or properties.
      Specified by:
      initFromXml in interface XmlPersistable
      Parameters:
      encoder - encoder to use
      node - node to process
      Returns:
      true