Learn R Programming

hexify (version 0.3.8)

hexify_lonlat_to_h_index: Convert longitude/latitude to hexagonal cell hierarchical index

Description

Converts geographic coordinates (longitude, latitude) to hexagonal cell hierarchical index strings. These strings encode the face, resolution, and cell location in a Z-order (Morton code) format.

Usage

hexify_lonlat_to_h_index(grid, lon, lat)

Value

Data frame with columns:

h_index

Hierarchical index (character string)

face

Icosahedron face number (integer, 0-19)

Arguments

grid

Grid specification from hexify_grid()

lon

Longitude vector in degrees (numeric, -180 to 180)

lat

Latitude vector in degrees (numeric, -90 to 90)

Details

Most users should use hexify_lonlat_to_cell or hexify_grid_to_cell which return DGGRID-compatible integer cell IDs.

This function returns hierarchical index strings useful for:

  • Understanding the cell's position in the hierarchy

  • Prefix-based spatial queries

  • Parent/child cell relationships