I would like to instigate a short review discussion on geodesy-related packages in Julia. My background is GIS, geospatial, and recently Discrete Global Grid Systems (DGGS) in particular. If you have heard of Uber H3, Google S2, DGGRID, or A5 systems, this is the direction. I had some experiences with the Pangeo folks picking up DGGS [0]. But still it feels inconvenient in Python. The reason is, most DGGS-related software is currently implemented in C/C++ and increasingly Rust, with Python-bindings at different levels of maturity and speed. I am increasingly enticed by the βnot 2 languagesβ promise of Julia and had some encouraging success in dabbling with JuliaGeo packages. So I would like to try to do more with DGGS in Julia.
One aspect in underlying geo logic is that most DGGS are implemented on the sphere and using them with ellpsoidal/WGS84 coordinates/geometries requires classic geodesic calculations to make an adjustment of the latitude values (authalic conversion) to be correct.
I am aware of two geodesy packages in Julia (Geodesy.jl and [1] and Geodesics.jl [2]). Geodesy.jl is apparently in maintenance mode, so I reached out to Geodesics.jl. I managed to port an extract of some of the routines for authalic latitude conversion to Julia ([3]), based from a Python package [4], which is based, like most packages, one way or another on Geographiclib by M. Karney [5].
But my question is also if there is interest in general to explore/compose native Julia implementations. There are DGGS-related activities like HEALPIX.jl [6] and DGGS.jl [7].
Thanks for consideration, happy to discuss more.
Alex
Thanks, yes and no Preferably in DGGS Iβd like to go as long as possible without geometries, DGGS are also quite well-structured, so a mesh is a bit of a step backwards. But the package looks very powerful.
And CoordRefSystems look good, too, but if I see correclty it also does not yet implement spherical to ellpisoid. Would you see a way forward to add this (or use my draft implementation as provided above) ?
Packages like ArchGDAL and GMT.jl or others that depend on GDAL have access to the PROJ library, which AFAIK is what almost everybody uses in the outside world.
You might be surprised if you study the Meshes.jl source code. Dont be fooled by the name. Grids are structured and fully supported with lazy data structures.
It does. Study the source code in detail and feel free to ask questions. If it doesnt have a specific conversion yet, it should be straightforward to add. We already worked out the design to acommodate all use cases.
If you want to go to a sphere, you could just specify the +R_A flag to Proj for your target CRS - that will make the target ellipsoid be a sphere with the same surface area as the reference ellipsoid, thus, an authalic transformation.
SO, I tested both CoordRefSystems and Proj (β+proj=latlon +R_Aβ like this?), and both do not transform as I expect them to (reference confirmed by geographiclib, pygeodesy, and another independent implementation. But both CoordRefSystems and Proj implement the proj way and behave basically the same.
The geographic latitude 58.39714590 needs to match with the authalic latitude 58.28252559
Or you could use an older realization of the WGS84 datum that is not the WGS84Latest alias.
CoordRefSystems.jl should match C PROJ to the last digit in double precision. Can you point in the source code what is causing the difference between our definition and yours? We should probably continue this discussion in a GitHub issue.
Hi @allixender, I would just omit the datum as explained above to make the code more readable. Other than that, I am glad it is producing the result you need.
Regarding the more general discussion on DGGS, try to study the Grid subtypes and the different Topology subtypes in Meshes.jl. They might shed some light on how to develop new grids that are compatible with our stack.