Skip to content

LandscapeGeoinformatics/xdggs-dggal

Repository files navigation

xdggs-dggal

An xdggs plugin that registers the DGGAL discrete global grid systems as Xarray indexes.

The following DGGAL grids are registered by this plugin and can be used as the grid_name attribute on an xdggs-indexed cell-id coordinate:

  • ivea7h.dggal — IVEA7H
  • isea7hz7.dggal — ISEA7H (Z7 ordering)
  • rhealpix.dggal — rHEALPix
  • healpix.dggal — HEALPix

Install

pip install xdggs-dggal

Platform support

The underlying dggal wheel from ecere currently only works reliably on Linux. On macOS (arm64 and x86_64) the published wheel fails to load due to a flat-namespace linker issue in its _pyecrt extension. Track the upstream pydggal project for a fix.

Usage

See example_notebook/demo_xdggs-dggal.ipynb for a walkthrough covering grid registration, cell boundaries, and regridding gridded rasters onto DGGAL cells via the nearestcentroid method.

Minimal sketch:

import xarray as xr
import xdggs_dggal  # noqa: F401 — registers the DGGAL grids with xdggs

ds = xr.Dataset(...)  # with a cell_id coordinate whose attrs include
                      # grid_name="ivea7h.dggal" and level=N
ds = ds.dggs.decode()

The nearestcentroid regridder additionally requires pys2index, which you may need to install separately (it has no macOS arm64 wheel today).

Development

This project uses pixi for environment management:

pixi install
pixi run --environment dev test

Roadmap

Once mature and well-tested, the plan is to propose inclusion natively into the main xdggs repository.

License

MIT — see LICENSE.

About

An xdggs plugin for the DGGAL library

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors