GeographicLib
1.42
|
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 self-contained 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 self-contained 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>GeographicLib-Java</artifactId> <version>1.42</version> </dependency>
in your pom.xml
.
For documentation, see
The directory doc/scripts/GeographicLib contains the classes
translated into JavaScript. See Interface.js for a simple JavaScript interface to these routines (documented near the top of the file). Examples of using this interface are
These examples include a "stripped" version of the JavaScript code,
which loads faster.
A python implementation of the geodesic routines from GeographicLib are provided in the python/geographiclib directory (which is installed as PREFIX/lib/python/site-packages/geographiclib, if COMMON_INSTALL_PATH is ON, and as PREFIX/python/geographiclib, otherwise). This contains implementations of the classes
You can also download the python interface independent of the rest of GeographicLib from
and then 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 geographiclib-1.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:/pkg-vc10-x64/GeographicLib-1.42/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 16-bit 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/geographiclib-legacy addpath C:/pkg-vc10-x64/GeographicLib-1.42/matlab/geographiclib-legacy
The GeographicLib toolbox must also be in your MATLAB path. A summary of the routines is obtained by
help geographiclib-legacy
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) and Geodesic (geod.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