opengeospatial / CRS-Gridded-Geodetic-data-eXchange-Format

Gridded Geodetic data eXchange Format
11 stars 3 forks source link

Grid nesting definition - structural vs parameter #18

Closed ccrook closed 2 years ago

ccrook commented 2 years ago

This issue is to consider a possible alternative representation of nested grid structures in GGXF.

The current implementation of GGXF implements grid nesting using parameters in the grid header, ie (in abbreviated form)

grids:
  - gridName: grid_1
    gridData: []
  - gridName: grid_2
    parentGridName: grid_1
    gridData: []
  - gridName: grid_3
    parentGridName: grid_1
    gridData: []
  - gridName: grid_4
    gridData: []

Here grid_2 and grid_3 are subgrids of grid_1 because they define grid_1 as their parent grid.

An alternative approach would be to embody this nesting explicitly in the data structure, but creating a grids element inside grid_1. This would look like:

grids:
  - gridName: grid_1
    affineCoefs: []
    iRowMaximum:
    iColMaximum
    gridData: []
    grids:
      - gridName: grid_2
        affineCoefs: []
        iRowMaximum:
        iColMaximum
        gridData: []
      - gridName: grid_3
        gridData: []
  - gridName: grid_4
    gridData: []

This nesting can also be implemented in NetCDF4. In the current implementation each grid is represented by a NetCDF4 group which itself can contain other NetCDF4 groups.

Two reasons why this might be preferable:

A hierarchical grid organisation is still an option. In terms of implementation that would most simply be implemented using this approach using the slightly unintuitive approach of putting the most detailed grids earliest in the list, so that the grid to use is always the first grid in the list containing the calculation point. If it has subgrids then those are are tested using the same approach, and so on. The main reason for choosing a hierarchical organisation would probably be to represent complex grid data would be to handle grids that are not strictly nested (for example overlapping grids).

desruisseaux commented 2 years ago

Seems related to #24.

ccrook commented 2 years ago

The structural approach is now embedded in GGXF specification