MCPcopy Create free account
hub / github.com/Kitware/VTK / pj_ellipsoid

Function pj_ellipsoid

ThirdParty/libproj/vtklibproj/src/ell_set.cpp:23–131  ·  view source on GitHub ↗

/

Source from the content-addressed store, hash-verified

21
22/***************************************************************************************/
23int pj_ellipsoid (PJ *P) {
24/****************************************************************************************
25 This is a replacement for the classic PROJ pj_ell_set function. The main difference
26 is that pj_ellipsoid augments the PJ object with a copy of the exact tags used to
27 define its related ellipsoid.
28
29 This makes it possible to let a new PJ object inherit the geometrical properties
30 of an existing one.
31
32 A complete ellipsoid definition comprises a size (primary) and a shape (secondary)
33 parameter.
34
35 Size parameters supported are:
36 R, defining the radius of a spherical planet
37 a, defining the semimajor axis of an ellipsoidal planet
38
39 Shape parameters supported are:
40 rf, the reverse flattening of the ellipsoid
41 f, the flattening of the ellipsoid
42 es, the eccentricity squared
43 e, the eccentricity
44 b, the semiminor axis
45
46 The ellps=xxx parameter provides both size and shape for a number of built in
47 ellipsoid definitions.
48
49 The ellipsoid definition may be augmented with a spherification flag, turning
50 the ellipsoid into a sphere with features defined by the ellipsoid.
51
52 Spherification parameters supported are:
53 R_A, which gives a sphere with the same surface area as the ellipsoid
54 R_A, which gives a sphere with the same volume as the ellipsoid
55
56 R_a, which gives a sphere with R = (a + b)/2 (arithmetic mean)
57 R_g, which gives a sphere with R = sqrt(a*b) (geometric mean)
58 R_h, which gives a sphere with R = 2*a*b/(a+b) (harmonic mean)
59
60 R_lat_a=phi, which gives a sphere with R being the arithmetic mean of
61 of the corresponding ellipsoid at latitude phi.
62 R_lat_g=phi, which gives a sphere with R being the geometric mean of
63 of the corresponding ellipsoid at latitude phi.
64
65 If R is given as size parameter, any shape and spherification parameters
66 given are ignored.
67
68 If size and shape are given as ellps=xxx, later shape and size parameters
69 are are taken into account as modifiers for the built in ellipsoid definition.
70
71 While this may seem strange, it is in accordance with historical PROJ
72 behavior. It can e.g. be used to define coordinates on the ellipsoid
73 scaled to unit semimajor axis by specifying "+ellps=xxx +a=1"
74
75****************************************************************************************/
76 int err = proj_errno_reset (P);
77 const char *empty = {""};
78
79 free(P->def_size);
80 P->def_size = nullptr;

Callers 3

set_ellipsoidFunction · 0.85
pj_ell_setFunction · 0.85

Calls 10

proj_errno_resetFunction · 0.85
pj_get_paramFunction · 0.85
ellps_sizeFunction · 0.85
pj_calc_ellipsoid_paramsFunction · 0.85
proj_errnoFunction · 0.85
proj_errno_restoreFunction · 0.85
ellps_ellpsFunction · 0.85
ellps_shapeFunction · 0.85
ellps_spherificationFunction · 0.85
proj_log_traceFunction · 0.85

Tested by

no test coverage detected