{"library":"geographiclib","title":"GeographicLib","description":"GeographicLib is a Python implementation of the geodesic routines from the larger C++ GeographicLib library. It provides accurate algorithms for solving direct and inverse geodesic problems, as well as calculating areas on an ellipsoid model of the Earth. The current version is 2.1, and it maintains a regular release cadence with updates tagged in its GitHub repository.","status":"active","version":"2.1","language":"en","source_language":"en","source_url":"https://github.com/geographiclib/geographiclib-python","tags":["gis","geographical","earth","distance","geodesic"],"install":[{"cmd":"pip install geographiclib","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Required runtime environment.","package":"python","optional":false}],"imports":[{"note":"Primary class for geodesic calculations.","symbol":"Geodesic","correct":"from geographiclib.geodesic import Geodesic"},{"note":"For creating geodesic lines and computing waypoints.","symbol":"GeodesicLine","correct":"from geographiclib.geodesicline import GeodesicLine"},{"note":"For measuring areas of geodesic polygons.","symbol":"PolygonArea","correct":"from geographiclib.polygonarea import PolygonArea"}],"quickstart":{"code":"from geographiclib.geodesic import Geodesic\n\n# Define the WGS84 ellipsoid\ngeod = Geodesic.WGS84\n\n# Solve the inverse geodesic problem (distance and azimuth between two points)\n# From Wellington, NZ (-41.32, 174.81) to Salamanca, Spain (40.96, -5.50)\ng = geod.Inverse(-41.32, 174.81, 40.96, -5.50)\nprint(f\"The distance is {g['s12']:.3f} meters.\")\n\n# Solve the direct geodesic problem (find a point at a given distance and azimuth)\n# 20000 km SW of Perth, Australia (-32.06, 115.74)\ng = geod.Direct(-32.06, 115.74, 225, 20000e3)\nprint(f\"The position is ({g['lat2']:.8f}, {g['lon2']:.8f}).\")","lang":"python","description":"This quickstart demonstrates how to use the `Geodesic` class to calculate the inverse (distance and azimuth between two points) and direct (finding a point given a starting point, azimuth, and distance) geodesic problems using the WGS84 ellipsoid."},"warnings":[{"fix":"Migrate your Python environment to Python 3.7+.","message":"Version 2.0 dropped support for Python 2.x. Users must upgrade to Python 3.7 or newer to use `geographiclib` version 2.0 and later.","severity":"breaking","affected_versions":">=2.0"},{"fix":"Review code that processes longitude or azimuth values near the ±180° boundary and adjust for the new range if necessary.","message":"Since version 1.48, the default range for returned longitudes and azimuths changed from `[-180°, 180°)` to `(-180°, 180°]`. Code relying on the exact boundary behavior (e.g., expecting -180° instead of 180° for certain cases) might need adjustment.","severity":"gotcha","affected_versions":">=1.48"},{"fix":"Remove any custom workarounds for `Geodesic.WGS84` attribute access and use it directly as intended.","message":"Version 2.1 fixed an issue where the `Geodesic.WGS84` attribute might not have been accessible. If you had workarounds for this, they might now be obsolete or cause unexpected behavior.","severity":"breaking","affected_versions":"2.1"},{"fix":"Be aware of the directional implications of positive and negative zero/180° in your calculations, especially for precise azimuth tracking or area computations involving `LONG_UNROLL`.","message":"Version 2.0 introduced a more careful treatment of ±0° and ±180° for longitudes and azimuths. Positive values (+0°, +180°) are now reckoned as east-going, while negative values (-0°, -180°) are west-going. This can subtly affect calculations involving these edge cases.","severity":"gotcha","affected_versions":">=2.0"}],"env_vars":null,"last_verified":"2026-04-05T00:00:00.000Z","next_check":"2026-07-04T00:00:00.000Z"}