R/brick.decimal.formatter.R
brick.decimal.formatter.RdImports a brick of raster ascii maps into a 'brick' object
brick.decimal.formatter(
file = NULL,
file_prefix,
formatter = "%04d",
file_extension = ".asc",
nlayers = 10,
use.read.raster.from.url = FALSE,
crs = NULL,
start.from.zero = FALSE
)fileneme of the 'brick' files containing the decimal formatter. It is NULL by default, otherwise it replaces file_suffix, formatter and file_extension.
character string suffix name of the 'brick' files.
string value. Default is "%04d" .
strinf value. Default is ".asc"
number of layers
logical value. Default is FALSE. (this is recommended in this function). If TRUE the RasterLayer are read with read.raster.from.url, istead of raster (otherwise). It is recomended in case the files whose paths are contained in x are remote and are 'http' addresses. In this cases the stand-alone method raster(x) does not always work and use.read.raster.from.url is necessary.
coordinate system see RasterBrick-class,brick, Default is NULL.
logical value. Default is FALSE. If TRUE the formatter starts from 0000, otherwise it starts from 0001.
the output is returned as a RasterBrick-class object
library(geotopbricks)
library(raster)
file <- system.file("example_files/examples/snowthickness",package="geotopbricks")
file <- paste(file,"SnowThickness0000L%04d.asc",sep="/")
# nlayers=15
nlayers <- 6 ## Only 6 layers are read to minimize the elapsed time of the example!!
b <- brick.decimal.formatter(file=file,nlayers=nlayers)
nlayers(b)
#> [1] 6
names(b)
#> [1] "X.tmp.Rtmp3iVngj.temp_libpath3b12fd26bdcaeb.geotopbricks.example_files.examples.snowthickness.SnowThickness0000L0001.asc"
#> [2] "X.tmp.Rtmp3iVngj.temp_libpath3b12fd26bdcaeb.geotopbricks.example_files.examples.snowthickness.SnowThickness0000L0002.asc"
#> [3] "X.tmp.Rtmp3iVngj.temp_libpath3b12fd26bdcaeb.geotopbricks.example_files.examples.snowthickness.SnowThickness0000L0003.asc"
#> [4] "X.tmp.Rtmp3iVngj.temp_libpath3b12fd26bdcaeb.geotopbricks.example_files.examples.snowthickness.SnowThickness0000L0004.asc"
#> [5] "X.tmp.Rtmp3iVngj.temp_libpath3b12fd26bdcaeb.geotopbricks.example_files.examples.snowthickness.SnowThickness0000L0005.asc"
#> [6] "X.tmp.Rtmp3iVngj.temp_libpath3b12fd26bdcaeb.geotopbricks.example_files.examples.snowthickness.SnowThickness0000L0006.asc"