CINXE.COM

Library — GeographicLib 2.3 documentation

<!DOCTYPE html> <html lang="en" data-content_root="../"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Library &#8212; GeographicLib 2.3 documentation</title> <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" /> <link rel="stylesheet" type="text/css" href="../_static/classic.css?v=def86cc0" /> <script src="../_static/documentation_options.js?v=57236720"></script> <script src="../_static/doctools.js?v=9a2dae69"></script> <script src="../_static/sphinx_highlight.js?v=dc90522c"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Research" href="research.html" /> <link rel="prev" title="GeographicLib" href="../index.html" /> </head><body> <div class="related" role="navigation" aria-label="Related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="research.html" title="Research" accesskey="N">next</a> |</li> <li class="right" > <a href="../index.html" title="GeographicLib" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">GeographicLib 2.3 documentation</a> &#187;</li> <li class="nav-item nav-item-this"><a href="">Library</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <section id="library"> <span id="id1"></span><h1>Library<a class="headerlink" href="#library" title="Link to this heading">¶</a></h1> <p>GeographicLib started off as a C++ library. However the component of the library solving the geodesic problem was sufficiently novel and sufficiently important that there was a need to port it to several other languages.</p> <section id="infrastructure"> <h2>Infrastructure<a class="headerlink" href="#infrastructure" title="Link to this heading">¶</a></h2> <p>The repositories for all implementations are on <a class="reference external" href="https://github.com/orgs/geographiclib/repositories">GitHub</a>. The project is hosted on <a class="reference external" href="https://sourceforge.net/projects/geographiclib">SourceForge</a> and it hosts GeographicLib’s <a class="reference external" href="../index.html">web pages</a> and the <a class="reference external" href="https://sourceforge.net/projects/geographiclib/files">file system</a> for package distribution.</p> </section> <section id="supported-languages"> <span id="languages"></span><h2>Supported languages<a class="headerlink" href="#supported-languages" title="Link to this heading">¶</a></h2> <p>The C++ version of GeographicLib offers the broadest range of features. However, the geodesic routines are available several other languages. Here is a list of the supported languages.</p> <table class="docutils align-default"> <thead> <tr class="row-odd"><th class="head"><p>language</p></th> <th class="head"><p>information</p></th> <th class="head"><p>repository<a class="footnote-reference brackets" href="#a" id="id2" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a></p></th> <th class="head"><p>download<a class="footnote-reference brackets" href="#b" id="id3" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a></p></th> </tr> </thead> <tbody> <tr class="row-even"><td><p>C++</p></td> <td><p><a class="reference external" href="../C++/doc/index.html">C++ doc</a></p></td> <td><p><a class="reference external" href="https://github.com/geographiclib/geographiclib">C++ repo</a><a class="footnote-reference brackets" href="#c" id="id4" role="doc-noteref"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a></p></td> <td><p><a class="reference external" href="https://sourceforge.net/projects/geographiclib/files/distrib-C++">C++ packages</a><a class="footnote-reference brackets" href="#d" id="id5" role="doc-noteref"><span class="fn-bracket">[</span>4<span class="fn-bracket">]</span></a></p></td> </tr> <tr class="row-odd"><td><p>C</p></td> <td><p><a class="reference external" href="../C/doc/index.html">C doc</a></p></td> <td><p><a class="reference external" href="https://github.com/geographiclib/geographiclib-c">C repo</a></p></td> <td><p><a class="reference external" href="https://sourceforge.net/projects/geographiclib/files/distrib-C">C packages</a><a class="footnote-reference brackets" href="#e" id="id6" role="doc-noteref"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></a></p></td> </tr> <tr class="row-even"><td><p>Fortran</p></td> <td><p><a class="reference external" href="../Fortran/doc/index.html">Fortran doc</a></p></td> <td><p><a class="reference external" href="https://github.com/geographiclib/geographiclib-fortran">Fortran repo</a></p></td> <td><p><a class="reference external" href="https://sourceforge.net/projects/geographiclib/files/distrib-Fortran">Fortran packages</a></p></td> </tr> <tr class="row-odd"><td><p>Python</p></td> <td><p><a class="reference external" href="../Python/doc/index.html">Python doc</a></p></td> <td><p><a class="reference external" href="https://github.com/geographiclib/geographiclib-python">Python repo</a></p></td> <td><p><a class="reference external" href="https://sourceforge.net/projects/geographiclib/files/distrib-Python">Python packages</a><a class="footnote-reference brackets" href="#f" id="id7" role="doc-noteref"><span class="fn-bracket">[</span>6<span class="fn-bracket">]</span></a></p></td> </tr> <tr class="row-even"><td><p>Octave<a class="footnote-reference brackets" href="#g" id="id8" role="doc-noteref"><span class="fn-bracket">[</span>7<span class="fn-bracket">]</span></a></p></td> <td><p><a class="reference external" href="https://github.com/geographiclib/geographiclib-octave#readme">Octave doc</a></p></td> <td><p><a class="reference external" href="https://github.com/geographiclib/geographiclib-octave">Octave repo</a></p></td> <td><p><a class="reference external" href="https://sourceforge.net/projects/geographiclib/files/distrib-Octave">Octave packages</a><a class="footnote-reference brackets" href="#h" id="id9" role="doc-noteref"><span class="fn-bracket">[</span>8<span class="fn-bracket">]</span></a></p></td> </tr> <tr class="row-odd"><td><p>Java<a class="footnote-reference brackets" href="#i" id="id10" role="doc-noteref"><span class="fn-bracket">[</span>9<span class="fn-bracket">]</span></a></p></td> <td><p><a class="reference external" href="../Java/doc/index.html">Java doc</a></p></td> <td><p><a class="reference external" href="https://github.com/geographiclib/geographiclib-java">Java repo</a></p></td> <td><p><a class="reference external" href="https://sourceforge.net/projects/geographiclib/files/distrib-Java">Java packages</a><a class="footnote-reference brackets" href="#j" id="id11" role="doc-noteref"><span class="fn-bracket">[</span>10<span class="fn-bracket">]</span></a></p></td> </tr> <tr class="row-even"><td><p>JavaScript<a class="footnote-reference brackets" href="#k" id="id12" role="doc-noteref"><span class="fn-bracket">[</span>11<span class="fn-bracket">]</span></a></p></td> <td><p><a class="reference external" href="../JavaScript/doc/index.html">JS doc</a></p></td> <td><p><a class="reference external" href="https://github.com/geographiclib/geographiclib-js">JS repo</a></p></td> <td><p><a class="reference external" href="https://sourceforge.net/projects/geographiclib/files/distrib-JavaScript">JS packages</a><a class="footnote-reference brackets" href="#l" id="id13" role="doc-noteref"><span class="fn-bracket">[</span>12<span class="fn-bracket">]</span></a></p></td> </tr> </tbody> </table> <aside class="footnote-list brackets"> <aside class="footnote brackets" id="a" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id2">1</a><span class="fn-bracket">]</span></span> <p>Active branches are <code class="docutils literal notranslate"><span class="pre">main</span></code> and <code class="docutils literal notranslate"><span class="pre">devel</span></code>. For the C++ repository, releases are available on the <code class="docutils literal notranslate"><span class="pre">release</span></code> branch.</p> </aside> <aside class="footnote brackets" id="b" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id3">2</a><span class="fn-bracket">]</span></span> <p>The download links offered here are the ones updated as soon as there’s a release. The packages are also available, as noted, from other downstream providers. Prior to version 2.0, all the languages were bundled into a single source package available <a class="reference external" href="https://sourceforge.net/projects/geographiclib/files/distrib">here</a>.</p> </aside> <aside class="footnote brackets" id="c" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id4">3</a><span class="fn-bracket">]</span></span> <p>This repository also hold the implementations in other languages for versions before 2.0.</p> </aside> <aside class="footnote brackets" id="d" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id5">4</a><span class="fn-bracket">]</span></span> <p>Also available in several Linux distributions (Debian, Ubuntu, Fedora, etc.) and as packages on <a class="reference external" href="https://anaconda.org/conda-forge/geographiclib-cpp">conda-forge (C++)</a>, <a class="reference external" href="https://vcpkg.info/port/geographiclib">vcpkg</a>, and <a class="reference external" href="https://formulae.brew.sh/formula/geographiclib">brew</a>.</p> </aside> <aside class="footnote brackets" id="e" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id6">5</a><span class="fn-bracket">]</span></span> <p>The C library is incorporated into <a class="reference external" href="https://proj.org/geodesic.html">PROJ</a> and the R package <a class="reference external" href="https://cran.r-project.org/package=geosphere">geosphere</a>.</p> </aside> <aside class="footnote brackets" id="f" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id7">6</a><span class="fn-bracket">]</span></span> <p>Also available as a <a class="reference external" href="https://pypi.python.org/pypi/geographiclib">PyPI package</a> and in <a class="reference external" href="https://anaconda.org/conda-forge/geographiclib">conda-forge (Python)</a></p> </aside> <aside class="footnote brackets" id="g" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id8">7</a><span class="fn-bracket">]</span></span> <p>This is compatible with both Octave and MATLAB. This package also includes several other components of the C++ library and a treatment of great ellipses and triaxial ellipsoid (not in C++ library).</p> </aside> <aside class="footnote brackets" id="h" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id9">8</a><span class="fn-bracket">]</span></span> <p>Also available as a <a class="reference external" href="https://www.mathworks.com/matlabcentral/fileexchange/50605">MATLAB Central package</a>.</p> </aside> <aside class="footnote brackets" id="i" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id10">9</a><span class="fn-bracket">]</span></span> <p>Also includes the gnomonic projections.</p> </aside> <aside class="footnote brackets" id="j" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id11">10</a><span class="fn-bracket">]</span></span> <p>Also available as a <a class="reference external" href="https://search.maven.org/artifact/net.sf.geographiclib/GeographicLib-Java">Maven Central package</a></p> </aside> <aside class="footnote brackets" id="k" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id12">11</a><span class="fn-bracket">]</span></span> <p>Consists of 2 packages <code class="docutils literal notranslate"><span class="pre">geographiclib-geodesic</span></code> and <code class="docutils literal notranslate"><span class="pre">geographiclib-dms</span></code> for handling geodesic calculations and DMS strings, respectively.</p> </aside> <aside class="footnote brackets" id="l" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id13">12</a><span class="fn-bracket">]</span></span> <p>Also available as npm packages <a class="reference external" href="https://www.npmjs.com/package/geographiclib-geodesic">geographiclib-geodesic</a> and <a class="reference external" href="https://www.npmjs.com/package/geographiclib-dms">geographiclib-dms</a>.</p> </aside> </aside> </section> <section id="online-utilities"> <h2>Online utilities<a class="headerlink" href="#online-utilities" title="Link to this heading">¶</a></h2> <p>The C++ library provides some online tools using GeographicLib</p> <ul class="simple"> <li><p><a class="reference external" href="../cgi-bin/GeoConvert">geographic coordinate conversions</a> between latitude/longitude, UTM or UPS, and MGRS;</p></li> <li><p><a class="reference external" href="../cgi-bin/GeodSolve">direct and inverse geodesic calculations</a>;</p></li> <li><p><a class="reference external" href="../cgi-bin/Planimeter">calculate the perimeter and area of geodesic polygons</a>;</p></li> <li><p><a class="reference external" href="../scripts/geod-calc.html">various geodesic calculations using JavaScript</a>;</p></li> <li><p><a class="reference external" href="../scripts/geod-google.html">a tool for displaying geodesics on Google Maps</a>;</p></li> <li><p><a class="reference external" href="../cgi-bin/RhumbSolve">rhumb line calculator</a>;</p></li> <li><p><a class="reference external" href="../cgi-bin/GeoidEval">evaluate the geoid height</a> for EGM84, EGM96, and EGM2008.</p></li> </ul> </section> <section id="datasets"> <h2>Datasets<a class="headerlink" href="#datasets" title="Link to this heading">¶</a></h2> <p>Some classes in the C++ library and the geoid functions in the Octave package require datasets to be available. Here are the links for the instructions for how to download and install these.</p> <table class="docutils align-default"> <thead> <tr class="row-odd"><th class="head"><p>Dataset</p></th> <th class="head"></th> <th class="head"></th> </tr> </thead> <tbody> <tr class="row-even"><td><p>geoids</p></td> <td><p><a class="reference external" href="https://sourceforge.net/projects/geographiclib/files/geoids-distrib">geoid data</a></p></td> <td><p><a class="reference external" href="../C++/doc/geoid.html#geoidinst">geoid instructions</a></p></td> </tr> <tr class="row-odd"><td><p>gravity models</p></td> <td><p><a class="reference external" href="https://sourceforge.net/projects/geographiclib/files/gravity-distrib">gravity data</a></p></td> <td><p><a class="reference external" href="../C++/doc/gravity.html#gravityinst">gravity instructions</a></p></td> </tr> <tr class="row-even"><td><p>magnetic models</p></td> <td><p><a class="reference external" href="https://sourceforge.net/projects/geographiclib/files/magnetic-distrib">magnetic data</a></p></td> <td><p><a class="reference external" href="../C++/doc/magnetic.html#magneticinst">magnetic instructions</a></p></td> </tr> </tbody> </table> </section> <section id="test-data"> <h2>Test data<a class="headerlink" href="#test-data" title="Link to this heading">¶</a></h2> <p>High quality test data is used to test GeographicLib for</p> <ul class="simple"> <li><p>the <a class="reference external" href="https://doi.org/10.5281/zenodo.32156">geodesic problem</a></p></li> <li><p>the <a class="reference external" href="https://doi.org/10.5281/zenodo.32470">transverse Mercator projection</a></p></li> <li><p><a class="reference external" href="../C++/doc/geoid.html#testgeoid">geoid heights</a></p></li> </ul> </section> <section id="other-implementations"> <h2>Other implementations<a class="headerlink" href="#other-implementations" title="Link to this heading">¶</a></h2> <p>Others have written independent implementations of the geodesic algorithms or have built other tools using GeographicLib:</p> <ul class="simple"> <li><p><em>Mathematica</em>: Kei Misawa, <a class="reference external" href="https://github.com/330k/mathematica-geodesic">mathematica-geodesic</a>.</p></li> <li><p><em>R</em>: R. J. Hijmans, <a class="reference external" href="https://cran.r-project.org/package=geosphere">geosphere</a>.</p></li> <li><p><em>Rust</em>: Michael Kirk, <a class="reference external" href="https://github.com/georust/geographiclib-rs">Rust implementation of GeographicLib</a>.</p></li> <li><p><em>Go</em>: Patrick Yukman, <a class="reference external" href="https://github.com/pymaxion/geographiclib-go">A Go port of GeographicLib</a>.</p></li> <li><p><em>Python via Cython</em>: Sergey Serebryakov, <a class="reference external" href="https://github.com/megaserg/geographiclib-cython-bindings">Cython extension module for GeographicLib</a>.</p></li> <li><p><em>JavaScript via emscripten</em>: William Wall, <a class="reference external" href="https://github.com/ngageoint/opensphere-asm">OpenSphere ASM</a>.</p></li> <li><p><em>JavaScript</em>: Jaco, <a class="reference external" href="http://geo.javawa.nl/coordcalc/index_en.html">a graphical tool for geodesic calculations</a>.</p></li> </ul> </section> </section> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="Main"> <div class="sphinxsidebarwrapper"> <div> <h3><a href="../index.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Library</a><ul> <li><a class="reference internal" href="#infrastructure">Infrastructure</a></li> <li><a class="reference internal" href="#supported-languages">Supported languages</a></li> <li><a class="reference internal" href="#online-utilities">Online utilities</a></li> <li><a class="reference internal" href="#datasets">Datasets</a></li> <li><a class="reference internal" href="#test-data">Test data</a></li> <li><a class="reference internal" href="#other-implementations">Other implementations</a></li> </ul> </li> </ul> </div> <div> <h4>Previous topic</h4> <p class="topless"><a href="../index.html" title="previous chapter">GeographicLib</a></p> </div> <div> <h4>Next topic</h4> <p class="topless"><a href="research.html" title="next chapter">Research</a></p> </div> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/doc/library.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <search id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> <input type="submit" value="Go" /> </form> </div> </search> <script>document.getElementById('searchbox').style.display = "block"</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="Related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="research.html" title="Research" >next</a> |</li> <li class="right" > <a href="../index.html" title="GeographicLib" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">GeographicLib 2.3 documentation</a> &#187;</li> <li class="nav-item nav-item-this"><a href="">Library</a></li> </ul> </div> <div class="footer" role="contentinfo"> &#169; Copyright 2009–2024, Charles Karney. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.0.2. </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10