| Version 30 (modified by karney, 4 years ago) |
|---|
Geodestic Calculations
Geodestic calculations are calculations along lines (great circle) on the surface of the earth. They can answer questions like:
- What is the distance between these two points?
- If I travel X meters from point A at bearing phi, where will I be.
They are done in native lat-long coordinates, rather than in projected coordinates.
Mailing list threads
- http://thread.gmane.org/gmane.comp.gis.proj-4.devel/3361
- http://thread.gmane.org/gmane.comp.gis.proj-4.devel/3375
- http://thread.gmane.org/gmane.comp.gis.proj-4.devel/3435
- http://thread.gmane.org/gmane.comp.gis.proj-4.devel/3588
- http://thread.gmane.org/gmane.comp.gis.proj-4.devel/3925
- http://thread.gmane.org/gmane.comp.gis.proj-4.devel/4047
- http://thread.gmane.org/gmane.comp.gis.proj-4.devel/4083
Terminology
The shortest distance on the surface of a solid is generally termed a geodesic, be it an ellipsoid of revolution, aposphere, etc. On a sphere, the geodesic is termed a Great Circle.
HOWEVER, when computing the distance between two points using a projected coordinate system, that is a conformal projection such as Transverse Mercator, Oblique Mercator, Normal Mercator, Stereographic, or Lambert Conformal Conic - that then is a GRID distance which can be converted to an equivalent GEODETIC distance using the function for "Scale Factor at a Point." The conversion is then termed "Grid Distance to Geodetic Distance," even though it will not be as exactly correct as a true ellipsoidal geodesic. Closer to the truth with a TM than with a Lambert or other conformal projection, but still not exactly "on."
So, it can be termed "geodetic distance" or a "geodesic distance," depending on just how you got there ...
The Math
Spheroidal Approximation
The simplest way to compute geodesics is using a sphere as an approximation for the earth. This from Mikael Rittri on the Proj mailing list:
If 1 percent accuracy is enough, I think you can use spherical formulas with a fixed Earth radius. You can find good formulas in the Aviation Formulary of Ed Williams, http://williams.best.vwh.net/avform.htm.
For the fixed Earth radius, I would choose the average of the:
c = radius of curvature at the poles,
b2 / a = radius of curvature in a meridian plane at the equator,
since these are the extreme values for the local radius of curvature of the earth ellipsoid.
If your coordinates are given in WGS84, then
c = 6 399 593.626 m,
b2 / a = 6 335 439.327 m,
(see http://home.online.no/~sigurdhu/WGS84_Eng.html) so their average is 6,367,516.477 m. The maximal error for distance calculation should then be less than 0.51 percent.
When computing the azimuth between two points by the spherical formulas, I think the maximal error on WGS84 will be 0.2 degrees, at least if the points are not too far away (less than 1000 km apart, say). The error should be maximal near the equator, for azimuths near northeast etc.
I am not sure about the spherical errors for the forward geodetic problem: point positioning given initial point, distance and azimuth.
Ellipsoidal Approximation
For more accuracy, the earth can be approximated with an ellipsoid, complicating the math somewhat.
Thaddeus Vincenty's method, April 1975
For a very good procedure to calculate inter point distances see:
http://www.ngs.noaa.gov/PC_PROD/Inv_Fwd/ (Fortan code, DOS executables, and an online app)
and algorithm details published in:
Javascript code
Chris Veness has coded Vincenty's formulas as JavaScript.
distance: http://www.movable-type.co.uk/scripts/latlong-vincenty.html
direct: http://www.movable-type.co.uk/scripts/latlong-vincenty-direct.html
C code
From Gerald Evenden: a library of the converted NGS Vincenty geodesic procedure and an application program, 'geodesic'. In the case of a spherical earth Snyder's preferred equations are used.
Earlier Mr. Evenden had posted to the PROJ.4 mailing list this code for determination of true distance and respective forward and back azimuths between two points on the ellipsoid. Good for any pair of points that are not antipodal. Later he posted that this was not in fact the translation of NGS FORTRAN code, but something else. But, for what it's worth, here is the posted code (source unknown):
PROJ.4 - geod program
The PROJ.4 geod program can be used for great circle distances on an ellipsoid. Currently the underlying geodesic calculation API is not exposed as part of the PROJ.4 library. Gerald writes that geod is based upon a poorer algorithm (than the NGS procedure above) and he no longer supports it. But it is probably good enough for most applications. The method is documented here:
Paul D. Thomas, 1970
"Spheroidal Geodesics, Reference Systems, and
Local Geometry"
U.S. Naval Oceanographic Office, p. 162
Engineering Library 526.3 T36s
http://stinet.dtic.mil/oai/oai?&verb=getRecord&metadataPrefix=html&identifier=AD0703541
GeographicLib::Geodesic
Charles Karney has written a C++ class to do geodesic calculations and a utility Geod to call it. See
This is an attempt to do geodesic calculations "right", i.e.,
- Accurate to round-off (i.e., about 15 nm);
- Inverse solution always succeeds (even for near anti-podal points).
In addition, this class computes Christoffel's "reduced length", which gives the azimuthal scale for the corresponding azimuthal equidistant projection. This class is largely based on the work of Bessel (1826) and Helmert (1880) with the series approximations extended with Maxima.
The History
Here is a list of the older mathematical treatments of the geodesic problem for an ellipsoid, together with links to online copies. Unfortunately, the book scanning done by Google does not fold out the folded figures. I (Charles Karney) will add links to scans of the missing figures I can get hold of. Please let me know of errors, omissions, etc.
- I. Newton,
Philosophiæ Naturalis Principia Mathematica (3rd edition, Roy. Soc., 1726), Book 3, Prop. 19, Prob. 3, pp. 412-416.
http://books.google.com/books?id=0xYOAAAAQAAJ
English translation: Newton's Principia: The Mathematical Principles of Natural Philosophy, by A. Motte (Adee, New York, 1848), pp. 405-409.
http://books.google.com/books?id=KaAIAAAAIAAJ - A. C. Clairaut,
Détermination géometrique de la perpendiculaire a la méridienne tracée par M. Cassini (Geometrical determination of the perpendicular to the meridian drawn by [Jacques] Cassini), Mém. de l'Acad. Roy. des Sciences de Paris, 406-416 (1733, publ. 1735).
http://gallica.bnf.fr/ark:/12148/bpt6k3530m - A. C. Clairaut,
Suite d'un Mémoire donné en 1733, qui a pour titre: Détermination géometrique de la perpendiculaire a la méridienne tracée, &c (Continuation of a paper presented in 1733 entitled: Geometrical determination of the perpendicular to the meridian, etc.), Mém. de l'Acad. Roy. des Sciences de Paris, 83-96 (1739, publ. 1741).
http://gallica.bnf.fr/ark:/12148/bpt6k3536g - L. Euler,
Principes de la trigonométrie sphérique tirés de la méthode des plus grands et plus petits (Principles of spherical trigonometry taken from the method of the maxima and minima), Mém. de l'Acad. Roy. des Sciences de Berlin 9, 223-257 (1753, publ. 1755).
http://math.dartmouth.edu/~euler/pages/E214.html (figures missing) - L. Euler,
Élémens de la trigonométrie sphéroïdique tirés de la méthode des plus grands et plus petits (Elements of spheroidal trigonometry taken from the method of the maxima and minima), Mem. de l'Acad. Roy. des Sciences de Berlin 9, 258-293 (1753, publ. 1755).
http://math.dartmouth.edu/~euler/pages/E215.html (figures missing) - A. P. Dionis du Séjour,
Nouvelles méthodes analytiques pour résoudre différentes questions astronomiques; treizième mémoire (New analytical methods for solving various astronomical questions, part 13), Mém. de l'Acad. Roy. des Sciences de Paris, 73-192 + 3 plates (1778, publ. 1781).
http://books.google.com/books?id=8uEEAAAAQAAJ (pp. 112-113 missing) - A. P. Dionis du Séjour,
Traité Analytique des Mouvemens apparens des Corps Célestes (Analytical Treatise on the Apparent Movement of Heavenly Bodies), Vol. 2 (Valade, Paris, 1789), Book 1, Chaps. 1-2. http://books.google.com/books?id=SzEVAAAAQAAJ
unreadable page: http://charles.karney.info/google-goof/dusejour89-add.pdf
figures: http://charles.karney.info/google-goof/dusejour89-fig.pdf - A. M. Legendre,
Mémoire sur les opérations trigonométriques, dont les résultats dépendent de la figure de la terre (Trigonometric operations which depend on the shape of the earth), Mém. de l'Acad. Roy. des Sciences de Paris, 352-383 (1787, publ. 1789).
http://books.google.com/books?id=0uIEAAAAQAAJ (figures missing) - A. M. Legendre,
Analyse des triangles tracés sur la surface d'un sphéroïde (Analysis of spheroidal triangles), Mém. de l'Inst. Nat. de France, 130-161 (1st semester, 1806).
http://books.google.com/books?id=-d0EAAAAQAAJ (pp. 146-147 missing) - A. M. Legendre,
Exercices de Calcul Intégral sur Divers Ordres de Transcendantes et sur les Quadratures (Exercises in Integral Calculus), Vol. 1 (Courcier, Paris, 1811), pp. 178-182.
http://books.google.com/books?id=riIOAAAAQAAJ
figures: http://charles.karney.info/google-goof/legendre11-fig.pdf - A. M. Legendre,
Traité des Fonctions Elliptiques et des Intégrales Eulériennes (Treatise on Elliptic Integrals), Vol. 1, (Huzard-Courcier, Paris, 1825), pp. 360-364.
http://books.google.com/books?id=vaAKAAAAYAAJ
figures: http://charles.karney.info/google-goof/legendre25-fig.pdf - L. Puissant,
Traité de Géodésie ou Exposition des Méthodes Trigonométriques et Astronomiques (Treatise on Geodesy), Vol. 2 (2nd Edition, Courcier, Paris, 1819), Book 6, Chap 1.
http://books.google.com/books?id=PZEAAAAAMAAJ
unreadable pages: http://charles.karney.info/google-goof/puissant19b-add.pdf
figures: http://charles.karney.info/google-goof/puissant19b-fig.pdf - F. W. Bessel,
Ueber die Berechnung der geographischen Längen und Breiten aus geodätischen Vermessungen (The calculation of longitude and latitude from geodesic measurements), Astron. Nachr. 4 (86), 241-254 (1826).
http://adsabs.harvard.edu/abs/1826AN......4..241B
Partial English translation: Calculation of longitudes and latitudes on a spheroid, Quart. Jour. Roy. Inst. 21 (41), 138-152 (1826).
http://charles.karney.info/google-goof/quartjour26-extracts.pdf - F. W. Bessel,
Abhandlungen von Friedrich Wilhelm Bessel (The Collected Works of Bessel), Vol. 3 (W. Engelmann, Leipzig, 1876), Part 6.
http://books.google.com/books?id=vX4EAAAAYAAJ - J. Ivory,
Solution of a geodetical problem, Phil. Mag. 64 (315), 35-39 (1824).
http://books.google.com/books?id=xk0wAAAAIAAJ
Errata: Phil. Mag. 65 (324), 249-250 (1825).
http://books.google.com/books?id=_UwwAAAAIAAJ - J. Ivory,
On the properties of a line of shortest distance traced on the surface of an oblate spheroid, Phil. Mag. 67 (336), 241-249 and 67 (337), 340-352 (1826).
http://books.google.com/books?id=PkwwAAAAIAAJ
unreadable page: http://charles.karney.info/google-goof/ivory26-add.pdf
Mr. Ivory's mode of finding the length of the geodetic curve, Quart. Jour. Roy. Inst. 21 (42), 361-363 (1826).
http://charles.karney.info/google-goof/quartjour26-extracts.pdf
F. W. Bessel, Ueber einen Aufsatz von Ivory im Philosophical Magazine (Comments on a paper by Ivory in the Philosophical Magazine), Astron. Nachr. 5 (108), 177-180 (1927).
http://adsabs.harvard.edu/abs/1827AN......5..177B - C. F. Gauss,
Disquisitiones generales circa superficies curvas (1827), in Carl Friedrich Gauss Werke, Vol. 4 (Ges. Wiss., Göttingen, 1873), pp. 217-258.
http://gdz.sub.uni-goettingen.de/dms/load/img/?PPN=PPN236005081
English translation: General Investigations of Curved Surfaces of 1827 and 1825, by J. C. Morehead and A. M. Hiltebeitel (Princeton Univ. Lib., 1902).
http://books.google.com/books?id=a1wTJR3kHwUC - C. F. Gauss,
Untersuchungen über Gegenstände der höheren Geodäsie, Erste Abhandlung (Investigations on Higher Geodesy, Part 1), Abhandl. Math. Cl. Kön. Ges. Wiss. zu Göttingen 2 (1842-1844), 3-45 (1843).
http://gdz.sub.uni-goettingen.de/dms/load/img/?IDDOC=39018 - C. F. Gauss,
Untersuchungen über Gegenstände der höheren Geodäsie, Zweite Abhandlung (Investigations on Higher Geodesy, Part 2), Abhandl. Math. Cl. Kön. Ges. Wiss. zu Göttingen 3 (1845-1847), 3-43 (1846).
http://gdz.sub.uni-goettingen.de/dms/load/img/?IDDOC=39036 - C. F. Gauss,
Erdellipsoid und geodätischen linie (Geodesic lines on an Ellipsoidal Earth), in Carl Friedrich Gauss Werke, Vol. 9 (Ges. Wiss., Göttingen, 1903), pp. 67-104.
http://gdz.sub.uni-goettingen.de/dms/load/img/?PPN=PPN23601515X - A. Galle,
Über die geodätischen Arbeiten von Gauss (The Geodetic Works of Gauss), in Carl Friedrich Gauss Werke, Vol. 11, Part 2, 1-161 (Ges. Wiss., Göttingen, 1863).
http://gdz.sub.uni-goettingen.de/dms/load/img/?IDDOC=139786 - C. G. J. Jacobi,
Fundamenta nova theoriae functionum ellipticarum (A Fundamental New Theory of Elliptic Functions), (Borntræger, Könisberg, 1829).
http://books.google.com/books?id=_CAOAAAAQAAJ - C. G. J. Jacobi,
Solution nouvelle d'un problème de géodésie fondamental (A new solution to a fundamental problem of geodesy), Astron. Nachr. 41 (974), 209-216 (1855).
http://articles.adsabs.harvard.edu/abs/1855AN.....41..209J - E. Luther,
C.G.J. Jacobi's Ableitung der in seinem Aufsatze: "Solution nouvelle d'un problème de Géodésie fondamental" enthaltenen Formeln (Jacobi's derivation of the formulas contained in "A new solution to a fundamental problem of geodesy"), Astron. Nachr. 42 (1006), 337-356 (1856).
http://articles.adsabs.harvard.edu/abs/1856AN.....42..337J - P. A. Hansen,
Geodätische Untersuchungen (Geodetic investigations) (Hirzel, Leipzig, 1865), Sec. 1.
http://books.google.com/books?id=WlsOAAAAYAAJ - E. B. Christoffel,
Allgemeine Theorie der geodätischen Dreiecke (General theory of geodetic triangles), Math. Abhand. König. Akad. der Wiss. zu Berlin 8, 119-176 (1868), in Gesammelte Mathematische Abhandlungen, Vol. 1, Chap. 16, pp. 297-346 (Teubner, Leipzig, 1910).
http://books.google.com/books?id=9W9tAAAAMAAJ - A. Cayley,
On the geodesic lines on an oblate spheroid, Phil. Mag. 40, 329-340 (1870), in The Collected Mathematical Papers of Arthur Cayley, Vol. 7 (Cambridge Univ. Press, 1894), paper 422, pp. 15-25.
http://books.google.com/books?id=4XGIOoCMYYAC - F. R. Helmert,
Die Mathematischen und Physikalischen Theorieen der Höheren Geodäsie (The Mathematical and Physical Theory of Higher Geodesy), Vol. 1 (Teubner, Leipzig, 1880), Chaps. 5-7.
http://books.google.com/books?id=0l0OAAAAYAAJ - A. R. Clarke,
Geodesy (Clarendon Press, Oxford, 1880), Chap. 6.
http://books.google.com/books?id=lfIoAAAAYAAJ - W. Jordan,
Handbuch der Vermessungskunde (Handbook of Surveying), Vol. 3 (4th Edition, Metzler, Stuggart, 1896), Chaps. 6 & 9.
http://books.google.com/books?id=4KgRAAAAYAAJ - A. R. Forsyth,
Geodesics on an oblate spheroid, Mess. Math. 25, 81-124 (1896); Conjugate points of geodesics on an oblate spheroid, Mess. Math. 25, 161-169 (1896).
http://books.google.com/books?id=YsAKAAAAIAAJ
unreadable page: http://charles.karney.info/google-goof/forsyth96b-add.pdf
Early papers used a variety of circumlocutions for geodesics, for example:
- Perpendicular to the meridian. (Clairaut, du Séjour)
- Side of a spheroidal triangle. (Euler, Legendre)
- Shortest line. (Bessel, Gauss)
- Geodetical curve. (Ivory)
Legendre (1825, p. 364) gives the classic definition of a geodesic line:
La ligne la plus courte tracée sur la surface du globe terrestre, s'appelle ligne géodésique.
This usage enters German (via the "geodetic" variant), e.g., in Gauss (1843, p. 17):
... auf der Oberfläche des Ellipsoids durch kürzeste oder sogenannte geodätische Linien...
and English, e.g., in Cayley (1870, p. 329):
The theory of the geodesic lines on an oblate spheroid of any excentricity whatever was investigated by Legendre.
