Here we demonstrate how we have downloaded and pre-processed the cartographic information for Cameroon which is included in the package.

Administrative borders

Download cartography from the Global Administrative Borders Database (GADM, https://gadm.org/) directly from within R.

animal_density_world <- raster(file.path(prodel_path, "glw", "WdCt8k_vf_Mn_Rw_To.tif"))
animal_density <- mask(crop(animal_density_world, extent(cmr_admin3)), cmr_admin3)

# plot(animal_density)
# summary(animal_density$WdCt8k_vf_Mn_Rw_To)

Save pre-processed cartography for use within the package

Prefer standard and modern Open Geospatial Consortium (OGC) formats: GeoPackage for vector maps and GeoTiff for raster images.

cmr_dir <- "./inst/cartography/CMR"
dir.create(cmr_dir, recursive = TRUE)

writeOGR(cmr_admin3, file.path(cmr_dir, "cmr_admin3.gpkg"), layer = "cmr_admin3", driver = "GPKG")
writeOGR(water_bodies, file.path(cmr_dir, "water_bodies.gpkg"), layer = "water_bodies", driver = "GPKG")
writeOGR(national_parks, file.path(cmr_dir, "national_parks.gpkg"), layer = "national_parks", driver = "GPKG")

writeRaster(animal_density, file.path(cmr_dir, "animal.density.tif"))