| check_grid_coverage | R Documentation |
Calculate the grid coverage statistics for polygons
check_grid_coverage(grid_data, polygons, polygon_id_cols = NULL)
grid_data |
Data frame with longitude and latitude columns |
polygons |
sf object with polygon geometries |
polygon_id_cols |
Column names that identify the polygons |
A list with elements total_polygons, total_grid_points, polygons_with_points, polygons_without_points, coverage_percent, points_per_polygon (a data.frame of polygon identifiers and n_points) and summary (a one-line character description).
grid <- expand.grid(longitude = seq(72.5, 77.5, by = 1), latitude = seq(18.5, 21.5, by = 1))
grid$temperature <- seq_len(nrow(grid))
cells <- sf::st_make_grid(sf::st_as_sfc(sf::st_bbox(
c(xmin = 72, ymin = 18, xmax = 78, ymax = 22),
crs = 4326
)), n = c(2, 1))
polys <- sf::st_sf(region = c("west", "east"), geometry = cells)
check_grid_coverage(grid, polys)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.