View source: R/hexify_cell_to_sf.R
| hexify_grid_rect | R Documentation |
Creates hexagon polygons covering a rectangular geographic region.
hexify_grid_rect(
minlon,
maxlon,
minlat,
maxlat,
area,
aperture = 3L,
resround = "nearest"
)
minlon, maxlon |
Longitude bounds |
minlat, maxlat |
Latitude bounds |
area |
Target cell area in km^2 |
aperture |
Grid aperture: 3, 4, or 7 |
resround |
Resolution rounding: "nearest", "up", or "down" |
sf object with hexagon polygons covering the specified region
grid_rect for the recommended S4 interface,
hexify_grid_global for global grids
Other sf conversion:
hex_corners_to_sf(),
hexify_cell_to_sf(),
hexify_grid_global()
library(hexify)
library(sf)
grid <- hexify_grid_rect(
minlon = -10, maxlon = 20,
minlat = 35, maxlat = 60,
area = 5000
)
plot(st_geometry(grid), border = "gray")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.