#Recommended usage
temp <- generate_grid(lon = 8.728898, lat = 46.93756, squareSize = 10, stepSize = 0.0025)
gstURL <- paste0("https://os.zhdk.cloud.switch.ch/chelsav2/GLOBAL/",
"climatologies/1981-2010/bio/CHELSA_gst_1981-2010_V.2.1.tif")
gslURL <- paste0("https://os.zhdk.cloud.switch.ch/chelsav2/GLOBAL/",
"climatologies/1981-2010/bio/CHELSA_gsl_1981-2010_V.2.1.tif")
# \donttest{
gst <- terra::rast(gstURL, vsi = TRUE)
gsl <- terra::rast(gslURL, vsi = TRUE)
temp$df <- classify_above_treeline(coords = temp$df, gstRaster = gst, gslRaster = gsl)
treeline <- sample_treeline(df = temp$df, lonLength = temp$lonLength,
latLength = temp$latLength, stepSize = 0.0025)
# }
Run the code above in your browser using DataLab