GeographicLib-Ada documentation

This is a software port of the Geographic Lib to the Ada programming language. It is work in progress and as of now not a complete product. Basic functionality is working, but many features provided by the original implementation are missing.

The original C++ library, on which this port is partially based on (some parts are ported from the Java implementation) was written and is copyrighted by Charles Karney. The work was released under the free MIT/X11 License.

Motivation

Sample Code
 1procedure Add_Edge (Self : in out PolygonAreaClass; azi, s : Long_Float)
 2is
 3begin
 4 --- Do nothing if num is zero
 5   if Self.num > 0 then
 6   declare
 7     gd : constant GeodesicResult := Self.gd.Direct (Self.lat1, Self.lon1, azi, s, Self.imask);
 8   begin
 9     Self.perimetersum.Add (gd.s12);
10     if not Self.polyline then
11       Self.areasum.Add (gd.area12);
12       Self.crossings := Self.crossings + Transit_Direct (Self.lon1, gd.lon2);
13     end if;
14     Self.lat1 := gd.lat2;Self.lon1 := gd.lon2;
15     Self.num  := Self.num + 1;
16   end;
17 end if;
18end Add_Edge;

This is mainly an exercise to refresh my knowledge in the Ada programming language. I’ve chosen this library, because I’ve been using the Java version elsewhere and found it to be an excellent piece of software.

Current Status

As of now (January 2026) the following parts are done.

scratchpad

Math test:

Since Pythagoras, we know that \(a^2 + b^2 = c^2\).

\(\frac{ \sum_{t=0}^{N}f(t,k) }{N}\)

Documents the Make procedure.

This describes a function.

function Make (i, l : Integer) FooClass

This creates an record of GeoMath.FooClass

type Mask_Type

Documentation for Mask_Type