#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)
gmted2010URL <- paste0("https://edcintl.cr.usgs.gov/downloads/sciweb1/shared/topo/downloads/GMTED/",
"Global_tiles_GMTED/300darcsec/med/E000/30N000E_20101117_gmted_med300.tif")
gmted2010Part <- terra::rast(gmted2010URL, vsi = TRUE)
#Check one point
distance_to_treeline(lon = 8.65, lat = 46.87, gstRaster = gst, gslRaster = gsl,
elevationRaster = gmted2010Part, elevation = 504,
pointDf = pointsAboveTreeline, plot = FALSE,
plotHist = FALSE, gstMin = 6.4, gslMin = 94)
distance_to_treeline(lon = 4.47, lat = 51.92, gstRaster = gst, gslRaster = gsl,
elevationRaster = gmted2010Part, elevation = 504,
pointDf = pointsAboveTreeline, plot = FALSE,
plotHist = FALSE, gstMin = 6.4, gslMin = 94)
distance_to_treeline(lon = -156.71, lat = 69.74,gstRaster = gst, gslRaster = gsl,
elevationRaster = gmted2010Part, elevation = 504,
pointDf = pointsAboveTreeline, plot = FALSE,
plotHist = FALSE, gstMin = 6.4, gslMin = 94)
# }
Run the code above in your browser using DataLab