You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: design_doc.md
+19-8Lines changed: 19 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,15 @@ Xarrays extension for DGGS. Technical specifications.
5
5
## Goals
6
6
7
7
The goal of the `xdggs` library is to facilitate working with multiple Discrete Global Grid Systems (DGGSs) via a unified, high-level and user-friendly API that is deeply integrated with [Xarray](https://xarray.dev).
8
+
This document describes the in-memory representation of DGGS data in Python environments.
8
9
9
10
Examples of common DGGS features that `xdggs` should provide or facilitate:
10
11
11
12
- convert a DGGS from/to another grid (e.g., a DGGS, a latitude/longitude rectilinear grid, a raster grid, an unstructured mesh)
12
13
- convert a DGGS from/to vector data (points, lines, polygons, envelopes)
13
14
- convert between different cell id representations of a same DGGS (e.g., uint64 vs. string)
14
15
- select data on a DGGS by cell ids or by geometries (spatial indexing)
15
-
-change DGGS resolution (upgrade or downgrade)
16
+
-expand and reduce the available resolutions of a DGGS using down and upsampling, respectively.
16
17
- operations between similar DGGS (with auto-alignment)
@@ -29,7 +30,7 @@ Conversion between DGGS and other grids or vector features may requires specific
29
30
30
31
`xdggs` should also try to support applications in both GIS and Earth-System communities, which may each use DGGS in slightly different ways (see examples below).
31
32
32
-
When possible, `xdggs` operations should scale to fine DGGS resolutions (millions of cells). This can be done vertically using backends with vectorized bindings of DGGS implementations written in low-level languages and/or horizontally leveraging Xarray interoperability with Dask. Some operations like spatial indexing may be hard to scale horizontally, though. For the latter, we should probably focus `xdggs` development first towards good vertical scaling before figuring out how they can be scaled horizontally (for reference, see [dask-geopandas](https://github.com/geopandas/dask-geopandas) and [spatialpandas](https://github.com/holoviz/spatialpandas)).
33
+
When possible, `xdggs` operations should scale to fine DGGS resolutions (billions of cells). This can be done vertically using backends with vectorized bindings of DGGS implementations written in low-level languages and/or horizontally leveraging Xarray interoperability with Dask. Some operations like spatial indexing may be hard to scale horizontally, though. For the latter, we should probably focus `xdggs` development first towards good vertical scaling before figuring out how they can be scaled horizontally (for reference, see [dask-geopandas](https://github.com/geopandas/dask-geopandas) and [spatialpandas](https://github.com/holoviz/spatialpandas)).
33
34
34
35
## Non-Gloals
35
36
@@ -63,11 +64,15 @@ Figure 3: Raster data converted as DGGS (H3) cells of mixed resolutions ([source
63
64
64
65
### Standards and Conventions
65
66
66
-
There is no released standard yet regarding DGGS. However, there is a group working on a draft of OGC API for DGGS: https://github.com/opengeospatial/ogcapi-discrete-global-grid-systems.
67
+
The [OGC abstract specification topic 21](http://www.opengis.net/doc/AS/dggs/2.0) defines properties of a DGGS including the reference systems of its grids.
67
68
68
-
Another draft of DGGS specification can be found here: https://github.com/danlooo/dggs-data-spec.
69
+
However, there is no consensus yet about the actual specification on how to work with DGGD data.
70
+
[OGC API draft](https://github.com/opengeospatial/ogcapi-discrete-global-grid-systems) defines ways of how to access DGGS data.
71
+
The [DGGS data specification draft](https://github.com/danlooo/dggs-data-spec). aims to specify the storage format of DGGS data.
69
72
70
-
There are some discrepancies between the proposed standards and popular DGGS libraries (H3, S2, HealPIX). For example regarding the term used to define a grid unit: The two specifications above use "zone", S2/H3 use "cell" and HealPIX uses "pixel". Although in this document we use "cell", the term to choose for `xdggs` is still open for discussion.
73
+
There are some discrepancies between the proposed standards and popular DGGS libraries (H3, S2, HealPIX). For example regarding the term used to define a grid unit: The two specifications above use "zone", S2/H3 use "cell" and HealPIX uses "pixel".
74
+
OGC abstract specification topic 21 defines the region as a zone and its boundary geometry as a cell.
75
+
Although in this document we use "cell", the term to choose for `xdggs` is still open for discussion.
71
76
72
77
### Backends (Python)
73
78
@@ -93,7 +98,7 @@ Several Python packages are currently available for handling certain DGGSs. They
93
98
94
99
## Representation of DGGS Data in Xdggs
95
100
96
-
`xdggs` represents a DGGS as an Xarray Dataset or DataArray containing a 1-dimensional coordinate with cell ids as labels and with grid name, resolution & parameters (optional) as attributes. This coordinate is indexed using a custom, Xarray-compatible `DGGSIndex`.
101
+
`xdggs` represents a DGGS as an Xarray Dataset or DataArray containing a 1-dimensional coordinate with cell ids as labels and with grid name, resolution & parameters (optional) as attributes. This coordinate is indexed using a custom, Xarray-compatible `DGGSIndex`. Multiple dimensions may be used if the coordinate consists of multiple parts, e.g., polyhedron face, x, and y on that face in DGGRID PROJTRI.
97
102
98
103
`xdggs` does not support a Dataset or DataArray with multiple coordinates indexed with a `DGGSIndex` (only one DGGS per object is supported).
99
104
@@ -146,7 +151,7 @@ DGGS data may be created from various sources, e.g.,
146
151
147
152
- regridded from a latitude/longitude rectilinear grid
148
153
- regridded from an unstructured grid
149
-
- regridded and reprojected from a raster
154
+
- regridded and reprojected from a raster having a local projection
150
155
- aggregated from vector point data
151
156
- filled from polygon data
152
157
@@ -253,9 +258,15 @@ Alternatively, we could just get away with the conversion and cell geometry extr
253
258
254
259
## Handling hierarchical DGGS
255
260
256
-
Even though the DGGS coordinate of a Dataset (DataArray) is limited to cell ids of same resolution (no mixed-resolutions), `xdggs` can still provide functionality to deal with the hierarchical aspect of DGGSs.
261
+
DGGS are grid systems with grids of the same topology but different spatial resolution.
262
+
There is a hierarchical relationship between grids of different resolutions.
263
+
Even though the coordinate of one grid in the DGGS of a Dataset (DataArray) is limited to cell ids of same resolution (no mixed-resolutions), `xdggs` can still provide functionality to deal with the hierarchical aspect of DGGSs.
257
264
258
265
Selection by parent cell ids may be in example (see section above). Another example would be to have utility methods to explicitly change the grid resolution (see [issue #18](https://github.com/benbovy/xdggs/issues/18) for more details and discussion).
266
+
One can also store DGGS data at all resolutions as a list of datasets.
267
+
268
+
However, like in hexagonal grids of aperture 3 or 4 (e.g. DGGRID ISEA4H), the parent child relationship can be also ambiguous.
269
+
The actual spatial aggregation functions in the subclasses might be implemented differently depending on the selected DGGS.
0 commit comments