| a5_coordinates | R Documentation |
a5_lonlat_to_cell() maps longitude/latitude coordinates to the cell
containing each point at a resolution. a5_cell_to_lonlat() returns the
centre point of each cell. Indexing a cell's centre at the cell's own
resolution returns the cell.
a5_lonlat_to_cell(lon, lat, resolution)
a5_cell_to_lonlat(cell, as_dataframe = FALSE)
lon |
Numeric vector of longitudes in degrees. |
lat |
Numeric vector of latitudes in degrees, between -90 and 90.
Non-finite coordinates ( |
resolution |
Integer scalar or vector of resolutions (0–30),
recycled against |
cell |
An a5_cell vector (or character coercible to one). |
as_dataframe |
Logical scalar controlling the return container.
When |
a5_lonlat_to_cell(): an a5_cell vector.
a5_cell_to_lonlat(): a wk::xy() vector, or a data.frame with
columns lon and lat when as_dataframe = TRUE.
a5_cell_to_boundary() for full cell polygons,
a5_polygon_to_cells() for areas.
cell <- a5_lonlat_to_cell(-3.19, 55.95, resolution = 5)
a5_cell_to_lonlat(cell)
a5_cell_to_lonlat(cell, as_dataframe = TRUE)
# a cell's centre indexes back to the cell
ll <- a5_cell_to_lonlat(cell, as_dataframe = TRUE)
a5_lonlat_to_cell(ll$lon, ll$lat, resolution = 5) == cell
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.