57 LambertConformal::LambertConformal(
Pvl &label,
bool allowDefaults) :
65 if ((allowDefaults) && (!mapGroup.
hasKeyword(
"CenterLongitude"))) {
72 if ((allowDefaults) && (!mapGroup.
hasKeyword(
"CenterLatitude"))) {
87 message +=
"] must be between -360 and 360";
96 m_par1 = mapGroup[
"FirstStandardParallel"];
100 m_par2 = mapGroup[
"SecondStandardParallel"];
107 QString message =
"Standard Parallels must between -90 and 90";
111 QString message =
"Standard Parallels cannot be symmetric to the equator";
137 message +=
"] is not valid, it projects to infinity " 138 "for standard parallels [";
145 message +=
"] is not valid, it projects to infinity " 146 "for standard parallels [";
159 double sinpar1 = sin(
m_par1);
160 double cospar1 = cos(
m_par1);
161 double m1 =
mCompute(sinpar1, cospar1);
164 double sinpar2 = sin(
m_par2);
165 double cospar2 = cos(
m_par2);
166 double m2 =
mCompute(sinpar2, cospar2);
174 m_n = log(m1 / m2) / log(t1 / t2);
183 QString message =
"Invalid label group [Mapping]";
201 if (!Projection::operator==(proj))
return false;
216 return "LambertConformal";
255 double lonRadians = lon *
PI / 180.0;
260 double latRadians = lat;
262 latRadians *=
PI / 180.0;
266 if (fabs(fabs(latRadians) -
HALFPI) < DBL_EPSILON) {
268 if (latRadians *
m_n <= 0.0) {
275 double sinlat = sin(latRadians);
277 double t =
tCompute(latRadians, sinlat);
283 double x = rh * sin(theta);
284 double y =
m_rho - rh * cos(theta);
310 if (
m_n >= 0) sign = 1.0;
314 double rh = sign * sqrt(
GetX() *
GetX() + temp * temp);
317 if (rh != 0) theta = atan2(sign *
GetX(), sign * temp);
321 if (rh != 0 ||
m_n > 0) {
378 double &minY,
double &maxY) {
389 bool north_hemi =
true;
394 if (
m_par2 < 0.0) north_hemi =
false;
403 double pole_north, min_lat_north, max_lat_north, londiff;
425 double y = min_lat_north + 2.0 * (pole_north - min_lat_north);
435 for (
int i = 0; i < 3; i++) {
466 double y = max_lat_north - 2.0 * (max_lat_north - pole_north);
476 for (
int i = 0; i < 3; i++) {
558 bool allowDefaults) {
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
double mCompute(const double sinphi, const double cosphi) const
A convience method to compute Snyder's m equation (14-15) for a given latitude, . ...
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
double tCompute(const double phi, const double sinphi) const
A convience method to compute Snyder's t equation (15-9) for a given latitude, .
const double PI
The mathematical constant PI.
Longitude values increase in the westerly direction.
Base class for Map TProjections.
const double HALFPI
The mathematical constant PI/2.
Namespace for the standard library.
double GetX() const
Calculates the unrotated form of current x value.
double XCoord() const
This returns the projection X provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
double m_minimumX
The data elements m_minimumX, m_minimumY, m_maximumX, and m_maximumY are convience data elements when...
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
A type of error that occurred when performing an actual I/O operation.
void SetComputedXY(double x, double y)
This protected method is a helper for derived classes.
double m_latitude
This contains the currently set latitude value.
virtual PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
double m_maximumY
See minimumX description.
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_maximumLongitude
Contains the maximum longitude for the entire ground range.
double m_minimumLatitude
Contains the minimum latitude for the entire ground range.
double m_maximumLatitude
Contains the maximum latitude for the entire ground range.
Base class for Map Projections.
double m_minimumY
See minimumX description.
double m_equatorialRadius
Polar radius of the target.
Contains multiple PvlContainers.
#define _FILEINFO_
Macro for the filename and line number.
A single keyword-value pair.
A type of error that cannot be classified as any of the other error types.
double YCoord() const
This returns the projection Y provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
Container for cube-like labels.
double ToPlanetographic(const double lat) const
This method converts a planetocentric latitude to a planetographic latitude.
double phi2Compute(const double t) const
A convience method to compute latitude angle phi2 given small t, from Syder's recursive equation (7-9...
virtual PvlGroup Mapping()
This function returns the keywords that this projection uses.
bool m_good
Indicates if the contents of m_x, m_y, m_latitude, and m_longitude are valid.
LongitudeDirection m_longitudeDirection
An enumerated type indicating the LongitudeDirection read from the labels.
Adds specific functionality to C++ strings.
Namespace for ISIS/Bullet specific routines.
double GetY() const
Calculates the unrotated form of the current y value.
double ToPlanetocentric(const double lat) const
This method converts a planetographic latitude to a planetocentric latitude.
virtual PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
void SetXY(double x, double y)
This protected method is a helper for derived classes.
void XYRangeCheck(const double latitude, const double longitude)
This convience function is established to assist in the development of the XYRange virtual method...
double m_minimumLongitude
Contains the minimum longitude for the entire ground range.
double m_maximumX
See minimumX description.
PvlGroup m_mappingGrp
Mapping group that created this projection.