5 ms·
Latitude and longitude are geometric values. Programming libraries are secondary abstractions to Earth geometry (third degree abstractions, to be precise, there
by SergeAx 5y ago
Latitude and longitude are geometric values. Programming libraries are secondary abstractions to Earth geometry (third degree abstractions, to be precise, there's WGS84 or other abstraction in between).
Negative longitude, negative latitude and even latitude modulo above 90 degrees will produce a point on the globe, but library-wise I would not allow it to pass input validation.
- WorldMaker 5y agoProgramming libraries are also things that need to do math on data points (in a way that programmers themselves can reason about). One of the reasons many of the math focused libraries prefer [lon, lat] data is because it is (close to, in some projections) an "intuitive" approach to [x, y] order and brings the geographic abstraction closer to the Euclidean geometry abstraction to make it easier for the programmers to reason with (regardless of which projection abstractions are in between). (Needing to do a deeper dive into some of Leaflet's code at one point gave me a somewhat greater appreciation over why there is such disagreement between [lat, lon] and [lon, lat] formats. Abstractions are hard, and when you know you already need a crazy projection abstraction or three, sometimes the simplicity of [x, y, z] Euclidean approximations feels like "home" for as much as you can reason in it and expect the projection math to "just work" with it as long as you are consistent.)