|
| 1 | +# Data Format |
| 2 | + |
| 3 | +DGGS.jl stores data of individual DGGS cells in rasters, in which the cell ids can be calculated by row and column numbers. |
| 4 | + |
| 5 | +## Projection |
| 6 | + |
| 7 | +Geographical coordinates are first projected into a plane using Snyder equal-area projection, followed by a linear transformation, yielding a tesselation of the earth surface into 5 matrices. |
| 8 | +The transformed coordinates are then adjusted downward to get the final discrete cell ids as (i,j,n) tuples at row 0<=i<=2*2^r, column 0<=i<=2^r, and matrix 0<=n<=4>. |
| 9 | +Moreover, the cell id can be re-interpreted as a single integer, by concatenating the bits of the individual axial coordinates. |
| 10 | +The refinement level r determines the spatial resolution, halving the width and length of the 5 matrices in each subsequent coarser levels. |
| 11 | +The final DGGS in an image pyramid of datasets at a given refinement level and all coarser levels. |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +## Data Format |
| 16 | + |
| 17 | +The data is stored according to the [Unidata's Common Data Model (CDM)](https://docs.unidata.ucar.edu/netcdf-c/current/netcdf_data_model.html) using [CF Metadata Conventions](https://cfconventions.org/) by extending attributes and dimensions with the prefix `dggs_`. |
| 18 | +An example in Zarr forma is provided at [https://github.com/danlooo/blue-marble.dggs.zarr](https://github.com/danlooo/blue-marble.dggs.zarr). |
| 19 | +The root group contains a group for all spatial refinement levels (dataset) that contain all variables (arrays) for variables and dimensions at the given level. |
| 20 | +Each dataset MUST contain spatial dimensions `dggs_i`, `dggs_j`, and `dggs_n`. |
| 21 | + |
| 22 | +## Meta Data |
| 23 | + |
| 24 | +Attributes used to descirbe the DGGS: |
| 25 | + |
| 26 | +| key | format | example |description | |
| 27 | +| --- | --- | --- | --- | |
| 28 | +| dggs_resolution | int | 2 | Spatial refinement level defined by the given DGGSRS | |
| 29 | +| dggs_bbox | `{"X":[float,float],"Y":[float,float]}` | `{"X":[-180.0,180.0],"Y":[-90.0,90.0]}` | Bounding box of the data in WGS84 | |
| 30 | +| dggs_dggsrs | string | "ISEA4D.Penta" | Name of DGGSRS | |
| 31 | + |
| 32 | +The root group `/` MUST contain attributes `dggs_bbox` and `dggs_dggsrs`. |
| 33 | +Dataset groups `/dggs_s{r}` MUST contain attributes `dggs_dggsrs` and `dggs_resolution`. |
| 34 | +Arrays `/dggs_s{r}/{array_name}` MUST contain attributes `dggs_bbox`, `dggs_dggsrs`, and `dggs_resolution`. |
0 commit comments