Learn R Programming

hexify (version 0.3.8)

hexify_quad_xy_to_cell: Convert Quad XY coordinates to Cell ID

Description

Converts Quad XY coordinates (continuous quad space) to DGGRID-compatible cell IDs. The coordinates are quantized to the nearest cell.

Usage

hexify_quad_xy_to_cell(quad, quad_x, quad_y, resolution, aperture = 3L)

Value

Numeric vector of cell IDs

Arguments

quad

Quad number (0-11), integer or vector

quad_x

Continuous X coordinate in quad space

quad_y

Continuous Y coordinate in quad space

resolution

Grid resolution level (0-30)

aperture

Grid aperture: 3, 4, or 7

Details

Compatible with 'dggridR' dgQ2DD_to_SEQNUM().

See Also

hexify_cell_to_quad_xy for the inverse operation, hexify_quad_ij_to_cell for integer grid coordinates

Other coordinate conversion: hexify_cell_id_to_quad_ij(), hexify_cell_to_icosa_tri(), 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_icosa_tri(), hexify_roundtrip_test()

Examples

Run this code
# Convert Quad XY to cell ID
cell_id <- hexify_quad_xy_to_cell(quad = 1, quad_x = 0.5, quad_y = 0.3,
                                   resolution = 10, aperture = 3)
print(cell_id)

Run the code above in your browser using DataLab