Package ucar.visad
Class ProjectionCoordinateSystem
java.lang.Object
visad.CoordinateSystem
visad.georef.NavigatedCoordinateSystem
visad.georef.MapProjection
ucar.visad.ProjectionCoordinateSystem
- All Implemented Interfaces:
Serializable
,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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProjectionCoordinateSystem
(ucar.unidata.geoloc.ProjectionImpl projection) Constructs an instance from the supplied Projection.ProjectionCoordinateSystem
(ucar.unidata.geoloc.ProjectionImpl projection, Unit[] units) Constructs an instance from the supplied Projection. -
Method Summary
Modifier and TypeMethodDescriptioncreateElement
(XmlEncoder encoder) Create the XML to represent this object.boolean
Check for equality of CoordinateSystem objectsdouble[][]
fromReference
(double[][] latlon) Convert lat/lon coordinates to world (projection) coords.float[][]
fromReference
(float[][] latlon) Convert lat/lon coordinates to world (projection) coords.Get a reasonable bounding box in this coordinate system.ucar.unidata.geoloc.ProjectionImpl
Get the Projection used for the transformations.boolean
initFromXml
(XmlEncoder encoder, Element node) Do nothing, return true to tell the encoder that it is ok to process any methods or properties.double[][]
toReference
(double[][] world) Convert world coordinates to lat/lon.float[][]
toReference
(float[][] world) Convert world coordinates to lat/lon.toString()
Override the parent toString method to use the contained ProjectionImpl's nameMethods inherited from class visad.georef.MapProjection
getCenterLatLon, getFlipX, getFlipY, getLatLon, getXIndex, getYIndex, isLatLonOrder, isXYOrder
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
-
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 adaptunits
- units to use- Throws:
VisADException
-
-
Method Details
-
toString
Override the parent toString method to use the contained ProjectionImpl's name- Overrides:
toString
in classMapProjection
- Returns:
- string representation
-
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 classMapProjection
- Returns:
- the default MapArea of the Projection
-
getProjection
public ucar.unidata.geoloc.ProjectionImpl getProjection()Get the Projection used for the transformations.- Returns:
- projection
-
toReference
Convert world coordinates to lat/lon. Input coords are in km.- Specified by:
toReference
in classCoordinateSystem
- 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
Convert lat/lon coordinates to world (projection) coords.- Specified by:
fromReference
in classCoordinateSystem
- 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
Convert world coordinates to lat/lon. Input coords are in km.- Overrides:
toReference
in classCoordinateSystem
- 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
Convert lat/lon coordinates to world (projection) coords.- Overrides:
fromReference
in classCoordinateSystem
- 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
Check for equality of CoordinateSystem objects- Specified by:
equals
in classCoordinateSystem
- 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
Create the XML to represent this object.- Specified by:
createElement
in interfaceXmlPersistable
- Parameters:
encoder
- encoder to use- Returns:
- Element that represents this object.
-
initFromXml
Do nothing, return true to tell the encoder that it is ok to process any methods or properties.- Specified by:
initFromXml
in interfaceXmlPersistable
- Parameters:
encoder
- encoder to usenode
- node to process- Returns:
- true
-