Four primary components:
targets
- determines amount of production increases needed for a given scenario
constraints
- determines probability of pixels being converted to meet targets
convert
- determines which pixels are converted to meet the crop production target
impacts
- assesses impacts in terms of land converted, carbon lost, protected areas transformed, etc. (outstanding)
library(trademod) path <- full_path(proj_root("trademod"), "trademod") load(full_path(path, "data/cropnames.rda")) y <- brick(full_path(path, "external/ext_data/ZA-potential-yields-std.tif")) clist <- list("C" = brick(full_path(path, "external/ext_data/ZA-carbon-priorities.tif")), "bd" = brick(full_path(path, "external/ext_data/ZA-cons-priorities.tif")), "cost" = raster(full_path(path, "external/ext_data/ZA-cost.tif"))) crop_frac <- brick(full_path(path, "external/ext_data/ZA-crop-convert-fractions-base.tif")) pot_yield <- brick(full_path(path, "external/ext_data/ZA-potential-yields.tif")) na1 <- calc(y, sum, na.rm = FALSE) na2 <- calc(pot_yield, sum, na.rm = FALSE) na3 <- calc(crop_frac, sum, na.rm = FALSE) valind <- which(!is.na(values(na1 + na2 + na3))) par(mfrow = c(2, 2), mar = c(1, 2, 1, 3), oma = c(0, 0, 0, 1)) plot(pot_yield[[1]], main = "potential maize yield", axes = FALSE, box = FALSE) plot(pot_yield[[5]], main = "potential soy yield", axes = FALSE, box = FALSE) plot(clist$C, main = "carbon stocks", axes = FALSE, box = FALSE) plot(clist$bd, main = "biodiversity value", axes = FALSE, box = FALSE)
A doubling in the need for 9 crops (over current production), except for maize (4X) and soybean (8X):
setwd(path) currprod <- brick(full_path(path, "external/ext_data/ZA-current-production.tif")) prod_targ <- c("maize" = 4, "cassava" = 2, "ground" = 2, "cotton" = 2, "soy" = 8, "pulse" = 2, "sunflower" = 2, "sugarcane" = 2, "wheat" = 2) potprod <- brick(full_path(path, "external/ext_data/ZA-potential-production-current-area.tif")) target <- targets(prod_targ = prod_targ, currprod = currprod, potprod = potprod, ybeta = NULL) target
constraints
to see which areas are most likely to be convertedWe'll first assume no constraint other than crop yield potential is applied
setwd(path) con1 <- constraints(y = y, ybeta = NULL, cbetas = c(0, 0, 0), clist = clist) names(con1) <- cropnames plot(con1,axes = FALSE, box = FALSE)
Next we'll assume that we care about protecting carbon and biodiversity also
setwd(path) con2 <- constraints(y = y, ybeta = NULL, cbetas = c(1, 1, 0), clist = clist) names(con2) <- cropnames plot(con2,axes = FALSE, box = FALSE)
setwd(path) converted1 <- convert2(con1, target, crop_frac = crop_frac, pot_yield = pot_yield, valind = valind, cropnames = cropnames) converted2 <- convert2(con2, target, crop_frac = crop_frac, pot_yield = pot_yield, valind = valind, cropnames = cropnames)
If crop yield is the only constraint
c1r <- dt_to_raster(dt = converted1, CRSobj = projection(con1)) plot(c1r, axes = FALSE, box = FALSE)
If we also care about carbon and biodiversity
c2r <- dt_to_raster(dt = converted2, CRSobj = projection(con2)) plot(c2r, axes = FALSE, box = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.