Contents:
This toolbox provides native MATLAB implementations of a subset of the C++ library, GeographicLib. Key components of this toolbox are
- Geodesics, direct, inverse, area calculations.
- Projections, transverse Mercator, polar stereographic, etc.
- Grid systems, UTM, UPS, MGRS.
- Geoid lookup, egm84, egm96, egm2008 geoids supported.
- Geometric transformations, geocentric, local cartesian.
- Great ellipse, direct, inverse, area calculations.
All the functions are vectorized and so offer speeds comparable to compiled C++ code when operating on arrays.
Some common features of these functions:
- Angles (latitude, longitude, azimuth, meridian convergence) are measured in degrees.
- Distances are measured in meters, areas in meters^2.
- Latitudes must lie in
[-90, 90]
. Latitudes outside this range are treated in NaNs - The ellipsoid is specified as
[a, e]
, wherea
= equatorial radius ande
= eccentricity. The eccentricity can be pure imaginary to denote a prolate ellipsoid. - Keep
|e| < 0.2
(i.e.,|f| <= 1/50
) for full double precision accuracy.
There is some overlap between this toolbox and MATLAB's Mapping Toolbox. However, this toolbox offers:
- better accuracy;
- treatment of oblate and prolate ellipsoid;
- guaranteed convergence for geoddistance;
- calculation of area and differential properties of geodesics;
- ellipsoidal versions of the equidistant azimuthal and gnomonic projections.
The Octave/MATLAB packages are available on SourceForge and MATLAB Central.
Tha Octave package can be installed with the command
pkg install geographiclib-octave-M.N.tar.gz
pkg load geographiclib
The MATLAB toolbox can be installed with the command
matlab.addons.install geographiclib_toolbox-M.N.mltbx
Click on the function name for the definition of the function.
geoddistance
- Distance between points on an ellipsoidgeodreckon
- Point at specified azimuth, range on an ellipsoidgeodarea
- Surface area of polygon on an ellipsoid
tranmerc_fwd
- Forward transverse Mercator projectiontranmerc_inv
- Inverse transverse Mercator projectionpolarst_fwd
- Forward polar stereographic projectionpolarst_inv
- Inverse polar stereographic projectioneqdazim_fwd
- Forward azimuthal equidistant projectioneqdazim_inv
- Inverse azimuthal equidistant projectioncassini_fwd
- Forward Cassini-Soldner projectioncassini_inv
- Inverse Cassini-Soldner projectiongnomonic_fwd
- Forward ellipsoidal gnomonic projectiongnomonic_inv
- Inverse ellipsoidal gnomonic projection
utmups_fwd
- Convert to UTM/UPS systemutmups_inv
- Convert from UTM/UPS systemmgrs_fwd
- Convert UTM/UPS coordinates to MGRSmgrs_inv
- Convert MGRS to UTM/UPS coordinates
geoid_height
- Compute the height of the geoid above the ellipsoidgeoid_load
- Load a geoid model
geocent_fwd
- Conversion from geographic to geocentric coordinatesgeocent_inv
- Conversion from geocentric to geographic coordinatesloccart_fwd
- Convert geographic to local cartesian coordinatesloccart_inv
- Convert local cartesian to geographic coordinates
gedistance
- Great ellipse distance on an ellipsoidgereckon
- Point along great ellipse at given azimuth and range
defaultellipsoid
- Return the WGS84 ellipsoidecc2flat
- Convert eccentricity to flatteningflat2ecc
- Convert flattening to eccentricitygeographiclib_test
- The test suite for the geographiclib packagegeographiclib_signtest
- Another test suite
geoddoc
- Geodesics on an ellipsoid of revolutionprojdoc
- Projections for an ellipsoidgedoc
- Great ellipses on an ellipsoid of revolution
See the change log.
- GeographicLib.
- Implementations in other languages.
- How to install the geoid datasets.
- C. F. F. Karney, Transverse Mercator with an accuracy of a few nanometers, J. Geodesy 85(8), 475–485 (2011), preprint.
- C. F. F. Karney, Algorithms for geodesics, J. Geodesy 87(1), 43–55 (2013).