-
Notifications
You must be signed in to change notification settings - Fork 86
/
vrt.Rd
66 lines (49 loc) · 2.05 KB
/
vrt.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
\name{vrt}
\docType{methods}
\alias{vrt}
\alias{vrt,character-method}
\alias{vrt_tiles}
\title{Virtual Raster Dataset}
\description{
Create a Virtual Raster Dataset (VRT) from a collection of file-based raster datasets (tiles). See
\href{https://gdal.org/programs/gdalbuildvrt.html}{gdalbuildvrt} for details.
\code{vrt_tiles} returns the filenames of the tiles in a VRT.
}
\usage{
\S4method{vrt}{character}(x, filename="", options=NULL, overwrite=FALSE, set_names=FALSE, return_filename=FALSE)
vrt_tiles(filename)
}
\arguments{
\item{x}{character. Filenames of raster "tiles". See \code{\link{tiles}}}
\item{filename}{character. VRT filename}
\item{options}{character. All arguments as separate vector elements. Options as for \href{https://gdal.org/programs/gdalbuildvrt.html}{gdalbuildvrt}}
\item{overwrite}{logical. Should \code{filename} be overwritten if it exists?}
\item{set_names}{logical. Add the layer names of the first tile to the vrt?}
\item{return_filename}{logical. If \code{TRUE} the filename is returned, otherwise a SpatRaster is retunred}
}
\value{
SpatRaster
}
\note{
A VRT can reference very many datasets. These are not all opened at the same time. The default is to open not more than 100 files. To increase performance, this maximum limit can be increased by setting the GDAL_MAX_DATASET_POOL_SIZE configuration option to a bigger value with \code{\link{setGDALconfig}}. Note that a typical user process on Linux is limited to 1024 simultaneously opened files.
}
\seealso{
\code{\link{makeTiles}} to create tiles; \code{\link{makeVRT}} to create a .vrt file for a binary raster file that does not have a header file.
}
\examples{
r <- rast(ncols=100, nrows=100)
values(r) <- 1:ncell(r)
x <- rast(ncols=2, nrows=2)
filename <- paste0(tempfile(), "_.tif")
ff <- makeTiles(r, x, filename)
ff
#vrtfile <- paste0(tempfile(), ".vrt")
#v <- vrt(ff, vrtfile)
## output in lower resolution
#vrtfile <- paste0(tempfile(), ".vrt")
#v <- vrt(ff, vrtfile, options = c("-tr", 5, 5))
#head(readLines(vrtfile))
#v
}
\keyword{methods}
\keyword{spatial}