#Get raster layer from CHELSA
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)
#Classify a single point
point <- data.frame("lon" = 8.65, "lat" = 46.87)
classify_above_treeline(coords = point, gstRaster = gst, gslRaster = gsl,
gstTreshold = 6.4, gslTreshold = 94)
#Classify a dummy data frame
longitude <- rep(8.53, 11)
latitude <- seq(46.8, 46.9, 0.01)
temp <- data.frame(longitude, latitude)
classify_above_treeline(coords = temp, gstRaster = gst, gslRaster = gsl,
gstTreshold = 6.4, gslTreshold = 94)
# }
Run the code above in your browser using DataLab