7#include "PolarStereographic.h"
14#include "IException.h"
15#include "TProjection.h"
18#include "PvlKeyword.h"
50 if ((allowDefaults) && (!mapGroup.hasKeyword(
"CenterLongitude"))) {
57 if ((allowDefaults) && (!mapGroup.hasKeyword(
"CenterLatitude"))) {
77 QString msg =
"Invalid value for keyword [CenterLatitude] in map file.";
78 msg +=
" CenterLatitude cannot equal 0.0";
94 double sinphi = sin(phi);
95 double cosphi = cos(phi);
107 QString message =
"Invalid label group [Mapping]";
127 if (!Projection::operator==(proj))
return false;
143 return "PolarStereographic";
186 double lonRadians = lon *
PI / 180.0;
191 double latRadians = lat;
193 latRadians = latRadians *
PI / 180.0;
198 double sinphi = sin(phi);
242 double dist = sqrt(east * east + north * north);
258 QString msg =
"X,Y causes latitude to be outside [-90,90] "
259 "in PolarStereographic Class";
310 double &minY,
double &maxY) {
402 bool allowDefaults) {
@ Unknown
A type of error that cannot be classified as any of the other error types.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
@ Programmer
This error is for when a programmer made an API call that was illegal.
Stereographic Map Projection for Polar Aspect.
PvlGroup Mapping()
This function returns the keywords that this projection uses.
QString Name() const
Returns the name of the map projection, "PolarStereographic".
~PolarStereographic()
Destroys the PolarStereographic object.
PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
bool operator==(const Projection &proj)
Compares two Projection objects to see if they are equal.
double TrueScaleLatitude() const
Returns the latitude of true scale.
double m_t
Snyder's t-value from equation (15-19).
double m_signFactor
If the center latitude is positive, the sign factor is 1.
double m_centerLatitude
The center latitude for the map projection.
double m_m
Snyder's m-value from equation (14-15).
double m_poleFlag
Indicates whether the center latitude is at a pole.
bool SetGround(const double lat, const double lon)
This method is used to set the latitude/longitude (assumed to be of the correct LatitudeType,...
double m_e4
Convenience variable for calculations.
bool XYRange(double &minX, double &maxX, double &minY, double &maxY)
This method is used to determine the x/y range which completely covers the area of interest specified...
bool SetCoordinate(const double x, const double y)
This method is used to set the projection x/y.
QString Version() const
Returns the version of the map projection.
PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
PolarStereographic(Pvl &label, bool allowDefaults=false)
Constructs a PolarStereographic object.
double m_centerLongitude
The center longitude for the map projection.
Base class for Map Projections.
double m_maximumX
See minimumX description.
double GetX() const
Calculates the unrotated form of current x value.
bool m_good
Indicates if the contents of m_x, m_y, m_latitude, and m_longitude are valid.
double m_minimumX
The data elements m_minimumX, m_minimumY, m_maximumX, and m_maximumY are convience data elements when...
PvlGroup m_mappingGrp
Mapping group that created this projection.
double m_minimumY
See minimumX description.
double GetY() const
Calculates the unrotated form of the current y value.
void SetXY(double x, double y)
This protected method is a helper for derived classes.
double m_maximumY
See minimumX description.
void SetComputedXY(double x, double y)
This protected method is a helper for derived classes.
Contains multiple PvlContainers.
Container for cube-like labels.
A single keyword-value pair.
@ Traverse
Search child objects.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Base class for Map TProjections.
double m_longitude
This contains the currently set longitude value.
bool IsPlanetocentric() const
This indicates if the latitude type is planetocentric (as opposed to planetographic).
double m_minimumLatitude
Contains the minimum latitude for the entire ground range.
double m_maximumLongitude
Contains the maximum longitude for the entire ground range.
static double To180Domain(const double lon)
This method converts a longitude into the -180 to 180 domain.
double m_equatorialRadius
Polar radius of the target.
LongitudeDirection m_longitudeDirection
An enumerated type indicating the LongitudeDirection read from the labels.
virtual PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
int m_longitudeDomain
This integer is either 180 or 360 and is read from the labels.
double mCompute(const double sinphi, const double cosphi) const
A convience method to compute Snyder's m equation (14-15) for a given latitude, .
double ToPlanetocentric(const double lat) const
This method converts a planetographic latitude to a planetocentric latitude.
void XYRangeCheck(const double latitude, const double longitude)
This convience function is established to assist in the development of the XYRange virtual method.
virtual PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
double phi2Compute(const double t) const
A convience method to compute latitude angle phi2 given small t, from Syder's recursive equation (7-9...
double m_minimumLongitude
Contains the minimum longitude for the entire ground range.
double e4Compute() const
A convience method to compute.
double tCompute(const double phi, const double sinphi) const
A convience method to compute Snyder's t equation (15-9) for a given latitude, .
@ PositiveWest
Longitude values increase in the westerly direction.
double m_maximumLatitude
Contains the maximum latitude for the entire ground range.
static double To360Domain(const double lon)
This method converts a longitude into the 0 to 360 domain.
virtual PvlGroup Mapping()
This function returns the keywords that this projection uses.
double ToPlanetographic(const double lat) const
This method converts a planetocentric latitude to a planetographic latitude.
double m_latitude
This contains the currently set latitude value.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
const double HALFPI
The mathematical constant PI/2.
const double PI
The mathematical constant PI.
Namespace for the standard library.