Loading...
Searching...
No Matches
GeographicLib library

Author
  Charles F. F. Karney (karne.nosp@m.y@al.nosp@m.um.mi.nosp@m.t.ed.nosp@m.u)

Version
  2.7

Date
  2025-11-06

# Abstract

GeographicLib is a small C++ library for

- geodesic and rhumb line calculations;
- conversions between geographic, UTM, UPS, MGRS, geocentric, and local cartesian coordinates;
- gravity (e.g., EGM2008) and geomagnetic field (e.g., WMM2025) calculations;
- computations on a triaxial ellipsoid.

The emphasis is on returning accurate results with errors close to round-off (about 5–15 nanometers). Accurate algorithms for Geodesics on an ellipsoid of revolution and Transverse Mercator projection have been developed for this library. The functionality of the library can be accessed from user code or from the Utility programs provided.

It is licensed under the MIT License; see LICENSE.txt.

This library is not a general purpose projection library nor does it perform datum conversions; instead use PROJ.

NOTE: Starting with version 2.0, this library only includes the C++ implementation. If you're interested in the C, Fortran, Python, Octave/MATLAB, Java, or JavaScript implementations, go here on the main GeographicLib web page.

# Links

- Library documentation (all versions): https://geographiclib.sourceforge.io/C++
- Git repository: https://github.com/geographiclib/geographiclib
  - Releases are on the release branch, and specific releases are tagged as, e.g., r1.52, r2.0, etc. This is the appropriate branch for most users of GeographicLib.
  - The main branch is main and most development is done on the devel branch. These branches are for the developers of GeographicLib. Tags v1.52, v2.0, etc., are aligned with the corresponding release tags r1.52, r2.0, etc.
- Source distribution: https://sourceforge.net/projects/geographiclib/files/distrib-C++
- Main GeographicLib web page: https://geographiclib.sourceforge.io
- SourceForge project page: https://sourceforge.net/projects/geographiclib
- The library has been implemented in a few other languages.

# Citing GeographicLib

When citing GeographicLib, use (adjust the version number and date as appropriate)

- C. F. F. Karney, GeographicLib, Version 2.7 (2025-11-06), https://geographiclib.sourceforge.io/C++/2.7

# Contents

- Introduction
- Installing GeographicLib
- Getting started
- Utility programs
- Code organization
- GeographicLib in other languages
- Geoid height
- Gravity models
- Normal gravity
- Magnetic models
- Geodesics on an ellipsoid of revolution
- Finding nearest neighbors
- Geodesics on a triaxial ellipsoid
- Jacobi's conformal projection
- Rhumb lines
- Great Ellipses
- Transverse Mercator projection
- Geocentric coordinates
- Auxiliary latitudes
- Support for high precision arithmetic
- Change log

Forward to Introduction.