danlooo / DGGS.jl

Discrete Global Grid System for Julia
GNU Affero General Public License v3.0
8 stars 2 forks source link

Need a 1:1 mapping of each cell to its parent cell #25

Open danlooo opened 1 year ago

danlooo commented 1 year ago

Center of hexagonal cells are at the edge of their parent cell. This yields into having the same distance to both parent cell centers. This makes the 1:1 mapping to the parent cell ambigious. We need to fix this. This problem is only for hexagonal grids:

image

danlooo commented 1 year ago

Each hexagon naturally has 7 children. This is independent of the aperture:

image Source: http://webpages.sou.edu/%7Esahrk/sqspc/pubs/autocarto14.pdf

Aperture 4 means that the area of a parent cell is 4 times larger than the area of a child cell.

Finding the children cell ids is trivial, i.e. the child cell with the same center coordinates of the parent + the 6 neighbors. Contrary, finding the parent cell results in ambiguities, i.e. there are multiple parent cells having the same minimal distance to the parent center points.

This has one major implication: If we compute the value of a parent cell by just using the values of its 7 child cells, points inside the ambiguous child hexagons will be counted for both parent cell neighbors. Since those ambigious hexagons have the same minimal distance to both parent hexagons, it makes sense to do so.

danlooo commented 1 year ago

On a 2D plane, one can just aggregate hexagons into big pseudo-hexagons (hexagons + little spikes):

image Source: http://webpages.sou.edu/~sahrk/sqspc/pubs/gdggs03.pdf

This is a complete-nested tessellation, i.e. there are no ambiguous child cells. However, we can not use this on a 3D shpere DGGS (Sahr et al. 2003) due to the following reasons: