if (FALSE) {
polygons <- sf::st_read(system.file('extdata/Benin_communes.gpkg', package = 'mbg'))
id_raster <- build_id_raster(polygons)
pixel_fractions <- calculate_pixel_fractions_single_polygon(
polygon = polygons[1, ], id_raster
)
head(pixel_fractions)
}
Run the code above in your browser using DataLab