Identifies which cells are pentagons. Any hexagonal tiling of the sphere must contain exactly 12 pentagons (at the icosahedron vertices). Pentagon cells have 5 neighbors instead of 6.
Details
H3 backend: Uses the vendored H3 isPentagon function.
ISEA backend: The 12 pentagons are located at icosahedron vertices,
which are always the (i, j) = (0, 0) cell of their quad. Pentagon status
is checked by decoding each input cell ID's own (quad, i, j) coordinates
via cell_to_lonlat()'s underlying grid math and testing whether i and j
are both zero, rather than by re-deriving each vertex's cell ID (the
forward direction has aperture-specific quirks – e.g. aperture 7's
substrate/surrogate coordinate distinction – that make a single fixed
formula for "the (0,0) cell ID of quad Q" unreliable across apertures).
See also
get_neighbors() for neighbor finding (pentagons have 5 neighbors)
Examples
# \donttest{
# H3 pentagon detection
g <- hex_grid(resolution = 1, type = "h3")
cells <- grid_global(g)
pent <- is_pentagon(cells$cell_id, g)
sum(pent) # Should be 12
# }