forked from ossimlabs/ossim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ossimLambertConformalConicProjection.cpp
647 lines (553 loc) · 21.8 KB
/
ossimLambertConformalConicProjection.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
//*******************************************************************
//
// License: See top LICENSE.txt file.
//
// Author: Garrett Potts
//
// Description:
//
// Calls Lamberts Conformal Conic projection code.
//*******************************************************************
// $Id: ossimLambertConformalConicProjection.cpp 19640 2011-05-25 15:58:00Z oscarkramer $
#include <iostream>
#include <iomanip>
#include <ossim/projection/ossimLambertConformalConicProjection.h>
#include <ossim/base/ossimKeywordNames.h>
RTTI_DEF1(ossimLambertConformalConicProjection, "ossimLambertConformalConicProjection", ossimMapProjection)
/***************************************************************************/
/* DEFINES
*
*/
#ifndef PI_OVER_2
# define PI_OVER_2 ( M_PI / 2.0)
#endif
#ifndef TWO_PI
# define TWO_PI (2.0 * M_PI)
#endif
#define MAX_LAT (( M_PI * 89.99972222222222) / 180.0) /* 89 59 59.0 degrees in radians */
#define LAMBERT_m(clat,essin) (clat / sqrt(1.0 - essin * essin))
#define LAMBERT_t(lat,essin) tan(PI_OVER_4 - lat / 2) / \
pow((1.0 - essin) / (1.0 + essin), es_OVER_2)
#define ES_SIN(sinlat) (es * sinlat)
/**************************************************************************/
/* GLOBAL DECLARATIONS
*
*/
const double PI_OVER_4 = (M_PI / 4.0);
#define LAMBERT_NO_ERROR 0x0000
#define LAMBERT_LAT_ERROR 0x0001
#define LAMBERT_LON_ERROR 0x0002
#define LAMBERT_EASTING_ERROR 0x0004
#define LAMBERT_NORTHING_ERROR 0x0008
#define LAMBERT_FIRST_STDP_ERROR 0x0010
#define LAMBERT_SECOND_STDP_ERROR 0x0020
#define LAMBERT_ORIGIN_LAT_ERROR 0x0040
#define LAMBERT_CENT_MER_ERROR 0x0080
#define LAMBERT_A_ERROR 0x0100
#define LAMBERT_B_ERROR 0x0200
#define LAMBERT_A_LESS_B_ERROR 0x0400
#define LAMBERT_HEMISPHERE_ERROR 0x0800
#define LAMBERT_FIRST_SECOND_ERROR 0x1000
ossimLambertConformalConicProjection::ossimLambertConformalConicProjection(const ossimEllipsoid& ellipsoid,
const ossimGpt& origin)
:ossimMapProjection(ellipsoid, origin)
{
setDefaults();
update();
}
ossimLambertConformalConicProjection::ossimLambertConformalConicProjection(const ossimEllipsoid& ellipsoid,
const ossimGpt& origin,
double stdParallel1,
double stdParallel2,
double falseEasting,
double falseNorthing)
:ossimMapProjection(ellipsoid, origin)
{
Lambert_Std_Parallel_1 = stdParallel1*RAD_PER_DEG;
Lambert_Std_Parallel_2 = stdParallel2*RAD_PER_DEG;
Lambert_False_Easting = falseEasting;
Lambert_False_Northing = falseNorthing;
update();
}
ossimLambertConformalConicProjection::~ossimLambertConformalConicProjection()
{
}
ossimObject* ossimLambertConformalConicProjection::dup()const
{
return new ossimLambertConformalConicProjection(*this);
}
void ossimLambertConformalConicProjection::update()
{
Set_Lambert_Parameters(theEllipsoid.getA(),
theEllipsoid.getFlattening(),
theOrigin.latr(),
theOrigin.lonr(),
Lambert_Std_Parallel_1,
Lambert_Std_Parallel_2,
Lambert_False_Easting,
Lambert_False_Northing);
theFalseEastingNorthing.x = Lambert_False_Easting;
theFalseEastingNorthing.y = Lambert_False_Northing;
ossimMapProjection::update();
}
void ossimLambertConformalConicProjection::setStandardParallel1(double degree)
{
Lambert_Std_Parallel_1 = degree*RAD_PER_DEG;
update();
}
void ossimLambertConformalConicProjection::setStandardParallel2(double degree)
{
Lambert_Std_Parallel_2 = degree*RAD_PER_DEG;
update();
}
void ossimLambertConformalConicProjection::setStandardParallels(double parallel1Degree,
double parallel2Degree)
{
Lambert_Std_Parallel_1 = parallel1Degree*RAD_PER_DEG;
Lambert_Std_Parallel_2 = parallel2Degree*RAD_PER_DEG;
update();
}
void ossimLambertConformalConicProjection::setFalseEasting(double falseEasting)
{
Lambert_False_Easting = falseEasting;
update();
}
void ossimLambertConformalConicProjection::setFalseNorthing(double falseNorthing)
{
Lambert_False_Northing = falseNorthing;
update();
}
void ossimLambertConformalConicProjection::setFalseEastingNorthing(double falseEasting,
double falseNorthing)
{
Lambert_False_Easting = falseEasting;
Lambert_False_Northing = falseNorthing;
update();
}
void ossimLambertConformalConicProjection::setParameters(double parallel1,
double parallel2,
double falseEasting,
double falseNorthing)
{
Lambert_False_Easting = falseEasting;
Lambert_False_Northing = falseNorthing;
Lambert_Std_Parallel_1 = parallel1*RAD_PER_DEG;
Lambert_Std_Parallel_2 = parallel2*RAD_PER_DEG;
update();
}
void ossimLambertConformalConicProjection::setDefaults()
{
Lambert_Std_Parallel_1 = 40*RAD_PER_DEG;
Lambert_Std_Parallel_2 = 50*RAD_PER_DEG;
Lambert_False_Northing = 0.0;
Lambert_False_Easting = 0.0;
}
ossimGpt ossimLambertConformalConicProjection::inverse(const ossimDpt &eastingNorthing)const
{
double lat = 0.0;
double lon = 0.0;
Convert_Lambert_To_Geodetic(eastingNorthing.x,
eastingNorthing.y,
&lat,
&lon);
return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
}
ossimDpt ossimLambertConformalConicProjection::forward(const ossimGpt &latLon)const
{
double easting = 0.0;
double northing = 0.0;
ossimGpt gpt = latLon;
if (theDatum)
{
if (theDatum->code() != latLon.datum()->code())
{
gpt.changeDatum(theDatum); // Shift to our datum.
}
}
Convert_Geodetic_To_Lambert(gpt.latr(),
gpt.lonr(),
&easting,
&northing);
return ossimDpt(easting, northing);
}
bool ossimLambertConformalConicProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
{
kwl.add(prefix,
ossimKeywordNames::STD_PARALLEL_1_KW,
Lambert_Std_Parallel_1*DEG_PER_RAD,
true);
kwl.add(prefix,
ossimKeywordNames::STD_PARALLEL_2_KW,
Lambert_Std_Parallel_2*DEG_PER_RAD,
true);
return ossimMapProjection::saveState(kwl, prefix);
}
bool ossimLambertConformalConicProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
{
bool flag = ossimMapProjection::loadState(kwl, prefix);
const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
const char* stdParallel1 = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_1_KW);
const char* stdParallel2 = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_2_KW);
setDefaults();
if(ossimString(type) == STATIC_TYPE_NAME(ossimLambertConformalConicProjection))
{
Lambert_False_Easting = theFalseEastingNorthing.x;
Lambert_False_Northing = theFalseEastingNorthing.y;
if(stdParallel1)
{
Lambert_Std_Parallel_1 = ossimString(stdParallel1).toDouble()*RAD_PER_DEG;
}
if(stdParallel2)
{
Lambert_Std_Parallel_2 = ossimString(stdParallel2).toDouble()*RAD_PER_DEG;
}
}
update();
return flag;
}
std::ostream& ossimLambertConformalConicProjection::print(
std::ostream& out) const
{
// Capture the original flags.
std::ios_base::fmtflags f = out.flags();
out << setiosflags(ios::fixed) << setprecision(15);
out << "// ossimLambertConformalConicProjection::print\n"
<< ossimKeywordNames::STD_PARALLEL_1_KW << ": "
<< Lambert_Std_Parallel_1*DEG_PER_RAD << "\n"
<< ossimKeywordNames::STD_PARALLEL_2_KW << ": "
<< Lambert_Std_Parallel_2*DEG_PER_RAD << std::endl;
// Reset flags.
out.setf(f);
return ossimMapProjection::print(out);
}
/************************************************************************/
/* FUNCTIONS
*
*/
long ossimLambertConformalConicProjection::Set_Lambert_Parameters(double a,
double f,
double Origin_Latitude,
double Central_Meridian,
double Std_Parallel_1,
double Std_Parallel_2,
double False_Easting,
double False_Northing)
{ /* BEGIN Set_Lambert_Parameters */
/*
* The function Set_Lambert_Parameters receives the ellipsoid parameters and
* Lambert Conformal Conic projection parameters as inputs, and sets the
* corresponding state variables. If any errors occur, the error code(s)
* are returned by the function, otherwise LAMBERT_NO_ERROR is returned.
*
* a : Semi-major axis of ellipsoid, in meters (input)
* f : Flattening of ellipsoid (input)
* Origin_Latitude : Latitude of origin, in radians (input)
* Central_Meridian : Longitude of origin, in radians (input)
* Std_Parallel_1 : First standard parallel, in radians (input)
* Std_Parallel_2 : Second standard parallel, in radians (input)
* False_Easting : False easting, in meters (input)
* False_Northing : False northing, in meters (input)
*/
double slat, slat1, clat;
double es_sin;
double t0, t1, t2;
double m1, m2;
// double inv_f = 1 / f;
long Error_Code = LAMBERT_NO_ERROR;
// if (a <= 0.0)
// { /* Semi-major axis must be greater than zero */
// Error_Code |= LAMBERT_A_ERROR;
// }
// if ((inv_f < 250) || (inv_f > 350))
// { /* Inverse flattening must be between 250 and 350 */
// Error_Code |= LAMBERT_INV_F_ERROR;
// }
// if ((Origin_Latitude < -MAX_LAT) || (Origin_Latitude > MAX_LAT))
// { /* Origin Latitude out of range */
// Error_Code |= LAMBERT_ORIGIN_LAT_ERROR;
// }
// if ((Std_Parallel_1 < -MAX_LAT) || (Std_Parallel_1 > MAX_LAT))
// { /* First Standard Parallel out of range */
// Error_Code |= LAMBERT_FIRST_STDP_ERROR;
// }
// if ((Std_Parallel_2 < -MAX_LAT) || (Std_Parallel_2 > MAX_LAT))
// { /* Second Standard Parallel out of range */
// Error_Code |= LAMBERT_SECOND_STDP_ERROR;
// }
// if ((Std_Parallel_1 == 0) && (Std_Parallel_2 == 0))
// { /* First & Second Standard Parallels are both 0 */
// Error_Code |= LAMBERT_FIRST_SECOND_ERROR;
// }
// if (Std_Parallel_1 == -Std_Parallel_2)
// { /* Parallels are the negation of each other */
// Error_Code |= LAMBERT_HEMISPHERE_ERROR;
// }
// if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
// { /* Origin Longitude out of range */
// Error_Code |= LAMBERT_CENT_MER_ERROR;
// }
if (!Error_Code)
{ /* no errors */
Lambert_a = a;
Lambert_f = f;
Lambert_Origin_Lat = Origin_Latitude;
Lambert_Std_Parallel_1 = Std_Parallel_1;
Lambert_Std_Parallel_2 = Std_Parallel_2;
// if (Central_Meridian > PI)
// Central_Meridian -= TWO_PI;
Lambert_Origin_Long = Central_Meridian;
Lambert_False_Easting = False_Easting;
Lambert_False_Northing = False_Northing;
es2 = 2 * Lambert_f - Lambert_f * Lambert_f;
es = sqrt(es2);
es_OVER_2 = es / 2.0;
slat = sin(Lambert_Origin_Lat);
es_sin = ES_SIN(slat);
t0 = LAMBERT_t(Lambert_Origin_Lat, es_sin);
slat1 = sin(Lambert_Std_Parallel_1);
clat = cos(Lambert_Std_Parallel_1);
es_sin = ES_SIN(slat1);
m1 = LAMBERT_m(clat, es_sin);
t1 = LAMBERT_t(Lambert_Std_Parallel_1, es_sin);
if (fabs(Lambert_Std_Parallel_1 - Lambert_Std_Parallel_2) > 1.0e-10)
{
slat = sin(Lambert_Std_Parallel_2);
clat = cos(Lambert_Std_Parallel_2);
es_sin = ES_SIN(slat);
m2 = LAMBERT_m(clat, es_sin);
t2 = LAMBERT_t(Lambert_Std_Parallel_2, es_sin);
n = log(m1 / m2) / log(t1 / t2);
}
else
n = slat1;
F = m1 / (n * pow(t1, n));
Lambert_aF = Lambert_a * F;
if ((t0 == 0) && (n < 0))
rho0 = 0.0;
else
rho0 = Lambert_aF * pow(t0, n);
}
return (Error_Code);
} /* END OF Set_Lambert_Parameters */
void ossimLambertConformalConicProjection::Get_Lambert_Parameters(double *a,
double *f,
double *Origin_Latitude,
double *Central_Meridian,
double *Std_Parallel_1,
double *Std_Parallel_2,
double *False_Easting,
double *False_Northing)const
{ /* BEGIN Get_Lambert_Parameters */
/*
* The function Get_Lambert_Parameters returns the current ellipsoid
* parameters and Lambert Conformal Conic projection parameters.
*
* a : Semi-major axis of ellipsoid, in meters (output)
* f : Flattening of ellipsoid (output)
* Origin_Latitude : Latitude of origin, in radians (output)
* Central_Meridian : Longitude of origin, in radians (output)
* Std_Parallel_1 : First standard parallel, in radians (output)
* Std_Parallel_2 : Second standard parallel, in radians (output)
* False_Easting : False easting, in meters (output)
* False_Northing : False northing, in meters (output)
*/
*a = Lambert_a;
*f = Lambert_f;
*Std_Parallel_1 = Lambert_Std_Parallel_1;
*Std_Parallel_2 = Lambert_Std_Parallel_2;
*Origin_Latitude = Lambert_Origin_Lat;
*Central_Meridian = Lambert_Origin_Long;
*False_Easting = Lambert_False_Easting;
*False_Northing = Lambert_False_Northing;
return;
} /* END OF Get_Lambert_Parameters */
long ossimLambertConformalConicProjection::Convert_Geodetic_To_Lambert (double Latitude,
double Longitude,
double *Easting,
double *Northing)const
{ /* BEGIN Convert_Geodetic_To_Lambert */
/*
* The function Convert_Geodetic_To_Lambert converts Geodetic (latitude and
* longitude) coordinates to Lambert Conformal Conic projection (easting
* and northing) coordinates, according to the current ellipsoid and
* Lambert Conformal Conic projection parameters. If any errors occur, the
* error code(s) are returned by the function, otherwise LAMBERT_NO_ERROR is
* returned.
*
* Latitude : Latitude, in radians (input)
* Longitude : Longitude, in radians (input)
* Easting : Easting (X), in meters (output)
* Northing : Northing (Y), in meters (output)
*/
double slat;
double es_sin;
double t;
double rho;
double dlam;
double theta;
long Error_Code = LAMBERT_NO_ERROR;
// if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
// { /* Latitude out of range */
// Error_Code|= LAMBERT_LAT_ERROR;
// }
// if ((Longitude < -PI) || (Longitude > TWO_PI))
// { /* Longitude out of range */
// Error_Code|= LAMBERT_LON_ERROR;
// }
if (!Error_Code)
{ /* no errors */
if (fabs(fabs(Latitude) - PI_OVER_2) > 1.0e-10)
{
slat = sin(Latitude);
es_sin = ES_SIN(slat);
t = LAMBERT_t(Latitude, es_sin);
rho = Lambert_aF * pow(t, n);
}
else
{
if ((Latitude * n) <= 0)
{ /* Point can not be projected */
Error_Code |= LAMBERT_LAT_ERROR;
return (Error_Code);
}
rho = 0.0;
}
dlam = Longitude - Lambert_Origin_Long;
// if (dlam > PI)
// {
// dlam -= TWO_PI;
// }
// if (dlam < -PI)
// {
// dlam += TWO_PI;
// }
theta = n * dlam;
*Easting = rho * sin(theta) + Lambert_False_Easting;
*Northing = rho0 - rho * cos(theta) + Lambert_False_Northing;
}
return (Error_Code);
} /* END OF Convert_Geodetic_To_Lambert */
long ossimLambertConformalConicProjection::Convert_Lambert_To_Geodetic (double Easting,
double Northing,
double *Latitude,
double *Longitude)const
{ /* BEGIN Convert_Lambert_To_Geodetic */
/*
* The function Convert_Lambert_To_Geodetic converts Lambert Conformal
* Conic projection (easting and northing) coordinates to Geodetic
* (latitude and longitude) coordinates, according to the current ellipsoid
* and Lambert Conformal Conic projection parameters. If any errors occur,
* the error code(s) are returned by the function, otherwise LAMBERT_NO_ERROR
* is returned.
*
* Easting : Easting (X), in meters (input)
* Northing : Northing (Y), in meters (input)
* Latitude : Latitude, in radians (output)
* Longitude : Longitude, in radians (output)
*/
double dy, dx;
double rho, rho0_MINUS_dy;
double t;
double PHI;
double tempPHI = 0.0;
double sin_PHI;
double es_sin;
double theta = 0.0;
double tolerance = 4.85e-10;
long Error_Code = LAMBERT_NO_ERROR;
// if ((Easting < (Lambert_False_Easting - Lambert_Delta_Easting))
// ||(Easting > (Lambert_False_Easting + Lambert_Delta_Easting)))
// { /* Easting out of range */
// Error_Code |= LAMBERT_EASTING_ERROR;
// }
// if ((Northing < (Lambert_False_Northing - Lambert_Delta_Northing))
// || (Northing > (Lambert_False_Northing + Lambert_Delta_Northing)))
// { /* Northing out of range */
// Error_Code |= LAMBERT_NORTHING_ERROR;
// }
if (!Error_Code)
{ /* no errors */
dy = Northing - Lambert_False_Northing;
dx = Easting - Lambert_False_Easting;
rho0_MINUS_dy = rho0 - dy;
rho = sqrt(dx * dx + (rho0_MINUS_dy) * (rho0_MINUS_dy));
if (n < 0.0)
{
rho *= -1.0;
dy *= -1.0;
dx *= -1.0;
rho0_MINUS_dy *= -1.0;
}
if (rho != 0.0)
{
theta = atan2(dx, rho0_MINUS_dy);
t = pow(rho / (Lambert_aF) , 1.0 / n);
PHI = PI_OVER_2 - 2.0 * atan(t);
while (fabs(PHI - tempPHI) > tolerance)
{
tempPHI = PHI;
sin_PHI = sin(PHI);
es_sin = ES_SIN(sin_PHI);
PHI = PI_OVER_2 - 2.0 * atan(t * pow((1.0 - es_sin) / (1.0 + es_sin), es_OVER_2));
}
*Latitude = PHI;
*Longitude = theta / n + Lambert_Origin_Long;
if (fabs(*Latitude) < 2.0e-7) /* force lat to 0 to avoid -0 degrees */
*Latitude = 0.0;
if (*Latitude > PI_OVER_2) /* force distorted values to 90, -90 degrees */
*Latitude = PI_OVER_2;
else if (*Latitude < -PI_OVER_2)
*Latitude = -PI_OVER_2;
if (*Longitude > M_PI)
{
if (*Longitude - M_PI < 3.5e-6)
*Longitude = M_PI;
// else
// *Longitude -= TWO_PI;
}
if (*Longitude < -M_PI)
{
if (fabs(*Longitude + M_PI) < 3.5e-6)
*Longitude = -M_PI;
// else
// *Longitude += TWO_PI;
}
if (fabs(*Longitude) < 2.0e-7) /* force lon to 0 to avoid -0 degrees */
*Longitude = 0.0;
if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
*Longitude = M_PI;
else if (*Longitude < -M_PI)
*Longitude = -M_PI;
}
else
{
if (n > 0.0)
*Latitude = PI_OVER_2;
else
*Latitude = -PI_OVER_2;
*Longitude = Lambert_Origin_Long;
}
}
return (Error_Code);
} /* END OF Convert_Lambert_To_Geodetic */
double ossimLambertConformalConicProjection::getStandardParallel1()const
{
return Lambert_Std_Parallel_1/RAD_PER_DEG;
}
double ossimLambertConformalConicProjection::getStandardParallel2()const
{
return Lambert_Std_Parallel_2/RAD_PER_DEG;
}
//*************************************************************************************************
//! Returns TRUE if principal parameters are within epsilon tolerance.
//*************************************************************************************************
bool ossimLambertConformalConicProjection::operator==(const ossimProjection& proj) const
{
if (!ossimMapProjection::operator==(proj))
return false;
const ossimLambertConformalConicProjection* p = dynamic_cast<const ossimLambertConformalConicProjection*>(&proj);
if (!p) return false;
if (!ossim::almostEqual(Lambert_Std_Parallel_1,p->Lambert_Std_Parallel_1)) return false;
if (!ossim::almostEqual(Lambert_Std_Parallel_2,p->Lambert_Std_Parallel_2)) return false;
return true;
}