R語言geoviz包,mosaic_files#拼接光柵文件

image.png
Tue Mar 16 13:49:05 2021 -
字符編碼:UTF-8
R 版本:R x64 4.0.4 for window 10
cgh163email@163.com
個人筆記不負(fù)責(zé)任,拎了個梨??
.rs.restartR()
require(geoviz)
rm(list = ls());gc()
?mosaic_files#拼接光柵文件。將文件縫合到一個光柵中需要一個目標(biāo)目錄,其中包含可以用raster::raster()讀取的文件,例如.asc文件,或包含這些文件的.zip文件目錄
path_to_files <- system.file("extdata/example_asc", package = "geoviz")
path_to_output <- tempdir()
mosaic_files(path_to_files,
raster_output_file = paste0(path_to_output, '/mosaic_out.raster', sep = ''),
extract_zip = TRUE, file_crs = "+init=epsg:27700")
raster_mosaic <- raster::raster(paste0(path_to_output, '/mosaic_out.gri', sep = ''))
plot(raster_mosaic)