PyGeodesy

26.3.26 · active · verified Wed Apr 15

PyGeodesy is a pure Python implementation of geodesy tools for various ellipsoidal and spherical earth models. It offers precision exact, elliptic, trigonometric, vector-based, iterative, and approximate methods for geodetic (lat-/longitude), geocentric (ECEF cartesian), local (LTP), and certain triaxial ellipsoidal coordinates. The library provides functionalities for computing distance, area, bearing, intersections, resections, and conversions across various coordinate systems and earth models. The current version is 26.3.26, and it is actively maintained with frequent updates.

Warnings

Install

Imports

Quickstart

This quickstart calculates the geodesic distance between two points using the Vincenty formulae, which is suitable for ellipsoidal earth models. It demonstrates the direct import of the `LatLon` class from a specific ellipsoidal model submodule and its `distanceTo` method.

from pygeodesy.ellipsoidalVincenty import LatLon

# Define two geographic points (latitude, longitude)
point1 = LatLon(41.49008, -71.312796) # Newport, RI
point2 = LatLon(41.499498, -81.695391) # Cleveland, OH

# Calculate the geodesic distance between the two points
distance = point1.distanceTo(point2)

print(f"Distance between Newport, RI and Cleveland, OH: {distance:,.2f} meters")

view raw JSON →