Description Usage Arguments Details Value Author(s) Examples
View source: R/migrate_virtrast.R
function allowing to update the paths contained in "virtual rasters"
such as GDAL VRTs or R rasterStacks "pointing" to files on disk in the case that
the corresponding files on disk are moved.
1  | migrate_virtrast(in_rast, new_path, out_file = NULL)
 | 
in_rast | 
 
  | 
new_path | 
 
  | 
out_file | 
 
  | 
DETAILS
character path to the new "vrt" or "RData" file giving access to the raster
files
Lorenzo Busetto, phD (2017) lbusett@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13  | ## Not run: 
 # suppose you had a gdal vrt file "pointing" to tiff files originally located in
 # "/home/mypath/myfolder", and you successively moved them to "/home/mypath/mynewfolder"
 # and you want to update the vrt file so that it keeps working
 #TODO (Remove the # after uploading a test dataset on sprawl.data)
 #old_vrt  <- "/home/mypath/myfolder/myvrt.vrt
 #new_path <- "/home/mypath/mynewfolder"
 #new_vrt  <- migrate_virtrast(old_vrt, new_path)
 #new_vrt
 #raster::stack(new_vrt)
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.