Skip to content

Commit 4a77629

Browse files
committed
Add data formats to docs
1 parent 758a8ed commit 4a77629

File tree

5 files changed

+38
-11
lines changed

5 files changed

+38
-11
lines changed

docs/make.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ makedocs(;
1818
"Home" => "index.md",
1919
"API" => "api.md",
2020
"User Guide" => [
21-
"Get Started" => "get_started.md",
21+
"Get Started" => "get-started.md",
2222
"Background" => "background.md",
23+
"Data Format" => "data-format.md"
2324
],
2425
"Tutorials" => [
2526
"Remote Data" => "remote-blue-marble.md",

docs/src/.vitepress/theme/style.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/var
8484

8585
--vp-home-hero-image-background-image: linear-gradient(
8686
-45deg,
87-
#4063d8 30%,
88-
#389826 30%,
89-
#4063d8
87+
#4063d8 20%,
88+
#ffffff
9089
);
9190
--vp-home-hero-image-filter: blur(40px);
9291
}

docs/src/background.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ Steps top create a DGGS:
2323
4. Tessellate the faces of the polyhedron (e.g. triangles, diamonds, or hexagons). One must introduce 12 pentagons at the vertices of the polyhedron to enable a tesselation of the 3D surface with hexagons. Polygons are regular on the faces of the polyhedron but may be distorted after re-projection to the sphere.
2424
5. Redo the tessellation with increasing resolutions forming a grid system
2525

26-
![](assets/dggrid-grids-multi-levels.png)
27-
DGGRID ISEA4H grid at different spatial resolutions
28-
29-
![](assets/modis-ndvi-level6.png)
30-
MODIS NDVI at resolution level 6
31-
32-
3326
# When to use a DGGS
3427

3528
- Integration of data originated from different spatial resolutions (e.g. [Li et al. 2022](https://doi.org/10.3390/ijgi11120627))

docs/src/data-format.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
![](https://github.com/danlooo/DGGS.jl/raw/main/docs/src/assets/pentacube-overview.png)
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`.
File renamed without changes.

0 commit comments

Comments
 (0)