GeographicLib
1.45

Implementations of subsets of GeographicLib are available in other languages
The directories legacy/C
and legacy/Fortran
contain implementations of Geodesic, GeodesicLine, and PolygonAreaT in C and Fortran respectively. These are intended for use in old codes written in these languages and should work any reasonably modern compiler. These implementations are entirely selfcontained and do not depend on the rest of GeographicLib. Sample main programs to solve the direct and inverse geodesic problems and to compute polygonal areas are provided.
For documentation, see
The directory java
contains implementations of Geodesic, GeodesicLine, and PolygonAreaT in Java. This implementation is entirely selfcontained and does not depend on the rest of GeographicLib. Sample main programs to solve the direct and inverse geodesic problems and to compute polygonal areas are provided.
This package is available on Maven Central; so if you're using Apache Maven as your build system, you can use this package by including the dependency
<dependency> <groupId>net.sf.geographiclib</groupId> <artifactId>GeographicLibJava</artifactId> <version>1.45</version> </dependency>
in your pom.xml
.
For documentation, see
The directory js/src contains the classes
translated into JavaScript. When GeographicLib is built the JavaScript source files are concatenated and compressed into a single file geographiclib.min.js
. This can be included into your document with
This file gives you the latest version of the library. If you need to use a specific version of this file, include a version number as in
You can visit http://geographiclib.sf.net/scripts/ to see which versions are available.
Starting with version 1.45, this package is available as an node package that can be installed with npm (thanks to Yurij Mikhalevich for help with this work). To install this as a node package, use
npm install geographiclib
For documentation, see
Examples of using this interface are
A Python implementation of the geodesic routines from GeographicLib are provided in the python/geographiclib directory (which is installed as PREFIX/lib/python/sitepackages/geographiclib, if COMMON_INSTALL_PATH is ON, and as PREFIX/python/geographiclib, otherwise). This contains implementations of the classes
You can install the Python interface independent of the rest of GeographicLib using pip
pip install geographiclib
This requires root privileges and you might first need to install the pythonpip package.
Alternatively download
and unpack the .tar.gz or .zip file. You can "install" these routines, so that they are in python's default path with, for example
cd geographiclib1.16 python setup.py install
(this will require root privileges). Or else you can set the path within Python using
An example of using this interface is
Another illustrative exercise is finding the point midway between JFK Airport to Singapore Changi Airport
(Note: The initial version of setup.py was provided by Andrew MacIntyre of the Australian Communications and Media Authority.)
The matlab/geographiclib
directory contains MATLAB and Octave implementations of some of the functions of GeographicLib. To use these, start MATLAB or Octave and run one of (for example):
addpath /usr/local/share/matlab/geographiclib addpath C:/pkgvc10x64/GeographicLib1.45/matlab/geographiclib
A summary of the routines is obtained by
help geographiclib
These MATLAB functions is also available from the MATLAB File Exchange site as the GeographicLib toolbox, package 50605.
The functions fall into the following groups
These functions reimplement the C++ routines from GeographicLib in MATLAB code (but note that routines for great ellipses are only available as MATLAB code). Because these functions are all vectorized, their performance is comparable to the C++ routines. The minimum version numbers required are
In addition, in order to use the geoid routines, Octave needs to have been built with a version of GraphicsMagick which supports 16bit images.
Previously, some of these routines were packaged as three separate packages
These packages have now all been incorporated into the GeographicLib toolbox.
Prior to version 1.42, GeographicLib was distributed with some MATLAB functionality offered via compiled interface code. This has now been replaced by native MATLAB wrapper functions which call the functions in the GeographicLib toolbox. To use these wrapper functions, run one of:
addpath /usr/local/share/matlab/geographicliblegacy addpath C:/pkgvc10x64/GeographicLib1.45/matlab/geographicliblegacy
The GeographicLib toolbox must also be in your MATLAB path. A summary of the routines is obtained by
help geographicliblegacy
These functions are DEPRECATED. Here is a function listing
The last routine can be used to compile the obsolete interface code (which is still provided as C++ code in the same directory). Doing this will switch MATLAB from using the native MATLAB routines to the compiled interface. However, the native code is easier to deploy and is about as fast; so the compiled interface will be removed at some point in 2016.
Maxima is a free computer algebra system which can be downloaded from http://maxima.sf.net. Maxima was used to generate the series used by TransverseMercator (tmseries.mac), Geodesic (geod.mac), Rhumb (rhumbarea.mac), The area under a great ellipse (gearea.mac), the relation between Auxiliary latitudes (auxlat.mac), and to generate accurate data for testing (tm.mac and geodesic.mac). The latter uses Maxima's bigfloat arithmetic together with series extended to high order or solutions in terms of elliptic integrals (ellint.mac). These files contain brief instructions on how to use them.
This is a comprehensive wrapper library, written and maintained by Scott Heiman, which exposes all of the functionality of GeographicLib to the .NET family of languages. For documentation, see