Learn R Programming

hexify (version 0.3.8)

cell_to_lonlat: Convert cell ID to longitude/latitude

Description

Converts DGGS cell IDs back to geographic coordinates (cell centers).

Usage

cell_to_lonlat(cell_id, grid)

Value

Data frame with lon_deg and lat_deg columns

Arguments

cell_id

Numeric vector of cell IDs

grid

A HexGridInfo or HexData object

See Also

lonlat_to_cell for the forward operation

Examples

Run this code
grid <- hex_grid(area_km2 = 1000)
cells <- lonlat_to_cell(c(0, 10), c(45, 50), grid)
coords <- cell_to_lonlat(cells, grid)

Run the code above in your browser using DataLab