Geodesic lines, circles, envelopes in Google Maps (instructions)

The page allows you to draw accurate ellipsoidal geodesics on Google Maps. You can specify the geodesic in one of two forms:

(Angles may be entered as decimal degrees or as degrees, minutes, and seconds, e.g. -20.51125, 20°30′40.5″S, S20d30'40.5", or -20:30:40.5.) Click on the corresponding "compute" button. The display then shows

The sample data has lat1, lon1 in Wellington, New Zealand, lat2, lon2 in Salamanca, Spain, and s12 about 1.5 times the earth's circumference. Try clicking on the "compute" button next to the "Direct:" input box when the page first loads. You can navigate around the map using the normal Google Map controls.

The precision of output for the geodesic is 0.1" or 1 m. A text-only geodesic calculator based on the same JavaScript library is also available; this calculator solves the inverse and direct geodesic problems, computes intermediate points on a geodesic, and finds the area of a geodesic polygon; it allows you to specify the precision of the output and choose between decimal degrees and degrees, minutes, and seconds. Basic online tools which provide similar capabilities are GeodSolve and Planimeter; these call a C++ backend.

The JavaScript code for computing the geodesic lines, circles, and envelopes available in the JavaScript package geographiclib, the geodesic routines in GeographicLib ( documentation). The algorithms are derived in

Charles F. F. Karney,
Algorithms for geodesics,
J. Geodesy 87(1), 43–55 (Jan. 2013);
DOI: 10.1007/s00190-012-0578-z (pdf);
addenda: geod-addenda.html.
In putting together this Google Maps demonstration, I started with the sample code geometry-headings.

Charles Karney <> (2011-08-02)

Geographiclib Sourceforge