GravityModel.hpp 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. /**
  2. * \file GravityModel.hpp
  3. * \brief Header for GeographicLib::GravityModel class
  4. *
  5. * Copyright (c) Charles Karney (2011-2021) <charles@karney.com> and licensed
  6. * under the MIT/X11 License. For more information, see
  7. * https://geographiclib.sourceforge.io/
  8. **********************************************************************/
  9. #if !defined(GEOGRAPHICLIB_GRAVITYMODEL_HPP)
  10. #define GEOGRAPHICLIB_GRAVITYMODEL_HPP 1
  11. #include <GeographicLib/Constants.hpp>
  12. #include <GeographicLib/NormalGravity.hpp>
  13. #include <GeographicLib/SphericalHarmonic.hpp>
  14. #include <GeographicLib/SphericalHarmonic1.hpp>
  15. #if defined(_MSC_VER)
  16. // Squelch warnings about dll vs vector
  17. # pragma warning (push)
  18. # pragma warning (disable: 4251)
  19. #endif
  20. namespace GeographicLib {
  21. class GravityCircle;
  22. /**
  23. * \brief Model of the earth's gravity field
  24. *
  25. * Evaluate the earth's gravity field according to a model. The supported
  26. * models treat only the gravitational field exterior to the mass of the
  27. * earth. When computing the field at points near (but above) the surface of
  28. * the earth a small correction can be applied to account for the mass of the
  29. * atmosphere above the point in question; see \ref gravityatmos.
  30. * Determining the height of the geoid above the ellipsoid entails correcting
  31. * for the mass of the earth above the geoid. The egm96 and egm2008 include
  32. * separate correction terms to account for this mass.
  33. *
  34. * Definitions and terminology (from Heiskanen and Moritz, Sec 2-13):
  35. * - \e V = gravitational potential;
  36. * - &Phi; = rotational potential;
  37. * - \e W = \e V + &Phi; = \e T + \e U = total potential;
  38. * - <i>V</i><sub>0</sub> = normal gravitation potential;
  39. * - \e U = <i>V</i><sub>0</sub> + &Phi; = total normal potential;
  40. * - \e T = \e W &minus; \e U = \e V &minus; <i>V</i><sub>0</sub> = anomalous
  41. * or disturbing potential;
  42. * - <b>g</b> = &nabla;\e W = <b>&gamma;</b> + <b>&delta;</b>;
  43. * - <b>f</b> = &nabla;&Phi;;
  44. * - <b>&Gamma;</b> = &nabla;<i>V</i><sub>0</sub>;
  45. * - <b>&gamma;</b> = &nabla;\e U;
  46. * - <b>&delta;</b> = &nabla;\e T = gravity disturbance vector
  47. * = <b>g</b><sub><i>P</i></sub> &minus; <b>&gamma;</b><sub><i>P</i></sub>;
  48. * - &delta;\e g = gravity disturbance = <i>g</i><sub><i>P</i></sub> &minus;
  49. * &gamma;<sub><i>P</i></sub>;
  50. * - &Delta;<b>g</b> = gravity anomaly vector = <b>g</b><sub><i>P</i></sub>
  51. * &minus; <b>&gamma;</b><sub><i>Q</i></sub>; here the line \e PQ is
  52. * perpendicular to ellipsoid and the potential at \e P equals the normal
  53. * potential at \e Q;
  54. * - &Delta;\e g = gravity anomaly = <i>g</i><sub><i>P</i></sub> &minus;
  55. * &gamma;<sub><i>Q</i></sub>;
  56. * - (&xi;, &eta;) deflection of the vertical, the difference in
  57. * directions of <b>g</b><sub><i>P</i></sub> and
  58. * <b>&gamma;</b><sub><i>Q</i></sub>, &xi; = NS, &eta; = EW.
  59. * - \e X, \e Y, \e Z, geocentric coordinates;
  60. * - \e x, \e y, \e z, local cartesian coordinates used to denote the east,
  61. * north and up directions.
  62. *
  63. * See \ref gravity for details of how to install the gravity models and the
  64. * data format.
  65. *
  66. * References:
  67. * - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San
  68. * Francisco, 1967).
  69. *
  70. * Example of use:
  71. * \include example-GravityModel.cpp
  72. *
  73. * <a href="Gravity.1.html">Gravity</a> is a command-line utility providing
  74. * access to the functionality of GravityModel and GravityCircle.
  75. **********************************************************************/
  76. class GEOGRAPHICLIB_EXPORT GravityModel {
  77. private:
  78. typedef Math::real real;
  79. friend class GravityCircle;
  80. static const int idlength_ = 8;
  81. std::string _name, _dir, _description, _date, _filename, _id;
  82. real _amodel, _GMmodel, _zeta0, _corrmult;
  83. int _nmx, _mmx;
  84. SphericalHarmonic::normalization _norm;
  85. NormalGravity _earth;
  86. std::vector<real> _Cx, _Sx, _CC, _CS, _zonal;
  87. real _dzonal0; // A left over contribution to _zonal.
  88. SphericalHarmonic _gravitational;
  89. SphericalHarmonic1 _disturbing;
  90. SphericalHarmonic _correction;
  91. void ReadMetadata(const std::string& name);
  92. Math::real InternalT(real X, real Y, real Z,
  93. real& deltaX, real& deltaY, real& deltaZ,
  94. bool gradp, bool correct) const;
  95. GravityModel(const GravityModel&) = delete; // copy constructor not allowed
  96. // nor copy assignment
  97. GravityModel& operator=(const GravityModel&) = delete;
  98. enum captype {
  99. CAP_NONE = 0U,
  100. CAP_G = 1U<<0, // implies potentials W and V
  101. CAP_T = 1U<<1,
  102. CAP_DELTA = 1U<<2 | CAP_T, // delta implies T?
  103. CAP_C = 1U<<3,
  104. CAP_GAMMA0 = 1U<<4,
  105. CAP_GAMMA = 1U<<5,
  106. CAP_ALL = 0x3FU,
  107. };
  108. public:
  109. /**
  110. * Bit masks for the capabilities to be given to the GravityCircle object
  111. * produced by Circle.
  112. **********************************************************************/
  113. enum mask {
  114. /**
  115. * No capabilities.
  116. * @hideinitializer
  117. **********************************************************************/
  118. NONE = 0U,
  119. /**
  120. * Allow calls to GravityCircle::Gravity, GravityCircle::W, and
  121. * GravityCircle::V.
  122. * @hideinitializer
  123. **********************************************************************/
  124. GRAVITY = CAP_G,
  125. /**
  126. * Allow calls to GravityCircle::Disturbance and GravityCircle::T.
  127. * @hideinitializer
  128. **********************************************************************/
  129. DISTURBANCE = CAP_DELTA,
  130. /**
  131. * Allow calls to GravityCircle::T(real lon) (i.e., computing the
  132. * disturbing potential and not the gravity disturbance vector).
  133. * @hideinitializer
  134. **********************************************************************/
  135. DISTURBING_POTENTIAL = CAP_T,
  136. /**
  137. * Allow calls to GravityCircle::SphericalAnomaly.
  138. * @hideinitializer
  139. **********************************************************************/
  140. SPHERICAL_ANOMALY = CAP_DELTA | CAP_GAMMA,
  141. /**
  142. * Allow calls to GravityCircle::GeoidHeight.
  143. * @hideinitializer
  144. **********************************************************************/
  145. GEOID_HEIGHT = CAP_T | CAP_C | CAP_GAMMA0,
  146. /**
  147. * All capabilities.
  148. * @hideinitializer
  149. **********************************************************************/
  150. ALL = CAP_ALL,
  151. };
  152. /** \name Setting up the gravity model
  153. **********************************************************************/
  154. ///@{
  155. /**
  156. * Construct a gravity model.
  157. *
  158. * @param[in] name the name of the model.
  159. * @param[in] path (optional) directory for data file.
  160. * @param[in] Nmax (optional) if non-negative, truncate the degree of the
  161. * model this value.
  162. * @param[in] Mmax (optional) if non-negative, truncate the order of the
  163. * model this value.
  164. * @exception GeographicErr if the data file cannot be found, is
  165. * unreadable, or is corrupt, or if \e Mmax > \e Nmax.
  166. * @exception std::bad_alloc if the memory necessary for storing the model
  167. * can't be allocated.
  168. *
  169. * A filename is formed by appending ".egm" (World Gravity Model) to the
  170. * name. If \e path is specified (and is non-empty), then the file is
  171. * loaded from directory, \e path. Otherwise the path is given by
  172. * DefaultGravityPath().
  173. *
  174. * This file contains the metadata which specifies the properties of the
  175. * model. The coefficients for the spherical harmonic sums are obtained
  176. * from a file obtained by appending ".cof" to metadata file (so the
  177. * filename ends in ".egm.cof").
  178. *
  179. * If \e Nmax &ge; 0 and \e Mmax < 0, then \e Mmax is set to \e Nmax.
  180. * After the model is loaded, the maximum degree and order of the model can
  181. * be found by the Degree() and Order() methods.
  182. **********************************************************************/
  183. explicit GravityModel(const std::string& name,
  184. const std::string& path = "",
  185. int Nmax = -1, int Mmax = -1);
  186. ///@}
  187. /** \name Compute gravity in geodetic coordinates
  188. **********************************************************************/
  189. ///@{
  190. /**
  191. * Evaluate the gravity at an arbitrary point above (or below) the
  192. * ellipsoid.
  193. *
  194. * @param[in] lat the geographic latitude (degrees).
  195. * @param[in] lon the geographic longitude (degrees).
  196. * @param[in] h the height above the ellipsoid (meters).
  197. * @param[out] gx the easterly component of the acceleration
  198. * (m s<sup>&minus;2</sup>).
  199. * @param[out] gy the northerly component of the acceleration
  200. * (m s<sup>&minus;2</sup>).
  201. * @param[out] gz the upward component of the acceleration
  202. * (m s<sup>&minus;2</sup>); this is usually negative.
  203. * @return \e W the sum of the gravitational and centrifugal potentials
  204. * (m<sup>2</sup> s<sup>&minus;2</sup>).
  205. *
  206. * The function includes the effects of the earth's rotation.
  207. **********************************************************************/
  208. Math::real Gravity(real lat, real lon, real h,
  209. real& gx, real& gy, real& gz) const;
  210. /**
  211. * Evaluate the gravity disturbance vector at an arbitrary point above (or
  212. * below) the ellipsoid.
  213. *
  214. * @param[in] lat the geographic latitude (degrees).
  215. * @param[in] lon the geographic longitude (degrees).
  216. * @param[in] h the height above the ellipsoid (meters).
  217. * @param[out] deltax the easterly component of the disturbance vector
  218. * (m s<sup>&minus;2</sup>).
  219. * @param[out] deltay the northerly component of the disturbance vector
  220. * (m s<sup>&minus;2</sup>).
  221. * @param[out] deltaz the upward component of the disturbance vector
  222. * (m s<sup>&minus;2</sup>).
  223. * @return \e T the corresponding disturbing potential
  224. * (m<sup>2</sup> s<sup>&minus;2</sup>).
  225. **********************************************************************/
  226. Math::real Disturbance(real lat, real lon, real h,
  227. real& deltax, real& deltay, real& deltaz)
  228. const;
  229. /**
  230. * Evaluate the geoid height.
  231. *
  232. * @param[in] lat the geographic latitude (degrees).
  233. * @param[in] lon the geographic longitude (degrees).
  234. * @return \e N the height of the geoid above the ReferenceEllipsoid()
  235. * (meters).
  236. *
  237. * This calls NormalGravity::U for ReferenceEllipsoid(). Some
  238. * approximations are made in computing the geoid height so that the
  239. * results of the NGA codes are reproduced accurately. Details are given
  240. * in \ref gravitygeoid.
  241. **********************************************************************/
  242. Math::real GeoidHeight(real lat, real lon) const;
  243. /**
  244. * Evaluate the components of the gravity anomaly vector using the
  245. * spherical approximation.
  246. *
  247. * @param[in] lat the geographic latitude (degrees).
  248. * @param[in] lon the geographic longitude (degrees).
  249. * @param[in] h the height above the ellipsoid (meters).
  250. * @param[out] Dg01 the gravity anomaly (m s<sup>&minus;2</sup>).
  251. * @param[out] xi the northerly component of the deflection of the vertical
  252. * (degrees).
  253. * @param[out] eta the easterly component of the deflection of the vertical
  254. * (degrees).
  255. *
  256. * The spherical approximation (see Heiskanen and Moritz, Sec 2-14) is used
  257. * so that the results of the NGA codes are reproduced accurately.
  258. * approximations used here. Details are given in \ref gravitygeoid.
  259. **********************************************************************/
  260. void SphericalAnomaly(real lat, real lon, real h,
  261. real& Dg01, real& xi, real& eta) const;
  262. ///@}
  263. /** \name Compute gravity in geocentric coordinates
  264. **********************************************************************/
  265. ///@{
  266. /**
  267. * Evaluate the components of the acceleration due to gravity and the
  268. * centrifugal acceleration in geocentric coordinates.
  269. *
  270. * @param[in] X geocentric coordinate of point (meters).
  271. * @param[in] Y geocentric coordinate of point (meters).
  272. * @param[in] Z geocentric coordinate of point (meters).
  273. * @param[out] gX the \e X component of the acceleration
  274. * (m s<sup>&minus;2</sup>).
  275. * @param[out] gY the \e Y component of the acceleration
  276. * (m s<sup>&minus;2</sup>).
  277. * @param[out] gZ the \e Z component of the acceleration
  278. * (m s<sup>&minus;2</sup>).
  279. * @return \e W = \e V + &Phi; the sum of the gravitational and
  280. * centrifugal potentials (m<sup>2</sup> s<sup>&minus;2</sup>).
  281. *
  282. * This calls NormalGravity::U for ReferenceEllipsoid().
  283. **********************************************************************/
  284. Math::real W(real X, real Y, real Z,
  285. real& gX, real& gY, real& gZ) const;
  286. /**
  287. * Evaluate the components of the acceleration due to gravity in geocentric
  288. * coordinates.
  289. *
  290. * @param[in] X geocentric coordinate of point (meters).
  291. * @param[in] Y geocentric coordinate of point (meters).
  292. * @param[in] Z geocentric coordinate of point (meters).
  293. * @param[out] GX the \e X component of the acceleration
  294. * (m s<sup>&minus;2</sup>).
  295. * @param[out] GY the \e Y component of the acceleration
  296. * (m s<sup>&minus;2</sup>).
  297. * @param[out] GZ the \e Z component of the acceleration
  298. * (m s<sup>&minus;2</sup>).
  299. * @return \e V = \e W - &Phi; the gravitational potential
  300. * (m<sup>2</sup> s<sup>&minus;2</sup>).
  301. **********************************************************************/
  302. Math::real V(real X, real Y, real Z,
  303. real& GX, real& GY, real& GZ) const;
  304. /**
  305. * Evaluate the components of the gravity disturbance in geocentric
  306. * coordinates.
  307. *
  308. * @param[in] X geocentric coordinate of point (meters).
  309. * @param[in] Y geocentric coordinate of point (meters).
  310. * @param[in] Z geocentric coordinate of point (meters).
  311. * @param[out] deltaX the \e X component of the gravity disturbance
  312. * (m s<sup>&minus;2</sup>).
  313. * @param[out] deltaY the \e Y component of the gravity disturbance
  314. * (m s<sup>&minus;2</sup>).
  315. * @param[out] deltaZ the \e Z component of the gravity disturbance
  316. * (m s<sup>&minus;2</sup>).
  317. * @return \e T = \e W - \e U the disturbing potential (also called the
  318. * anomalous potential) (m<sup>2</sup> s<sup>&minus;2</sup>).
  319. **********************************************************************/
  320. Math::real T(real X, real Y, real Z,
  321. real& deltaX, real& deltaY, real& deltaZ) const
  322. { return InternalT(X, Y, Z, deltaX, deltaY, deltaZ, true, true); }
  323. /**
  324. * Evaluate disturbing potential in geocentric coordinates.
  325. *
  326. * @param[in] X geocentric coordinate of point (meters).
  327. * @param[in] Y geocentric coordinate of point (meters).
  328. * @param[in] Z geocentric coordinate of point (meters).
  329. * @return \e T = \e W - \e U the disturbing potential (also called the
  330. * anomalous potential) (m<sup>2</sup> s<sup>&minus;2</sup>).
  331. **********************************************************************/
  332. Math::real T(real X, real Y, real Z) const {
  333. real dummy;
  334. return InternalT(X, Y, Z, dummy, dummy, dummy, false, true);
  335. }
  336. /**
  337. * Evaluate the components of the acceleration due to normal gravity and
  338. * the centrifugal acceleration in geocentric coordinates.
  339. *
  340. * @param[in] X geocentric coordinate of point (meters).
  341. * @param[in] Y geocentric coordinate of point (meters).
  342. * @param[in] Z geocentric coordinate of point (meters).
  343. * @param[out] gammaX the \e X component of the normal acceleration
  344. * (m s<sup>&minus;2</sup>).
  345. * @param[out] gammaY the \e Y component of the normal acceleration
  346. * (m s<sup>&minus;2</sup>).
  347. * @param[out] gammaZ the \e Z component of the normal acceleration
  348. * (m s<sup>&minus;2</sup>).
  349. * @return \e U = <i>V</i><sub>0</sub> + &Phi; the sum of the
  350. * normal gravitational and centrifugal potentials
  351. * (m<sup>2</sup> s<sup>&minus;2</sup>).
  352. *
  353. * This calls NormalGravity::U for ReferenceEllipsoid().
  354. **********************************************************************/
  355. Math::real U(real X, real Y, real Z,
  356. real& gammaX, real& gammaY, real& gammaZ) const
  357. { return _earth.U(X, Y, Z, gammaX, gammaY, gammaZ); }
  358. /**
  359. * Evaluate the centrifugal acceleration in geocentric coordinates.
  360. *
  361. * @param[in] X geocentric coordinate of point (meters).
  362. * @param[in] Y geocentric coordinate of point (meters).
  363. * @param[out] fX the \e X component of the centrifugal acceleration
  364. * (m s<sup>&minus;2</sup>).
  365. * @param[out] fY the \e Y component of the centrifugal acceleration
  366. * (m s<sup>&minus;2</sup>).
  367. * @return &Phi; the centrifugal potential (m<sup>2</sup>
  368. * s<sup>&minus;2</sup>).
  369. *
  370. * This calls NormalGravity::Phi for ReferenceEllipsoid().
  371. **********************************************************************/
  372. Math::real Phi(real X, real Y, real& fX, real& fY) const
  373. { return _earth.Phi(X, Y, fX, fY); }
  374. ///@}
  375. /** \name Compute gravity on a circle of constant latitude
  376. **********************************************************************/
  377. ///@{
  378. /**
  379. * Create a GravityCircle object to allow the gravity field at many points
  380. * with constant \e lat and \e h and varying \e lon to be computed
  381. * efficiently.
  382. *
  383. * @param[in] lat latitude of the point (degrees).
  384. * @param[in] h the height of the point above the ellipsoid (meters).
  385. * @param[in] caps bitor'ed combination of GravityModel::mask values
  386. * specifying the capabilities of the resulting GravityCircle object.
  387. * @exception std::bad_alloc if the memory necessary for creating a
  388. * GravityCircle can't be allocated.
  389. * @return a GravityCircle object whose member functions computes the
  390. * gravitational field at a particular values of \e lon.
  391. *
  392. * The GravityModel::mask values are
  393. * - \e caps |= GravityModel::GRAVITY
  394. * - \e caps |= GravityModel::DISTURBANCE
  395. * - \e caps |= GravityModel::DISTURBING_POTENTIAL
  396. * - \e caps |= GravityModel::SPHERICAL_ANOMALY
  397. * - \e caps |= GravityModel::GEOID_HEIGHT
  398. * .
  399. * The default value of \e caps is GravityModel::ALL which turns on all the
  400. * capabilities. If an unsupported function is invoked, it will return
  401. * NaNs. Note that GravityModel::GEOID_HEIGHT will only be honored if \e h
  402. * = 0.
  403. *
  404. * If the field at several points on a circle of latitude need to be
  405. * calculated then creating a GravityCircle object and using its member
  406. * functions will be substantially faster, especially for high-degree
  407. * models. See \ref gravityparallel for an example of using GravityCircle
  408. * (together with OpenMP) to speed up the computation of geoid heights.
  409. **********************************************************************/
  410. GravityCircle Circle(real lat, real h, unsigned caps = ALL) const;
  411. ///@}
  412. /** \name Inspector functions
  413. **********************************************************************/
  414. ///@{
  415. /**
  416. * @return the NormalGravity object for the reference ellipsoid.
  417. **********************************************************************/
  418. const NormalGravity& ReferenceEllipsoid() const { return _earth; }
  419. /**
  420. * @return the description of the gravity model, if available, in the data
  421. * file; if absent, return "NONE".
  422. **********************************************************************/
  423. const std::string& Description() const { return _description; }
  424. /**
  425. * @return date of the model; if absent, return "UNKNOWN".
  426. **********************************************************************/
  427. const std::string& DateTime() const { return _date; }
  428. /**
  429. * @return full file name used to load the gravity model.
  430. **********************************************************************/
  431. const std::string& GravityFile() const { return _filename; }
  432. /**
  433. * @return "name" used to load the gravity model (from the first argument
  434. * of the constructor, but this may be overridden by the model file).
  435. **********************************************************************/
  436. const std::string& GravityModelName() const { return _name; }
  437. /**
  438. * @return directory used to load the gravity model.
  439. **********************************************************************/
  440. const std::string& GravityModelDirectory() const { return _dir; }
  441. /**
  442. * @return \e a the equatorial radius of the ellipsoid (meters).
  443. **********************************************************************/
  444. Math::real EquatorialRadius() const { return _earth.EquatorialRadius(); }
  445. /**
  446. * @return \e GM the mass constant of the model (m<sup>3</sup>
  447. * s<sup>&minus;2</sup>); this is the product of \e G the gravitational
  448. * constant and \e M the mass of the earth (usually including the mass of
  449. * the earth's atmosphere).
  450. **********************************************************************/
  451. Math::real MassConstant() const { return _GMmodel; }
  452. /**
  453. * @return \e GM the mass constant of the ReferenceEllipsoid()
  454. * (m<sup>3</sup> s<sup>&minus;2</sup>).
  455. **********************************************************************/
  456. Math::real ReferenceMassConstant() const
  457. { return _earth.MassConstant(); }
  458. /**
  459. * @return &omega; the angular velocity of the model and the
  460. * ReferenceEllipsoid() (rad s<sup>&minus;1</sup>).
  461. **********************************************************************/
  462. Math::real AngularVelocity() const
  463. { return _earth.AngularVelocity(); }
  464. /**
  465. * @return \e f the flattening of the ellipsoid.
  466. **********************************************************************/
  467. Math::real Flattening() const { return _earth.Flattening(); }
  468. /**
  469. * @return \e Nmax the maximum degree of the components of the model.
  470. **********************************************************************/
  471. int Degree() const { return _nmx; }
  472. /**
  473. * @return \e Mmax the maximum order of the components of the model.
  474. **********************************************************************/
  475. int Order() const { return _mmx; }
  476. /**
  477. * \deprecated An old name for EquatorialRadius().
  478. **********************************************************************/
  479. GEOGRAPHICLIB_DEPRECATED("Use EquatorialRadius()")
  480. Math::real MajorRadius() const { return EquatorialRadius(); }
  481. ///@}
  482. /**
  483. * @return the default path for gravity model data files.
  484. *
  485. * This is the value of the environment variable
  486. * GEOGRAPHICLIB_GRAVITY_PATH, if set; otherwise, it is
  487. * $GEOGRAPHICLIB_DATA/gravity if the environment variable
  488. * GEOGRAPHICLIB_DATA is set; otherwise, it is a compile-time default
  489. * (/usr/local/share/GeographicLib/gravity on non-Windows systems and
  490. * C:/ProgramData/GeographicLib/gravity on Windows systems).
  491. **********************************************************************/
  492. static std::string DefaultGravityPath();
  493. /**
  494. * @return the default name for the gravity model.
  495. *
  496. * This is the value of the environment variable
  497. * GEOGRAPHICLIB_GRAVITY_NAME, if set; otherwise, it is "egm96". The
  498. * GravityModel class does not use this function; it is just provided as a
  499. * convenience for a calling program when constructing a GravityModel
  500. * object.
  501. **********************************************************************/
  502. static std::string DefaultGravityName();
  503. };
  504. } // namespace GeographicLib
  505. #if defined(_MSC_VER)
  506. # pragma warning (pop)
  507. #endif
  508. #endif // GEOGRAPHICLIB_GRAVITYMODEL_HPP