JuliaCon 2026

MapMaths.jl - Leveraging Julia for Flexible and Fast Coordinate Transformations
2026-08-12 , Room 3

Points on or near the Earth can be represented in many coordinate systems - e.g. LatLonAlt, ECEF Cartesian or WebMercator to name just three. Without careful design, the amount of code required to convert between these systems scales quadratically and therefore quickly becomes unmanageable. In this talk, I will show how MapMaths.jl leverages Julia's type system and metaprogramming features to eliminate this and related sources of combinatorial explosions in coordinate conversion libraries.


The most straightforward way to implement a coordinate conversion library is to define functions like cartesian_from_latlonalt() or webmercator_from_cartesian(), but this approach requires manually implementing a new pair of conversion functions for every pair of coordinate systems and therefore puts a substantial cost on adding new systems. Furthermore, we frequently want to convert not just between full three-dimensional coordinate systems but also partial coordinate systems like latitude-longitude or WebMercator without altitude, and this forces us to either define even more conversion functions between even more start- and endpoints, or else to sacrifice readability and potentially performance by introducing "phantom coordinates" whose only purpose is to fill in the holes imposed by the API. Finally, every start and end coordinate system comes with a potentially distinct geodetic datum (a mathematical reference model for the true geometry of the earth), and this adds yet another layer of combinatorial complexity.

Julia has two fairly decent coordinate conversion packages, namely Geodesy.jl and CoordRefSystems.jl, but both of these packages solve the combinatorial explosion problem largely by force rather than clever software design. In this talk, I will show how MapMaths.jl leverages Julia features like multiple dispatch, Holy traits and generated functions so human programmers can implement just a spanning tree of coordinate conversions and then rely on the Julia compiler to fill in its transitive closure. As we will see, this conversion generator unlocks a new level of API flexibility and completeness, and it does that without sacrificing even an arcsecond of performance.

Mathematician and software engineer who has been coding in Julia for over ten years. I currently work on underwater acoustic communication systems and have been working in numerical linear algebra and electronic structure calculations in the past.