/circle-of-gps-coords

Calculation of a circle of given radius around centre coordinate.

Primary LanguagePython


Circle of GPS Co-ords

- An example of the direct problem of geodesy...
- For fun, have attempted to do this 'properly', though completely unnecessarily.
- Version_1_Haversine uses the spherical Haversine formula to the determine the points list.
- This version uses geopy to use an ellipsoidal model. It also produces (almost) well-formatted gpx files.

What I Learnt

In general:

  • An indirect problem in geodesy is the problem of finding the distance and bearing between two co-ordinate points.
  • A direct problem referes to finding a destination co-ordinate, given an origin, bearing and distance.
  • Beaing can be given in true heading which is degrees clockwise from North.
  • We recall that latitudes are horizontal and parallel, while longitudes (a.k.a. meridans) are great circles vertical on the globe.

Models and Accuarcy...

  • There are many formula, depending on the model: https://www.movable-type.co.uk/scripts/latlong.html
  • For the actual problem in which distances are less than a kilometre, the Euclidean (flat) model would work fine. This is true for distances up to around 10 km. But for the fun of learning, I have ignored this case.
  • The spherical model works if moving along distances in longitutde but not latitude, and if the polar regions where the planet is squashed are not in play. The haversine formula is used in this case, which has an accuracy of metres on kilometre scales.
  • A better approximation to the real shape of the Earth is the Ellipsoidal model. There are several formula to calculate the distance in this case, the most standard (to me at least, since impmented in geopy) is the Karney formula, which is an adaption of the Vincenty formula. In general, the Vincenty formula has millimeter precision, though may not converge for antipodal points, whle the Kerney has nanometer precision and does not have convergence problems. https://stackoverflow.com/questions/7222382/get-lat-long-given-current-point-distance-and-bearing

Haversine function:

Misc.

DD vs. DMS:

Decimals & precision in co-ordinates:

GPS exchange format: .gpx

  • An open standard xml file for GPS trackers. Good practice to validate, new lines/indents between tags are necessary.
  • It is recommended to reference two namespaces. I have not done this, and it still seems to work/validate... https://www.topografix.com/gpx_manual.asp