Skip to content

Grid cell sizes are different - but should be the same? #68

@johnForne

Description

@johnForne

Kia ora

We using the awesome dggridR grids in Environmental Reporting in Aotearoa/New Zealand - thanks for your excellent work!

I'm not sure whether this is an issue per se - or more of a question...

I'm looking to describe the grid that we have used (or reporting on Sea Surface Temperature). From https://cran.r-project.org/web/packages/dggridR/vignettes/dggridR.html I understood that

dggridR builds discrete global grids which partition the surface of the Earth into hexagonal, triangular, or diamond cells, all of which have the same size. (There are some minor caveats which are detailed in the vignettes.)

However, I've noticed that the cells in the grid are not the same size. And the differences don't appear to be explained by the fact that

At every resolution, the Icosahedral grids contain 12 pentagonal cells which each have an area exactly 5/6 that of the hexagonal cells.

I've created an example below that is hopefully reproducible below to show the type of variation in grid cell sizes that I'm struggling to explain.

Can you please clarify why grid cell sizes do not have the same area?

Thanks in advance,

John

library(dggridR)
library(rnaturalearth)
library(tidyverse)

ne_countries(returnclass = 'sf') %>%
  filter(name == "New Zealand") %>% 
  st_write("data/poly.shp")

dggs300 <- dgconstruct(area = 300, metric = TRUE, resround='nearest') 

nz_grid_300 <- dgshptogrid(dggs300, "data/poly.shp", cellsize = 0.01) %>% 
  mutate(area_m2= st_area(.) %>% as.numeric())
  
nz_grid_300 %>% 
  mutate(area_m2_n = cut_number(area_m2, 6)) %>%  
  ggplot() + 
  geom_sf(data = nz, linewidth = 2) +
  geom_sf(aes(fill = area_m2_n)) +
  scale_fill_viridis_d(alpha = 0.5)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions