visad.georef
Class TrivialMapProjection

java.lang.Object
  extended by visad.CoordinateSystem
      extended by visad.georef.NavigatedCoordinateSystem
          extended by visad.georef.MapProjection
              extended by visad.georef.TrivialMapProjection
All Implemented Interfaces:
Serializable

public class TrivialMapProjection
extends MapProjection

A trivial implementation for a MapProjection which provides an identity coordinate system with a default bounding box. This is useful for defining an area in LatLon or LonLat space with a bounding box. What goes in, comes right back out.

See Also:
Serialized Form

Constructor Summary
TrivialMapProjection()
          Create a MapProjection that just returns the input tuple.
TrivialMapProjection(RealTupleType reference)
          Create a MapProjection that just returns the input tuple.
TrivialMapProjection(RealTupleType type, Rectangle2D bounds)
          Create a MapProjection that just returns the input tuple.
 
Method Summary
 boolean equals(Object o)
          See if the object in question is equal to this CoordinateSystem.
 double[][] fromReference(double[][] refTuple)
          Transform from the reference coordinates
 float[][] fromReference(float[][] refTuple)
          Transform from the reference coordinates
 Rectangle2D getDefaultMapArea()
          Get a reasonable bounding box in this coordinate system.
 double[][] toReference(double[][] tuple)
          Transform to the reference coordinates
 float[][] toReference(float[][] tuple)
          Transform to the reference coordinates
 
Methods inherited from class visad.georef.MapProjection
getCenterLatLon, getLatLon, getXIndex, getYIndex, isLatLonOrder, isXYOrder, toString
 
Methods inherited from class visad.georef.NavigatedCoordinateSystem
getLatitudeIndex, getLongitudeIndex
 
Methods inherited from class visad.CoordinateSystem
canConvert, fromReference, fromReference, getCoordinateSystemUnits, getDimension, getReference, getReferenceUnits, toReference, toReference, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinatesFreeUnits, transformCoordinatesFreeUnits
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrivialMapProjection

public TrivialMapProjection()
                     throws VisADException
Create a MapProjection that just returns the input tuple. Default Map area is set to be from (-180,-90) to (180, 90)

Throws:
VisADException - reference does not contain Latitude/Longitude or couldn't create the necessary VisAD object

TrivialMapProjection

public TrivialMapProjection(RealTupleType reference)
                     throws VisADException
Create a MapProjection that just returns the input tuple.

Parameters:
reference - reference RealTupleType
Throws:
VisADException - reference does not contain Latitude/Longitude or couldn't create the necessary VisAD object

TrivialMapProjection

public TrivialMapProjection(RealTupleType type,
                            Rectangle2D bounds)
                     throws VisADException
Create a MapProjection that just returns the input tuple.

Parameters:
type - reference RealTupleType
bounds - rectangle bounds
Throws:
VisADException - reference does not contain Latitude/Longitude or couldn't create the necessary VisAD object
Method Detail

toReference

public double[][] toReference(double[][] tuple)
                       throws VisADException
Transform to the reference coordinates

Specified by:
toReference in class CoordinateSystem
Parameters:
tuple - array of values
Returns:
input array
Throws:
VisADException - tuple is null or wrong dimension

fromReference

public double[][] fromReference(double[][] refTuple)
                         throws VisADException
Transform from the reference coordinates

Specified by:
fromReference in class CoordinateSystem
Parameters:
refTuple - array of values
Returns:
input array
Throws:
VisADException - tuple is null or wrong dimension

toReference

public float[][] toReference(float[][] tuple)
                      throws VisADException
Transform to the reference coordinates

Overrides:
toReference in class CoordinateSystem
Parameters:
tuple - array of values
Returns:
input array
Throws:
VisADException - tuple is null or wrong dimension

fromReference

public float[][] fromReference(float[][] refTuple)
                        throws VisADException
Transform from the reference coordinates

Overrides:
fromReference in class CoordinateSystem
Parameters:
refTuple - array of values
Returns:
input array
Throws:
VisADException - tuple is null or wrong dimension

equals

public boolean equals(Object o)
See if the object in question is equal to this CoordinateSystem. The two objects are equal if they are the same object or if they are both TrivialMapProjection and have the same dimension.

Specified by:
equals in class CoordinateSystem
Parameters:
o - Object in question
Returns:
true if they are considered equal, otherwise false.

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. For example, the bounding box for a satellite image MapProjection might have an upper left corner of (0,0) and the width and height of the Rectangle2D would be the number of elements and lines, respectively.

Specified by:
getDefaultMapArea in class MapProjection
Returns:
the bounding box of the MapProjection