Skip to main content

Set of algorithms and structures related to geodesy and geospatial data

Project description

Set of algorithms and structures related to geodesy.



Functions onto sphere


def approximate_distance(point1, point2):

Approximate calculation distance (expanding the trigonometric functions around the midpoint)


def _haversine_distance(point1, point2):

Calculating haversine distance between two points (see,

Is numerically better-conditioned for small distances


def distance(point1, point2):

Calculating great-circle distance (see


def bearing(point1, point2):

Calculating initial bearing between two points (see


def final_bearing(point1, point2):

Calculating finatl bearing (initial bering + 180) between two points


def destination(point, distance, bearing):

Given a start point, initial bearing, and distance, this will calculate the destina­tion point and final bearing travelling along a (shortest distance) great circle arc. (see


def approximate_destination(point, distance, theta):


def from4326_to3857(point):

Reproject point from EPSG:4326 ( to EPSG:3857 ( (see

Spherical Mercator:
E = R*(λ - λo) N = R*ln(tan(π/4+φ/2))


def from4326_to3857(point):

Reproject point from EPSG:3857 ( to EPSG:4326 ( (see

Reverse Spherical Mercator:
λ = E/R + λo φ = π/2 - 2*arctan(exp(-N/R))


Functions onto ellipsoid


def distance(point1, point2, ellipsoid=WGS84):

Calculating distance with using vincenty’s formula (see’s_formulae)


def from4326_to3395(point, ellipsoid=WGS84):

Reproject point from EPSG:4326 ( to EPSG:3395 ( (see

Ellipsoidal Mercator:
E = a*(λ - λo) N = a*ln(tan(π/4+φ/2)*((1-e*sin(φ))/(1+e*sin(φ)))**e/2)


def from3395_to4326(point, ellipsoid=WGS84):

Reproject point from EPSG:3395 ( to EPSG:4326 ( (see

Reverse Ellipsoidal Mercator:
λ = E/a + λo φ = π/2 + 2*arctan(exp(-N/a)*((1-e*sin(φ))/(1+e*sin(φ))**e/2))

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for geo-py, version 0.4
Filename, size File type Python version Upload date Hashes
Filename, size geo-py-0.4.tar.gz (61.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page