Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3a15fc

Browse files
committed
m
1 parent a68baba commit a3a15fc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
- when computing aggregated time steps such as days from POSIXct (seconds) time, terra now uses the date in the specified time zone, unlike base `as.Date` that seems to return the date in the UTC time zone [#1896](https://github.com/rspatial/terra/issues/1896) by Kodi Arfer
1818
- better support for creating a SpatVector with an EMPTY wkt geometry [#1903](https://github.com/rspatial/terra/issues/1903) by Anatolii Tsyplenkov
19-
- `makeTiles` gains argument "value" to allow the return value to be a SpatRaster or SpatRasterCollection [#1894](https://github.com/rspatial/terra/issues/1894) by Márcia Barbosa
19+
- `makeTiles` gains argument "value" to allow the return value to be the filenames (default), a SpatRaster or a SpatRasterCollection [#1894](https://github.com/rspatial/terra/issues/1894) by Márcia Barbosa
2020

2121
## new
2222

R/tiles.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
setMethod("makeTiles", signature(x="SpatRaster"),
3-
function(x, y, filename="tile_.tif", extend=FALSE, na.rm=FALSE, buffer=0, value="files", overwrite=FALSE, ...) {
3+
function(x, y, filename="tile_.tif", extend=FALSE, na.rm=FALSE, buffer=0, ret="files", overwrite=FALSE, ...) {
44

5-
value <- match.arg(value, c("filenames", "raster", "collection"))
5+
ret <- match.arg(ret, c("files", "raster", "collection"))
66
filename <- trimws(filename[1])
77
filename <- filename[!is.na(filename)]
88
if (filename == "") error("makeTiles", "filename cannot be empty")
@@ -22,9 +22,9 @@ setMethod("makeTiles", signature(x="SpatRaster"),
2222
error("makeTiles", "y must be numeric or a SpatRaster or SpatVector")
2323
}
2424
messages(x, "makeTiles")
25-
if (value == "files") {
25+
if (ret == "files") {
2626
ff
27-
} else if (value == "raster") {
27+
} else if (ret == "raster") {
2828
filename <- gsub("_\\.", "s.", filename)
2929
vrt(ff, filename=filename)
3030
} else {

man/makeTiles.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Divide a SpatRaster into "tiles". The cells of another SpatRaster (normally with
2020

2121
\usage{
2222
\S4method{makeTiles}{SpatRaster}(x, y, filename="tile_.tif", extend=FALSE,
23-
na.rm=FALSE, buffer=0, value="files", overwrite=FALSE, ...)
23+
na.rm=FALSE, buffer=0, ret="files", overwrite=FALSE, ...)
2424

2525

2626
\S4method{getTileExtents}{SpatRaster}(x, y, extend=FALSE, buffer=0)
@@ -33,7 +33,7 @@ Divide a SpatRaster into "tiles". The cells of another SpatRaster (normally with
3333
\item{extend}{logical. If \code{TRUE}, the extent of \code{y} is expanded to assure that it covers all of \code{x}}
3434
\item{na.rm}{logical. If \code{TRUE}, tiles with only missing values are ignored}
3535
\item{buffer}{integer. The number of additional rows and columns added to each tile. Can be a single number, or two numbers to specify a separate number of rows and columns. This allows for creating overlapping tiles that can be used for computing spatial context dependent values with e.g. \code{\link{focal}}. The expansion is only inside \code{x}, no rows or columns outside of \code{x} are added}
36-
\code{value}{character. The type of rerturn value desired. Either "filenames", "raster" (for a SpatRaster), or "collection" (for a SpatRasterCollection)}
36+
\code{ret}{character. The type of return value desired. Either "files" (for the filenames), "raster" (for a SpatRaster), or "collection" (for a SpatRasterCollection)}
3737
\item{overwrite}{logical. If \code{TRUE}, existing tiles are overwritten; otherwise they are skipped (without error or warning)}
3838
\item{...}{additional arguments for writing files as in \code{\link{writeRaster}}}
3939
}

0 commit comments

Comments
 (0)