obspy.geodetics.base.gps2dist_azimuth
- gps2dist_azimuth(lat1, lon1, lat2, lon2, a=6378137.0, f=0.0033528106647474805)[source]
Computes the distance between two geographic points on the WGS84 ellipsoid and the forward and backward azimuths between these points.
- Parameters:
lat1 – Latitude of point A in degrees (positive for northern, negative for southern hemisphere)
lon1 – Longitude of point A in degrees (positive for eastern, negative for western hemisphere)
lat2 – Latitude of point B in degrees (positive for northern, negative for southern hemisphere)
lon2 – Longitude of point B in degrees (positive for eastern, negative for western hemisphere)
a – Radius of Earth in m. Uses the value for WGS84 by default.
f – Flattening of Earth. Uses the value for WGS84 by default.
- Returns:
(Great circle distance in m, azimuth A->B in degrees, azimuth B->A in degrees)
Note
This function will check if you have installed the Python module geographiclib - a very fast module for converting between geographic, UTM, UPS, MGRS, and geocentric coordinates, for geoid calculations, and for solving geodesic problems. Otherwise the locally implemented Vincenty’s Inverse formulae (
obspy.geodetics.base.calc_vincenty_inverse()
) is used which has known limitations for two nearly antipodal points and is ca. 4x slower.