writeVector
and vect
now work with GPGK if the path has non-ascii characters #518predict
with cores > 1
and more than one output variable were garbledzonal
dropped category names when using an external (R) function #527 by Jakub Nowosadxy=TRUE
in as.data.frame
normalized the names #538 by Kodi ArfermakeTiles
has new arguments extend
and na.rm
#520 by by L. Dalbyproject<SpatRaster>
now uses nearest neighbor as default method for RGB rastersReleased on 2022-01-30
app<SpatRasterDataset>
ignored the filename. #498 by jszhaovect<data.frame>
failed silently if xy coordinates were integers #496 by Márcia Barbosaaggregate<SpatRaster>
was malformed when nrow(x) %% fact != 0
. #492 by Jean-François BourdonNA
s in SpatVector attributes where only recognized on Windows #491 by Márcia Barbosaplot<SpatVector>
failed when using a character variable with many unique values. #489 by Márcia Barbosarotate
failed on large files. Reported by Ujjawal Singhcrds
replicated the coordinates #504 by Murray Effordas.data.frame<SpatRaster>
returned integers if the file stored values as integers, even if there was a scale/offset that creates decimal numbers #509 by Kodi Arferproject
opened the input raster file in read/write mode intead of read mode. That did not work with files that cannot be updated.distance
, gridDistance
, direction
and patches
now process all layers of the input SpatRaster. #503 by Chris Haak()<-
methods. in-place updating available with set.
methods such as set.names
and set.values
. #493 by Jean Romain and 511 by Bryan Fuentesaggregate<SpatRaster>
now accepts functions that return more than one value per aggregated cellwriteVector
has new argument insert
to add a layer to an existing file (e.g. GPKG).method="weights"
for spatSample<SpatRaster>
mask<SpatVector,SpatVector>
method to select intersecting geometriesis.related
values<SpatRaster>
has new option na.rm=TRUE
. #490 by Henk HarmsenSpatVectorProxy
to provide access to large vector databases that cannot or should not be read into memory in its entirety.proxy=FALSE
to vect
to create a SpatVectorProxy objectquery<SpatVectorProxy>
to extract parts of a SpatVectorProxyvector_layers
that returns, and can delete, vector format layers from a database/file such as GPKGTo avoid name clashes with tidyverse
For consistency
Released on 2022-01-13
setValues
and init
failed (or even crashed R) when using a single value on a largish raster. #414sfc
to SpatVector
lost the crs. #415 by Jean-Luc Dupoueybuffer
on a SpatRaster with no values caused a crash #416 by Sebastian BrinkmannwriteVector
now assumes “traditional GIS order” (long/lat) if the CRS specifies lat/long. #333 by Agustin Lobomain
was ignored in density
when using a single layer SpatRaster #424 by dvictorimin
and mean
, when used with multiple SpatRasters and numbers, ignored additional SpatRasters #426 by Zhuonan Wangclassify
with right=FALSE
ignored include.lowest=TRUE
#442 by Alex Ilichpatches
now combines patches that connect across the data line #366 by Hirschtpatches(directions=8)
now connects in NE/SW direction #451 by Jean-François Bourdon.centroids
now considers cases where SpatVector parts are nearest to each other when crossing the date line in stead of the zero-meridian #366 by Hirschtterrain
created empty (NA
) rows between chunks used for processing large rasters. #453 by Robert Ritson.inset
did not draw the “box” correctly. #457 by Márcia Barbosaas.lines
now works with a points SpatVector #464 by Márcia Barbosavalues(x)<-
now accepts (hex coded) colors as valuesfocal
now wraps around the dateline like raster::focal #242 by Alexander Marbleraggregate
now does not show a progress bar in all cases #249 by Lachlanas.data.frame<SpatRaster> or <SpatVector>
are now also implemented as S3 methods to assure correct dispatch by other S3 methods such as data.table::as.data.table
. See #284 by Patrick Schratzcrs
now shows the correct authority if it is not EPSG. #419 by Matthew Williamsonrast<filename>
has a new argument lyrs
to subset the layers and open the file in one step.rast<array>
now has a crs and extent argument. 439 by RS-ecotype="xyz"
is now default in rast<data.frame>
438 by RS-ecoclassify
has a new argument brackets
to show if a side of an interval is open or closed.freq
and as.data.frame
#441 ngould7vect<matrix>
and vect<data.frame>
are now much faster #413 by BastienFRextract
with points provided as a matrix or cell numbers is not much faster #341focal
has a new argument na.policy
that can be set to one of “all” (default), “only” or “omit”. argument na.only
has been removed, as you can now use na.policy="only"
inset
argument border
changed to perimeter
to allow passing border
on to plot<Spat*>
. #456 by Márcia Barbosamemfrac
can now be set to zero (in stead of not lower than 0.1). #476 by Matt Strimas-MackeyallowGaps
in patches
to disallow gaps between patch IDs. See #478 by Dunbar Carpenter.mergeTime
to combine multiple rasters, perhaps partly overlapping in time, into a single time seriesfillTime
that can add empty layers in between existing layers to assure that the time step between layers is constantapproximate
to fill in missing values by cell across layersis.bool
and as.bool
for SpatRaster and explicit recognition of Boolean raster data in various places (e.g., extract, plot)is.int
and as.int
for SpatRaster.layerCor
(like raster::layerStats
). #420 by Alex IlichfocalCor
(like raster::corLocal
). #427 by Zhuonan Wangall.equal
for SpatRaster
. See #428 by Dongdong Kongmath
for SpatRaster
that implements the Math-generic methods and accepts a filenamesds<array>
rasterize<matrix>
, see #413 by BastienFRcolorize
to transform color representationsarrow
to draw a (North) arrow on a map. #461 by Márcia Barbosadensify
to insert nodes between existing nodes of a line or polygon SpatVectordirection
for SpatRaster. #462 by Márcia Barbosafocal3D
to compute focal values for a three-dimensional (row, column, layer) windowmakeVRT
to create a vrt file for a file that needs a header to be read.method="stratified"
for spatSample<SpatRaster>
. #470 by Michael Mahoneymemmax
to cap the amount of RAM that terra can be used in raster processing #476 by Matt Strimas-MackeygridDistance
to compute distances traversing a raster, perhaps with obstacles. #477 by Márcia BarbosaReleased on 2021-11-24
focal
now has ellipses (...
) to allow for providing additional arguments to fun
. For this reason it does not have a na.rm
argument anymore as that can be supplied via the ellipses. In practice this means that the default will be na.rm=FALSE
for the standard functions such as mean
and sum
.app
grossly overestimated RAM needed, slowing it down. Reported by Jerry Nelsonterra
now installs, again, with older versions of GEOS #406 by fparyaniterra
did not install with Clang on CRAN/OSX due to using C++13 idiom.lapp
and tapp
now have a cores
argument (as do app
and predict
). Suggested by Dongdong Kong #365focal
now also works with a function that returns multiple values (see #318 by Alex Ilich).focal
can now process multiple layers in one step.stars
objects #220 by Jakub NowosadfocalCpp
takes a C++ function that iterates over cells to speed up computation by avoiding apply
(see #318 by Alex Ilich).focalReg
for focal OLS regression models between layersReleased on 2021-11-16
terra
did not install with versions of GDAL below 3 #402 by Alex Ilich.distance
between two SpatVectors or matrices with pairwise=FALSE
returned a matrix that was filled by column instead of by row #403 by Paul SmithReleased on 2021-11-15
rast
with some NetCDF files failed because of bad parsing of dates. #361 by Juan Carlos Zamora-Pereiradistance<SpatRaster>
with lon/lat data was not correct. #368 by Greg Schmidtas.polygons<SpatRaster>
failed with a SpatRaster and a categorical layer that is not the first layer. #370 by Patrick Schratzrasterize
was not ignored, also causing errors when writing to temporary files. #377 by Robbie Pricerast<character>
crashed if the sds was an empty character string. #381 by Dan Bastonplot<SpatVector>
now responds to the range
argument #385 by Márcia Barbosazonal
failed for user-defined functions. #393 by mqueinnecselectHighest
to select n cell values with the highest or lowest values.vect<list>
to append SpatVectors (faster than do.call(rbind, x)
)align=FALSE
to project
to align to the template SpatRaster but ignore the resolutiongdalCache
to set the GDAL cache size, contributed by Dan Baston #387fileBlocksize
options
to writeVector
to pass layer creation options to GDALmergeLines
, snap
, makeNodes
, removeDupNodes
, gaps
, simplify
width
and clearance
terra
now installs with older versions of GEOS #363terra
now installs on CentOS 7 with GDAL 2.1.4 and a C++ compiler that does not support std::regexp. #384 by Ariel PaulsonReleased on 2021-10-11
setValues
now has two arguments (x
and values
), just like raster
had; to avoid reverse dependency problems with raster
Released on 2021-10-07
To avoid name conflicts with sp
(via raster
) disaggregate
is now called disagg
and bbox,SpatRaster
and bbox<SpatVector>
have been removed (but could be resurrected in raster
or under another name).
project
and resample
now choose the resampling method based on the first layer, using “near” for categorical data. Thanks to Matthew Lewis #355hist
failed with small samples. Issue #356 by Martin QueinnecReleased on 2021-10-05
terra
no longer depends on raster
. To avoid name clashes between these two packages, and to allow replacing methods from rgeos
and rgdal
in raster
, raster
now depends on terra
instead.
freq
has a new argument usenames
. See issue #309 by Bappa Dasrast<character>
has a new argument opts
that can be used to pass GDAL open options. See issue #314rast<SpatRaster>
now takes arguments names
and vals
. See issue #323 by Dongdong Kongcrs<-
now warns if an unsupported datum is used. See issue #317spatSample
now returns factor values if a SpatRaster layer is.factor except when using as.df=FALSE
origin<-
to set the origin of a SpatRaster. See issue #326 by Jakub Nowosadcrs
has a new argument parse
. See #344plot<SpatRaster,missing>
has a new argument reset=FALSE
that allows resetting the par()$mar parameters after plotting. See issue #340 by Derek Friendcrds
has a new argument na.rm
. See #338 by Kodi Arfershow(Spat*)
now prints the name and EPSG code of a crs if available. See #317 by Jakub NowosadplotRGB
failed if there were NA
s. Issue #308 by Jakub NowosadwriteVector
crashed R when used with a SpatVector with no geometries. Reported by Timothy White in issue #319summary<SpatRaster>
now returns counts for the classes (instead of a numerical summary of the indices) #324 by Jakub Nowosadtapp
with a character index now returns a SpatRaster with the correct names #345 by Stuart Brownrasterize
with a character variable now adds the ID column to the categories #337 by Tate BraselcellSize
now masks values in all cases (when requested with mask=TRUE
). Issue #339 by Jean-Luc Dupoueybuffer<SpatVector>
no longer treats lines like polygons #332 by Márcia Barbosaplot
now passes the layer index to fun
#310 by Ben Tupperto_id
in nearest
was sometimes wrong. See #328 by Shawn Ligockifocal
did not reset initial values for NA cells when processing chunks. #312 by Jeffrey Evansfocal
could run out of memory when using a large window and user-defined function, and was inexact at the chunk boundary #347zonal
with as.raster=TRUE
failed for categorical SpatRasters #348 by Jakub NowosadReleased on 2021-08-20
time(x) <- d
is set with a Date
class object, time(x)
now returns a Date
object instead of a POSIXct
object. Issue #256 raised by Mauricio Zambrano-Bigiarinirast<data.frame>
method to avoid confusion with the matrix
and list
methods in response to a SO question by StackbeanswriteCDF
now also writes the time dimensions if there is only one time-step. See this SO questionvect<character>
(filename) now has argument layer
to select a layer from a multi-layer file / database, and arguments query
, extent
and filter
for reading a subsetsubst
can now create multiple output layers See issue 276 by Agustin Loboclassify
can now create different multiple output layers See issue 276 by Agustin Loboalpha
of plot<SpatRaster>
can now be a SpatRaster
. See this SO question by James McCarthyfilename
and overwrite
arguments were ignored in rasterize
project
. Reported by Fabian Fischerrasterize<SpatRaster,SpatVector>
with inverse=TRUE
crashed the R session. Issue #264 by Jean-Luc Dupoueymerge
and mosaic
was not correct for large rasters (only the first rows were used). Reported by Zavud Baghirov in #271as.points,SpatRaster
did not remove NA
’s correctly and shifted values. Issues #269 and #273 by Julian Hagenauerrast<matrix>
rotated values when using an equal-sided matrix #274 by Jakub Nowosadproject
with a crs argument. #283 by Timothée Giraudclassify
, argument right
had TRUE and FALSE reversed.terrain
had edge effects #303 by Andrew Gene Brown.terrain
can now compute multiple variables at once #286 by Žan Kuraltwrap<SpatRaster>
changed factors into numeric #302 by Patrick SchratzwriteVector
failed with “FlatGeobuf” (and probably other formats as well) for not using a proper MultiPolygon #299 by L DalbyspatSample
is now much more regular #289 by Jakub NowosadReleased on 2021-06-20
na.omit<SpatVector>
to remove empty geometries and/or attribute records that have an NA
src
to create a SpatRasterCollection
(a loose collection of tiles).merge
and mosaic
now have methods for a SpatRasterCollection
. To avoid the (inefficient) use of do.call
. See issue #210 by Matthew Talluto.activeCat
and activeCat<-
to get or set the “active” category if there are multiple categories (raster attributes)as.numeric
and catalyze
to transfer categories to numeric cell valuesrange
and mean
for (the attributes of) a SpatVector
shade
, to compute hill shadingna.rm
) are now used by rasterize
with point geometries. Suggested by Jakub Nowosad #209gstat
models by interpolate
. See issue #208 by Jakub Nowosad.cpkgs
to predict
to list the packages that need to be exported to the cores if argument cores
is larger than one. ?predict
now shows different approaches to parallelize predict
(based on examples in issue #178 raised by by Matthew Coghill).freq
now returns labels for categorical layersadjacent
now has a pairs
argument. Requested by Kenneth Blake Vernon in issue #239adjacent
now also takes a matrix to specify adjacent cellsmean
and other summarize methods now take a filename
argument and disallow non-recognized named arguments. See issue #238 by Jessica Nephinvat.dbf
file is now ignored if it only has the counts of the values. See issue #234 by Julleegdal=""
write options and use BIGTIFF if necessary (suggested by Ani Ghosh)layer
in the extract-SpatRaster,SpatVector
method to extract values for a single layers specified for each geometry (see this question).extract
with points and cells=TRUE
or xy=TRUE
gave garbled outputas.character<SpatRaster>
(called by wrap
) did not capture the layer names. Reported by Pascal Title #213focal
mirrored the weight matrix, thus affecting the results when using an asymmetrical weight matrix. Reported by Sebastiano Trevisaniterra::terraOptions
now works without attaching the package (issue #229 reported by Karl Dunkle Werner)app
with ncores > 0
and a function that returns multiple layers now works (issue #240 reported by BastienFR.autocor
(local) can now handle NA
values. Reported by Jakub Nowosad #245.mask
with a SpatVector and a large (out of memory) multi-layer SpatRaster only worked for the first layer. Reported by Monika Tomaszewska.Released on 2021-05-13
as.lines
method for SpatRasteras.polygons
method for SpatVector linesautocor<numeric>
has new methods mean
, to compute the local mean, and locmor
, for the local Moran’s IsharedPaths
method for SpatVector (lines and polygons)RGB2col
method to reduce a three-layer RGB SpatRaster to a single layer SpatRaster with a color-table (with <= 256 colors)split
methods for SpatVector and SpatRasterrast<Raster*>
now takes the crs from the Raster object, not from the file it may point to. Suggested by Floris Vanderhaeghe #200convhull
has a new argument by=""
to make convex hulls for sub-sets of a SpatVector.extract
with multiple layers could return a data.frame where the values were not in the correct order (by row instead of by column)crop
works again with sf
objects. Reported by Sebastian Brinkmann #201vect<sf>
now also works for lines, and should be fastervect<character>
crashed R if a file had empty geometries. Reported by consumere #202extract(points, bilinear=TRUE, cells=TRUE)
now works. Reported by fab4app #203zonal
now works for min
and max
. Reported by Jakub Nowosad #207To avoid name conflicts with the spatstat
package
area,SpatRaster-method(x, sum=FALSE)
-> cellSize(x)
area,SpatRaster/SpatVector-method(x, sum=TRUE)
-> expanse(x)
convexhull
-> convHull
perimeter
-> perim
tiles
-> makeTiles
coords
-> crds
Released on 2021-04-30
trim
has a new argument value
that allows trimming rows and columns with other values than the default NA
rapp
has a new argument clamp
that allows clamping start and end values to 1:nlyr(x)
, avoiding that all values are considered NA
spatSample<SpatRaster>
has new arguments as.points
and values
. Getting values, cells and coordinates is no longer mutually exclusive. In response to #191. Requested by Agustin Loboarea<SpatRaster>
has a new argument mask=FALSE
classify
can now take a single number to request that many cutsmosaic
and merge
now warn and resample if rasters are not alignedextract
has a new argument exact
to get the fraction covered for each cellflip(x, direction="vertical")
no longer reverses the order of the layersextract
did not work for horizontal or vertical lines as their extent was considered invalid. Reported by Monika Tomaszewskaautocor
did not handle NA values #192. Reported by Laurence Hawkernearest
now works for angular coordinatesslope
in terrain
was not correct (the tangent was returned instead of the slope) #196. Reported by Sven Alderquantile
now works for rasters that have cells that are all NA
. Reported by Jerry NelsonTo avoid name conflicts with tidyverse
with deprecation warning:
without deprecation warning:
Released on 2021-04-14
c<SpatVector>
now returns a list. rbind
is used to append SpatVector objectsrats
has been removed, and levels
and cats
have changed