if (FALSE) {
#.......................................
# create a directory to save the .tif
# files based on a Well Known Text (WKT)
# of a sample Area of Interest (AOI)
#.......................................
DIR_SAVE = file.path(Sys.getenv('HOME'), 'DIR_SAVE_DEM')
if (!dir.exists(DIR_SAVE)) dir.create(DIR_SAVE)
WKT='POLYGON((61.5234 27.0591, 63.6328 27.0591, 63.6328 28.1495, 61.5234 28.1495, 61.5234 27.0591))'
sf_obj = sf::st_as_sfc(WKT, crs = 4326)
sf_obj = sf::st_make_valid(sf_obj)
#.............
# 90 meter DEM
#.............
save_matches = CopernicusDEM::aoi_geom_save_tif_matches(sf_or_file = sf_obj,
dir_save_tifs = DIR_SAVE,
resolution = 90,
crs_value = 4326,
threads = parallel::detectCores(),
verbose = TRUE)
#.............
# 30 meter DEM
#.............
save_matches = CopernicusDEM::aoi_geom_save_tif_matches(sf_or_file = sf_obj,
dir_save_tifs = DIR_SAVE,
resolution = 30,
crs_value = 4326,
threads = parallel::detectCores(),
verbose = TRUE)
}
Run the code above in your browser using DataLab