@@ -49,16 +49,21 @@ int pj_ellipsoid(PJ *P) {
49
49
50
50
Spherification parameters supported are:
51
51
R_A, which gives a sphere with the same surface area as the
52
- ellipsoid R_V, which gives a sphere with the same volume as the ellipsoid
52
+ ellipsoid R_V, which gives a sphere with the same volume as the
53
+ ellipsoid
53
54
54
55
R_a, which gives a sphere with R = (a + b)/2 (arithmetic mean)
55
56
R_g, which gives a sphere with R = sqrt(a*b) (geometric mean)
56
57
R_h, which gives a sphere with R = 2*a*b/(a+b) (harmonic mean)
57
58
58
59
R_lat_a=phi, which gives a sphere with R being the arithmetic mean
59
- of of the corresponding ellipsoid at latitude phi. R_lat_g=phi, which gives
60
- a sphere with R being the geometric mean of of the corresponding ellipsoid
61
- at latitude phi.
60
+ of of the corresponding ellipsoid at latitude phi.
61
+ R_lat_g=phi, which gives
62
+ a sphere with R being the geometric mean of of the corresponding
63
+ ellipsoid at latitude phi.
64
+
65
+ R_C, which gives a sphere with the radius of the conformal sphere
66
+ at phi0.
62
67
63
68
If R is given as size parameter, any shape and spherification parameters
64
69
given are ignored.
@@ -349,8 +354,8 @@ static const double RV6 = 55 / 1296.;
349
354
/* **************************************************************************************/
350
355
static int ellps_spherification (PJ *P) {
351
356
/* **************************************************************************************/
352
- const char *keys[] = {" R_A" , " R_V" , " R_a" , " R_g" ,
353
- " R_h" , " R_lat_a" , " R_lat_g" };
357
+ const char *keys[] = {" R_A" , " R_V" , " R_a" , " R_g" ,
358
+ " R_h" , " R_lat_a" , " R_lat_g" , " R_C " };
354
359
size_t len, i;
355
360
paralist *par = nullptr ;
356
361
@@ -428,6 +433,22 @@ static int ellps_spherification(PJ *P) {
428
433
else /* geometric */
429
434
P->a *= sqrt (1 - P->es ) / t;
430
435
break ;
436
+
437
+ /* R_C - a sphere with R = radius of conformal sphere, taken at a
438
+ * latitude that is phi0 (note: at least for mercator. for other
439
+ * projection methods, this could be phi1)
440
+ * Formula from IOGP Publication 373-7-2 – Geomatics Guidance Note number 7,
441
+ * part 2 1.1 Ellipsoid parameters
442
+ */
443
+ case 7 :
444
+ t = sin (P->phi0 );
445
+ t = 1 - P->es * t * t;
446
+ if (t == 0 .) {
447
+ proj_log_error (P, _ (" Invalid eccentricity" ));
448
+ return proj_errno_set (P, PROJ_ERR_INVALID_OP_ILLEGAL_ARG_VALUE);
449
+ }
450
+ P->a *= sqrt (1 - P->es ) / t;
451
+ break ;
431
452
}
432
453
433
454
if (P->a <= 0 .) {
0 commit comments