Skip to content

Commit

Permalink
n
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Jan 31, 2024
1 parent 9302a25 commit 9673041
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- `polys` argument "alpha" was ignored if a single color was used. [#1413](https://github.com/rspatial/terra/issues/1413) by Derek Friend
- `query` ignore the "vars" argument if all rows were selected. [#1398](https://github.com/rspatial/terra/issues/1398) by erkent-carb.
- `spatSample` ignored "replace=TRUE" with random sampling, na.rm=TRUE, and a sample size larger than the non NA cells. [#1411](https://github.com/rspatial/terra/issues/1411) by Babak Naimi
- `spatSample` sometimes returned fewer values than requested and available for lonlat rasters. [#1396](https://github.com/rspatial/terra/issues/1396) by Márcia Barbosa.


## enhancements
Expand All @@ -26,6 +27,7 @@

- `prcomp<SpatRaster>` method [#1361](https://github.com/rspatial/terra/issues/1361#issuecomment-1860311029) by Jakub Nowosad
- `add_box` to add a box around the map. The box is drawn where the axes are, not around the plotting region.
- `getTileExtents` provides the extents of for tiles. These may be used in parallelization. See [#1391](https://github.com/rspatial/terra/issues/1391) by Alex Ilich.


# version 1.7-65
Expand Down
2 changes: 1 addition & 1 deletion R/tiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ setMethod("makeTiles", signature(x="SpatRaster"),


setMethod("getTileExtents", signature(x="SpatRaster"),
function(x, y, extend=FALSE, na.rm=FALSE, buffer=0) {
function(x, y, extend=FALSE, buffer=0) {

opt <- spatOptions(filename="")
if (inherits(y, "SpatRaster")) {
Expand Down
7 changes: 6 additions & 1 deletion man/makeTiles.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Divide a SpatRaster into "tiles". The cells of another SpatRaster (normally with

\arguments{
\item{x}{SpatRaster}
\item{y}{SpatRaster, SpatVector, or numeric}
\item{y}{SpatRaster or SpatVector defining the zones; or numeric specifying the number of rows and columns for each zone (1 or 2 numbers if the number of rows and columns is not the same)}
\item{filename}{character. Output filename template. Filenames will be altered by adding the tile number for each tile}
\item{extend}{logical. If \code{TRUE}, the extent of \code{y} is expanded to assure that it covers all of \code{x}}
\item{na.rm}{logical. If \code{TRUE}, tiles with only missing values are ignored}
Expand All @@ -51,6 +51,11 @@ character (filenames) or matrix (extents)
r <- rast(ncols=100, nrows=100)
values(r) <- 1:ncell(r)
x <- rast(ncols=2, nrows=2)

getTileExtents(r, x)
getTileExtents(r, x, buffer=3)


filename <- paste0(tempfile(), "_.tif")
ff <- makeTiles(r, x, filename)
ff
Expand Down
2 changes: 1 addition & 1 deletion man/vrt.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Create a Virtual Raster Dataset (VRT) from a collection of file-based raster dat
}

\arguments{
\item{x}{character. Filenames of raster "tiles". See \code{\link{tiles}}}
\item{x}{character. Filenames of raster "tiles". That is, files that have data for, typically non-overlapping, sub-regions of an raster. See \code{\link{makeTiles}}}
\item{filename}{character. output 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?}
Expand Down

0 comments on commit 9673041

Please sign in to comment.