MapTransformation class

The MapTransformation manages forward and reverse transformations in the coordinate space defined by various map projections.


Synopsis

Header file:		ncarg/hlu/MapTransformation.h
Class name:		mapTransformationClass
Class pointer:		<Not referenceable>
Fortran class function:	<Not referenceable>
Supeclass:		Transformation
Composite classes:	<None>

Class-defined types

Type name:		NhlTMapLimitMode
Definition:
typedef enum _NhlMapLimitMode {
	NhlMAXIMALAREA	= 0,	/* "MaximalArea" */ 
	NhlLATLON	= 1,	/* "LatLon"	 */ 
	NhlANGLES	= 2,	/* "Angles"	 */ 
	NhlNPC		= 3,	/* "NPC"	 */
	NhlNDC		= 4,	/* "NDC"	 */
	NhlCORNERS	= 5,	/* "Corners"	 */ 
	NhlPOINTS	= 6,	/* "Points"	 */
	NhlWINDOW	= 7	/* "Window"	 */ 
} NhlMapLimitMode;

Type name:		NhlTProjection
Definition:
typedef enum _NhlProjection {
	NhlORTHOGRAPHIC		  = 0, /* "Orthographic"	   */
	NhlSTEREOGRAPHIC	  = 1, /* "Stereographic"	   */
	NhlLAMBERTEQUALAREA	  = 2, /* "LambertEqualArea"	   */
	NhlGNOMONIC		  = 3, /* "Gnomonic"		   */
	NhlAZIMUTHALEQUIDISTANT	  = 4, /* "AzimuthalEquidistant"   */
	NhlSATELLITE		  = 5, /* "Satellite"		   */
	NhlMOLLWEIDE		  = 6, /* "Mollweide"		   */
	NhlMERCATOR		  = 7, /* "Mercator"		   */
	NhlCYLINDRICALEQUIDISTANT = 8, /* "CylindricalEquidistant" */
	NhlLAMBERTCONFORMAL	  = 9  /* "LambertConformal"	   */
} NhlProjection;

Resources

Local resources

You may access MapTransformation resources only through objects that instantiate a MapTransformation child object. These include:
+---------------------------------------------------------------+
|			MapTransformation Resource Set		|
|---------------------------------------------------------------|
| NAME				TYPE			ACCESS	|
|	CLASS				DEFAULT			|
|===============================================================|
| mpProjection                  NhlTProjection          RCSG    |
|       MpProjection                  "CylindricalEquidistant"  |
|---------------------------------------------------------------|
| mpLeftMapPosF                 NhlTFloat               G       |
|       MpLeftMapPosF                   <dynamic>               |
|---------------------------------------------------------------|
| mpRightMapPosF                NhlTFloat               G       |
|       MpRightMapPosF                  <dynamic>               |
|---------------------------------------------------------------|
| mpBottomMapPosF               NhlTFloat               G       |
|       MpBottomMapPosF                 <dynamic>               |
|---------------------------------------------------------------|
| mpTopMapPosF                  NhlTFloat               G       |
|       MpTopMapPosF                    <dynamic>               |
|---------------------------------------------------------------|
| mpCenterLatF                  NhlTFloat               RCSG    |
|       MpCenterLatF                    0.0                     |
|---------------------------------------------------------------|
| mpCenterLonF                  NhlTFloat               RCSG    |
|       MpCenterLonF                    0.0                     |
|---------------------------------------------------------------|
| mpCenterRotF                  NhlTFloat               RCSG    |
|       MpCenterRotF                    0.0                     |
|---------------------------------------------------------------|
| mpLimitMode                   NhlTMapLimitMode        RCSG    |
|       MpLimitMode                     "MaximalArea"           |
|---------------------------------------------------------------|
| mpMinLatF                     NhlTFloat               RCSG    |
|       MpMinLatF                       -90.0                   |
|---------------------------------------------------------------|
| mpMaxLatF                     NhlTFloat               RCSG    |
|       MpMaxLatF                       90.0                    |
|---------------------------------------------------------------|
| mpMinLonF                     NhlTFloat               RCSG    |
|       MpMinLonF                       -180.0                  |
|---------------------------------------------------------------|
| mpMaxLonF                     NhlTFloat               RCSG    |
|       MpMaxLonF                       180.0                   |
|---------------------------------------------------------------|
| mpRelativeCenterLat           NhlTBoolean             RCSG    |
|       MpRelativeCenterLat             False                   |
|---------------------------------------------------------------|
| mpRelativeCenterLon           NhlTBoolean             RCSG    |
|       MpRelativeCenterLon             False                   |
|---------------------------------------------------------------|
| mpLeftAngleF                  NhlTFloat               RCSG    |
|       MpLeftAngleF                    80.0                    |
|---------------------------------------------------------------|
| mpRightAngleF                 NhlTFloat               RCSG    |
|       MpRightAngleF                   80.0                    |
|---------------------------------------------------------------|
| mpBottomAngleF                NhlTFloat               RCSG    |
|       MpBottomAngleF                  80.0                    |
|---------------------------------------------------------------|
| mpTopAngleF                   NhlTFloat               RCSG    |
|       MpTopAngleF                     80.0                    |
|---------------------------------------------------------------|
| mpLeftNPCF                    NhlTFloat               RCSG    |
|       MpLeftNPCF                      0.0                     |
|---------------------------------------------------------------|
| mpRightNPCF                   NhlTFloat               RCSG    |
|       MpRightNPCF                     1.0                     |
|---------------------------------------------------------------|
| mpBottomNPCF                  NhlTFloat               RCSG    |
|       MpBottomNPCF                    0.0                     |
|---------------------------------------------------------------|
| mpTopNPCF                     NhlTFloat               RCSG    |
|       MpTopNPCF                       1.0                     |
|---------------------------------------------------------------|
| mpLeftNDCF                    NhlTFloat               RCSG    |
|       MpLeftNDCF                      <dynamic>               |
|---------------------------------------------------------------|
| mpRightNDCF                   NhlTFloat               RCSG    |
|       MpRightNDCF                     <dynamic>               |
|---------------------------------------------------------------|
| mpBottomNDCF                  NhlTFloat               RCSG    |
|       MpBottomNDCF                    <dynamic>               |
|---------------------------------------------------------------|
| mpTopNDCF                     NhlTFloat               RCSG    |
|       MpTopNDCF                       <dynamic>               |
|---------------------------------------------------------------|
| mpLeftCornerLatF              NhlTFloat               RCSG    |
|       MpLeftCornerLatF                0.0                     |
|---------------------------------------------------------------|
| mpLeftCornerLonF              NhlTFloat               RCSG    |
|       MpLeftCornerLonF                0.0                     |
|---------------------------------------------------------------|
| mpRightCornerLatF             NhlTFloat               RCSG    |
|       MpRightCornerLatF               0.0                     |
|---------------------------------------------------------------|
| mpRightCornerLonF             NhlTFloat               RCSG    |
|       MpRightCornerLonF               0.0                     |
|---------------------------------------------------------------|
| mpLeftPointLatF               NhlTFloat               RCSG    |
|       MpLeftPointLatF                 0.0                     |
|---------------------------------------------------------------|
| mpLeftPointLonF               NhlTFloat               RCSG    |
|       MpLeftPointLonF                 0.0                     |
|---------------------------------------------------------------|
| mpRightPointLatF              NhlTFloat               RCSG    |
|       MpRightPointLatF                0.0                     |
|---------------------------------------------------------------|
| mpRightPointLonF              NhlTFloat               RCSG    |
|       MpRightPointLonF                0.0                     |
|---------------------------------------------------------------|
| mpBottomPointLatF             NhlTFloat               RCSG    |
|       MpBottomPointLatF               0.0                     |
|---------------------------------------------------------------|
| mpBottomPointLonF             NhlTFloat               RCSG    |
|       MpBottomPointLonF               0.0                     |
|---------------------------------------------------------------|
| mpTopPointLatF                NhlTFloat               RCSG    |
|       MpTopPointLatF                  0.0                     |
|---------------------------------------------------------------|
| mpTopPointLonF                NhlTFloat               RCSG    |
|       MpTopPointLonF                  0.0                     |
|---------------------------------------------------------------|
| mpLeftWindowF                 NhlTFloat               RCSG    |
|       MpLeftWindowF                   0.0                     |
|---------------------------------------------------------------|
| mpRightWindowF                NhlTFloat               RCSG    |
|       MpRightWindowF                  0.0                     |
|---------------------------------------------------------------|
| mpBottomWindowF               NhlTFloat               RCSG    |
|       MpBottomWindowF                 0.0                     |
|---------------------------------------------------------------|
| mpTopWindowF                  NhlTFloat               RCSG    |
|       MpTopWindowF                    0.0                     |
|---------------------------------------------------------------|
| mpLambertParallel1F           NhlTFloat               RCSG    |
|       MpLambertParallel1F             .001                    |
|---------------------------------------------------------------|
| mpLambertParallel2F           NhlTFloat               RCSG    |
|       MpLambertParallel2F             89.999                  |
|---------------------------------------------------------------|
| mpLambertMeridianF            NhlTFloat               RCSG    |
|       MpLambertMeridianF              0.0                     |
|---------------------------------------------------------------|
| mpSatelliteDistF              NhlTFloat               RCSG    |
|       MpSatelliteDistF                1.0                     |
|---------------------------------------------------------------|
| mpSatelliteAngle1F            NhlTFloat               RCSG    |
|       MpSatelliteAngle1F              0.0                     |
|---------------------------------------------------------------|
| mpSatelliteAngle2F            NhlTFloat               RCSG    |
|       MpSatelliteAngle2F              0.0                     |
|---------------------------------------------------------------|
| mpEllipticalBoundary          NhlTBoolean             RCSG    |
|       MpEllipticalBoundary            False                   |
|---------------------------------------------------------------|
| mpGreatCircleLinesOn          NhlTBoolean             RCSG    |
|       MpGreatCircleLinesOn            False                   |
+---------------------------------------------------------------+

Composite resources

The MapTransformation class has no composite class objects.

Superclass resources

MapTransformation disables access to all the resources of its Transformation superclass.

Description

The MapTransformation object manages forward and reverse transformations between a two-dimensional rectangular data coordinate space representing latitude along the vertical axis and longitude along the horizontal axis and any of its 10 supported map projections. The data space extent may coincide with, encompass, or arbitrarily intersect the projected extent.

Creation and access to resources

You do not create objects of the MapTransformation class directly. You may, however, set its resources via objects that instantiate a MapTransformation child. Currently, the MapPlot object is the only HLU library object with a MapTransformation child; it allows access all resources of the MapTransformation class, depending on it to provide transformations of data representing geophysical and political regions of the earth. Using the MapPlot as a base plot, you can provide map transformations for data associated with other plot object types. In addition, you can transform graphics primitives defined in lat-lon data space into any of the map projections.

Setting the projection and map boundaries

You define a map transformation by setting the mpProjection resource, and then in most cases, choosing a center of projection and a rotation angle using the resources, mpCenterLatF, mpCenterLonF, and mpCenterRotF. Then you choose a method for defining the visible extent of the global surface using the mpLimitMode resource. This resource has eight possible settings:

LambertConformal projection resources

When the conic projection LambertConformal is set, the MapTransformation ignores the projection center and rotation resources. Instead, use mpLambertParallel1F and mpLambertParallel2F to set the two latitudinal edges of the cone, and use mpLambertMeridianF to set its longitudinal center.

Satellite projection resources

If the projection is Satellite, the MapTransformation provides several additional resources for controlling the perspective effect. mpSatelliteDistF defines the distance of the viewing satellite from the center of the globe in multiples of the global radius. mpSatelliteAngle1F defines the angular deviation of the line of sight from a line between the satellite position and the center of the globe. mpSatelliteAngle2F defines the direction of the angular deviation of the line of sight as a rotation from the horizontal axis of the viewplane.

Elliptical boundary

For any of the projections, you can set a resource, mpEllipticalBoundary, that limits the perimeter of the viewable area to an ellipse inscribed within the rectangular viewport.

Graphic primitive transformations

MapTransformation supports transformation into any of the map projections of graphic primitives using the data space primitive drawing routines NhlDataPolygon, NhlDataPolyline, and NhlDataPolymarker. Depending on the setting of the boolean resource mpGreatCircleLinesOn, lines or edges spanning the space between the user-supplied points of a polyline or polygon may be transformed in two different ways. One treats the lat-lon grid as a cartesian system; the other calculates the great circle route (the shortest distance on the surface of the globe) between each set of points.

Support functions

The MapTransformation object does not define any support functions, but inherits all the support functions available to its superclass.

Status

2. Range checking is inadequate for a number of the MapTransformation resources including mpLambertMeridianF, mpLambertParallel2F, mpLambertParallel1F, mpCenterLatF, and mpCenterLonF.

3. When mpCenterRotF has a non-zero value and mpMapLimitMode is set to NhlANGLES, it is possible that errors may occur even when the angle values are within the documented limits. This occurs in certain situations that have so far proved to be difficult to pin down. More work is required.


See also


Copyright

Copyright 1987-1999 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.

NCAR Graphics is a registered trademark of the University Corporation for Atmospheric Research.

Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?


$Revision: 1.5 $ $Date: 1998/08/18 21:49:05 $