Learn R Programming

hexify (version 0.3.8)

hexify_cell_to_icosa_tri: Convert Cell ID to Icosa Triangle coordinates

Description

Converts DGGRID-compatible cell IDs to icosahedral triangle coordinates (face, x, y). These are the coordinates produced by the 'Snyder' 'ISEA' forward projection.

Usage

hexify_cell_to_icosa_tri(cell_id, resolution, aperture = 3L)

Value

Data frame with columns:

icosa_triangle_face

Triangle face number (0-19)

icosa_triangle_x

X coordinate on triangle face

icosa_triangle_y

Y coordinate on triangle face

Arguments

cell_id

Numeric vector of cell IDs (1-based)

resolution

Grid resolution level (0-30)

aperture

Grid aperture: 3, 4, or 7

Details

Compatible with 'dggridR' dgSEQNUM_to_PROJTRI().

See Also

hexify_cell_to_quad_ij for conversion to Quad IJ, hexify_cell_to_lonlat for conversion to lon/lat

Other coordinate conversion: hexify_cell_id_to_quad_ij(), hexify_cell_to_lonlat(), hexify_cell_to_plane(), hexify_cell_to_quad_ij(), hexify_cell_to_quad_xy(), hexify_grid_cell_to_lonlat(), hexify_grid_to_cell(), hexify_icosa_tri_to_plane(), hexify_icosa_tri_to_quad_ij(), hexify_icosa_tri_to_quad_xy(), hexify_lonlat_to_cell(), hexify_lonlat_to_plane(), hexify_lonlat_to_quad_ij(), hexify_quad_ij_to_cell(), hexify_quad_ij_to_icosa_tri(), hexify_quad_ij_to_xy(), hexify_quad_xy_to_cell(), hexify_quad_xy_to_icosa_tri(), hexify_roundtrip_test()

Examples

Run this code
# Get triangle coordinates for a cell
result <- hexify_cell_to_icosa_tri(cell_id = 1000, resolution = 10, aperture = 3)
print(result)

# Convert back to lon/lat using inverse projection
coords <- hexify_inverse(result$icosa_triangle_face,
                         result$icosa_triangle_x,
                         result$icosa_triangle_y)

Run the code above in your browser using DataLab