python-geo
Set of algorithms and structures related to geodesy.
API
geo.sphere
Functions onto sphere
geo.sphere.approximate_distance
def approximate_distance(point1, point2):
Approximate calculation distance (expanding the trigonometric functions around the midpoint)
geo.sphere.haversine_distance
def _haversine_distance(point1, point2):
Calculating haversine distance between two points (see https://en.wikipedia.org/wiki/Haversine_formula, https://www.math.ksu.edu/~dbski/writings/haversine.pdf)
Is numerically better-conditioned for small distances
geo.sphere.distance
def distance(point1, point2):
Calculating great-circle distance (see https://en.wikipedia.org/wiki/Great-circle_distance)
geo.sphere.bearing
def bearing(point1, point2):
Calculating initial bearing between two points (see http://www.movable-type.co.uk/scripts/latlong.html)
geo.sphere.final_bearing
def final_bearing(point1, point2):
Calculating finatl bearing (initial bering + 180) between two points
geo.sphere.destination
def destination(point, distance, bearing):
Given a start point, initial bearing, and distance, this will calculate the destination point and final bearing travelling along a (shortest distance) great circle arc. (see http://www.movable-type.co.uk/scripts/latlong.htm)
geo.sphere.approximate_destination
def approximate_destination(point, distance, theta):
geo.sphere.from4326_to3857
def from4326_to3857(point):
Reproject point from EPSG:4326 (https://epsg.io/4326) to EPSG:3857 (https://epsg.io/3857) (see http://wiki.openstreetmap.org/wiki/Mercator)
- Spherical Mercator:
E = R*(λ - λo) N = R*ln(tan(π/4+φ/2))
geo.sphere.from3857_to4326
def from4326_to3857(point):
Reproject point from EPSG:3857 (https://epsg.io/3857) to EPSG:4326 (https://epsg.io/4326) (see http://wiki.openstreetmap.org/wiki/Mercator)
- Reverse Spherical Mercator:
λ = E/R + λo φ = π/2 - 2*arctan(exp(-N/R))
geo.ellipsoid
Functions onto ellipsoid
geo.ellipsoid.distance
def distance(point1, point2, ellipsoid=WGS84):
Calculating distance with using vincenty’s formula (see https://en.wikipedia.org/wiki/Vincenty’s_formulae)
geo.ellipsoid.from4326_to3395
def from4326_to3395(point, ellipsoid=WGS84):
Reproject point from EPSG:4326 (https://epsg.io/4326) to EPSG:3395 (https://epsg.io/3395) (see https://en.wikipedia.org/wiki/Mercator_projection#Generalization_to_the_ellipsoid)
- Ellipsoidal Mercator:
E = a*(λ - λo) N = a*ln(tan(π/4+φ/2)*((1-e*sin(φ))/(1+e*sin(φ)))**e/2)
geo.ellipsoid.from3395_to4326
def from3395_to4326(point, ellipsoid=WGS84):
Reproject point from EPSG:3395 (https://epsg.io/3395) to EPSG:4326 (https://epsg.io/4326) (see https://en.wikipedia.org/wiki/Mercator_projection#Generalization_to_the_ellipsoid)
- Reverse Ellipsoidal Mercator:
λ = E/a + λo φ = π/2 + 2*arctan(exp(-N/a)*((1-e*sin(φ))/(1+e*sin(φ))**e/2))
Metadata
Release files for geo-py 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| geo-py-0.4.tar.gz | 61.3 kB | Without provenance | Details for geo-py-0.4.tar.gz |
Release files / geo-py-0.4.tar.gz
| Download URL | geo-py-0.4.tar.gz |
|---|---|
| Size | 61.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ac02e08e24afc99795808f569f25b0075a0b2aa300b2ef3d40c061e02245c04
|
|
BLAKE2b-256 checksum How to use checksums |
ce1f5bdf66402875ef855ada02d12b52544a7905778ad0fe20453b8e3671e313
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for geo-py 0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.