pyguymer3.geo.great_circle¶
- pyguymer3.geo.great_circle(lon1, lat1, lon2, lat2, /, *, debug=True, eps=1e-12, maxdist=None, nIter=100, npoint=None, prefix='.', ramLimit=1073741824)[source]¶
Calculate the great circle that connects two coordinates.
This function reads in two coordinates (in degrees) on the surface of the Earth and calculates the great circle that connects them, correctly handling crossing over the anti-meridian (should it occur).
- Parameters:
lon1 (float) – the longitude of the first coordinate (in degrees)
lat1 (float) – the latitude of the first coordinate (in degrees)
lon2 (float) – the longitude of the second coordinate (in degrees)
lat2 (float) – the latitude of the second coordinate (in degrees)
debug (bool, optional) – print debug messages (in metres)
eps (float, optional) – the tolerance of the Vincenty formula iterations
maxdist (float, optional) – the maximum distance between points along the great circle
nIter (int, optional) – the maximum number of iterations (particularly the Vincenty formula)
npoint (int, optional) – the number of points along the great circle
prefix (str, optional) – change the name of the output debugging CSVs
ramLimit (int, optional) – the maximum RAM usage of each “large” array (in bytes)
- Returns:
line – the great circle
- Return type:
shapely.geometry.linestring.LineString, shapely.geometry.multilinestring.MultiLineString
Notes
If neither maxdist nor npoint are provided then npoint will default to 5. For large great circles, prettier results are obtained by using maxdist rather than npoint.
Copyright 2017 Thomas Guymer [1]
References