Open yellowcap opened 4 weeks ago
Hi @yellowcap Thats a great idia Here is the main version of xdggs https://github.com/xarray-contrib/xdggs/blob/main/xdggs/healpix.py I link to @keewis and @jmdelouis I also link to this issue https://github.com/xarray-contrib/xdggs/issues/11
Any pointers of how to go from Healpix ID to polygon would be quite helpful.
I was also wondering if there are some pre-computed layers with healpix geometries in a shapfile/geojson type format, because the grids themselves are static and could be pre-computed.
Any pointers of how to go from Healpix ID to polygon would be quite helpful.
xdggs
provides a cell_boundaries
method that returns shapely polygons (or as geoarrow
, but I don't remember whether I actually exposed that switch)
I was also wondering if there are some pre-computed layers with healpix geometries in a shapfile/geojson type format
not that I'm aware of, but this should be pretty easy to create (I'd write to geoparquet
, though, that's usually much faster to read than text-based formats).
Thanks @keewis great idea to just generate the necessary layers directly!
xdggs provides a cell_boundaries method that returns shapely polygons
I have seen this, but if I got it correctly, this is ultimatively being computed in C++, so to understand the actual contruction of the geometry and porting to Javascript, we will probably have to digg into the C code.
Probably its faster to pre-generate the levels that we want to use.
you could also use a rust library (cdshealpix
?), compile that to WASM and call it from javascript?
Thanks @keewis good idea. @danielfdsilva something to evaluate on the Javascript side?
The xarray-xddgs library has python functions to create polygons based on heaplix cell ids.
If we can port this to javascript we could do healpix visualizations in js applications.
From a quick look, it seems like xddgs relies on heaply for the caclulations, which in turn is bundles the HEALPix C++ library. So porting to javascript might not be simple because the heavy lift of the healpix calculations happens in C at the moment.