The MapTransformation manages forward and reverse transformations in the coordinate space defined by various map projections.
Header file: ncarg/hlu/MapTransformation.h Class name: mapTransformationClass Class pointer: <Not referenceable> Fortran class function: <Not referenceable> Supeclass: Transformation Composite classes: <None>
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;
+---------------------------------------------------------------+ | 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 | +---------------------------------------------------------------+
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.
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:
MaximalArea
mode shows the maximum possible
visible area depending on the projection. The
MapTransformation ignores all other extent limiting
resources when this mode is set.
LatLon
mode defines a rectangular area bounded by
minimum and maximum latitudes and longitudes, and shows as much of
this area as possible given the projection and the current projection
center. Set the latitude boundaries using mpMinLatF and mpMaxLatF and the
longitude boundaries using mpMinLonF and mpMaxLonF. Two other
resources apply only when using LatLon
limit mode. These
are the boolean resources mpRelativeCenterLon
and mpRelativeCenterLat.
When mpRelativeCenterLon is set True the value of the
mpCenterLonF resource is interpreted as an offset in degrees
from the longitude halfway between mpMinLonF and
mpMaxLonF. Setting mpRelativeCenterLat True
similarly modifies the interpretation of the mpCenterLatF resource.
Angles
mode limits the area based on positive angular
distance in degrees away from the projection center in the four
directions parallel to a side of the viewport (not
necessarily parallel to lines of latitude and longitude). Use the
resources mpLeftAngleF, mpRightAngleF,
mpBottomAngleF,
and mpTopAngleF to
set angular limits. You cannot use this mode when the conic
projection, LambertConformal
, is set. Also, if
mpProjection has the value Satellite
, the
MapTransformation interprets the angles as deviations
from the line of sight of the viewing satellite.
NPC
mode limits the area based on "Normalized
Projection Coordinates", which map the maximal area of the projection
into a rectangle bounded by 0.0 and 1.0 horizontally and
vertically. Use the resources mpLeftNPCF, mpRightNPCF, mpBottomNPCF, and mpTopNPCF to set
normalized projection coordinate limits. Note that the
MapTransformation keeps the NPC resources updated to their
current value no matter which map limit mode is currently in effect.
NDC
mode limits the area based on the current location of
the projected map in Normalized Device Coordinates. Use the resources
mpLeftNDCF, mpRightNDCF, mpBottomNDCF, and mpTopNDCF to set
normalized device coordinate limits. Note that each time these
resources are applied using a SetValues call the mapping between NDC
and the projected area changes. At the completion of a SetValues call,
the MapTransformation internally sets the value of each of
these resources to the new location of the original projected coordinate:
that is, to one of the boundaries of the projected area.
Corners
mode limits the area to a rectangle with
corners defined by the values of the resources mpLeftCornerLatF,
mpLeftCornerLonF,
mpRightCornerLatF,
and mpLeftCornerLonF.
Points
mode limits the area to a rectangle containing the
four points defined by the values of the resources
mpLeftPointLatF,
mpLeftPointLonF,
mpRightPointLatF,
mpRightPointLonF,
mpBottomPointLatF,
mpBottomPointLonF,
mpTopPointLatF, and
mpTopPointLonF
Window
mode limits the area based on the intermediate
"window" coordinate system used by the low level utilities. You set
window coordinate limits using the resources mpLeftWindowF, mpRightWindowF, mpBottomWindowF,
and mpTopWindowF. The
MapTransformation keeps the window coordinate system
resources updated to their current values no matter which map limit
mode is currently in effect.
LambertConformal
projection resourcesLambertConformal
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 resourcesSatellite
, 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.
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.
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.
NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?