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) {