auromat.coordinates.geodesic module

This module contains functions for calculating and working with geodetic coordinates.

class auromat.coordinates.geodesic.Location

Bases: tuple

Location(lat, lon)

lat

Alias for field number 0

lon

Alias for field number 1

auromat.coordinates.geodesic.angularDistance(location1, location2)[source]

Return the shortest angular distance in degrees on an auxiliary sphere between two locations.

auromat.coordinates.geodesic.containsOrCrossesPole(points)[source]

Return whether the given polygon contains or crosses one of the poles.

Parameters:points (ndarray of shape (n,2) with lat,lon coordinates in degrees) – ordered points forming a non-intersecting unclosed polygon
Return type:bool
auromat.coordinates.geodesic.course(location1, location2)[source]

Return the course/azimuth in degrees when travelling from location1 to location2.

auromat.coordinates.geodesic.destination(location, azimuth, distance)[source]

Return the location when starting at location and travelling in direction azimuth for distance meters.

Parameters:
  • lat, azimuth (lon,) – in degrees
  • distance – in meters
Return type:

Location

auromat.coordinates.geodesic.distance(location1, location2)[source]

Return the shortest distance in meters between two locations.

auromat.coordinates.geodesic.intermediate(location1, location2, f=0.5)[source]

Return the location when travelling f * distance(location1,location2) meters starting at location1 in direction of location2.

Parameters:f – fraction to travel from location1 to location2
Return type:Location
auromat.coordinates.geodesic.line(location1, location2, resolution=1000)[source]

Return points on the given geodesic in the given resolution. If the distance between the two locations is smaller than the requested resolution, then the line points consist only of the unchanged start and end locations.

Parameters:resolution – in meters
Return type:ndarray of shape (n, 2) with [lat,lon] order
Returns:line points in degrees