plot<SpatVector>
used the wrong main label in some cases #1210 by Márcia Barbosa
plotRGB
failed with an "ext=" argument #1228 by Dave Edge
wrap<SpatRaster>
now stores color tables #1215 by Patrick Brown
global
now has a "maxcell" argument #1213 by Alex Ilich
layerCor
with fun='pearson' now returns output with the layer names #1206
compareGeom
for list and SpatRasterCollection #1207 by Sarah Endicott
is.rotated<SpatRaster>
method #1229 by Andy Lyons
Released 2023-06-23
- the tempdir option did not use path.expand. #1195 by Alex Ilich
- the layer names returned by predict where inconsistent when using argument "index". #1194 by Michael Mahoney
- compilation failed with older compilers because of use of std::filesystem #1191
- Small changes to
RGB<-
andcoltab<-
so that terra can be installed with R-devel (after a bug fix https://bugs.r-project.org/show_bug.cgi?id=18538)
Released 2023-06-18
rasterize
with points and a custom function did not work for large rasters. #1127 by Skip Woolleycrop<SpatRaster, SpatVector>
with "mask=TRUE" did not work well if the raster had a scale/offset #1128 by Monika Anna Tomaszewskazonal<SpatRaster>
with a custom function always removed NAs. #1133 by Matthias Weigandwrap<SpatRaster>
lost changed layer names if the source was from disk; and information on some time-step in some cases. #1144 by Pascal Führlichglobal(fun="isNA")
was not correct when the SpatRaster had multiple layers #1141 by Robin FreemaninterpIDW
withnear=TRUE
did not work properly (near=TRUE is now the default). #1186 by Hugh Graham- "YYYY-1-1" was sometimes encoded as "YYYY-13-1". #1168 by Colin Brust
panel
for categorical SpatRasters. #1143 by Jason Flower- argument "ext" in
plot<SpatRaster>
can now also expand the plot. #1136 by Jakub Nowosad. - argument
overwrite=FALSE
tomakeTiles
. #1167 by Gray Martin. - legend options for
<plet,SpatVector
>. #1177 by Agustin Lobo. - better handling of mixed geometry type vector data by
vect
andsvc
. #1160 by Mike Sumner. - new argument
sql
toquery<SpatVectorProxy>
. #1157 by Carl Boettiger - support for writing raster data to a vitual file system #1209 by Carl Boettiger
wrap<SpatRasterDataset>
andwrap<SpatRasterCollection>
methods. #954 by James Camac
Released 2023-04-22
regress<SpatRaster,numeric>
to get regression model coefficients for each cell, with a fixed "X".regress<SpatRaster,SpatRaster>
to get regression model coefficients for each cell.
lapp<SpatRasterDataset>
is now more flexible in that it can now also use functions that are vectorized by cell, not by chunk. See #1029project<SpatVector>
has new argument "partial=FALSE" that can be used to keep geometries that can only be partially included in the output crs.- extracting a SpatVector column with a non-existing variable name now returns NULL (because that is what a data.frame does) instead of throwing an error. #1118 by Derek Friend.
- a problem with reading empty categories in .img files created buggy SpatRasters
global
with fun="notNA" was wrong #111 by Jeffrey Hansonextract<SpatRaster,SpatVector>
with "bind=TRUE" did not workextract<SpatRaster,SpatVector>
with point geometries and a "fun" returned values in the wrong orderplot<SpatRaster>
argument "colNA" did not work when "alpha" was also set #1102 by Márcia Barbosacrop<SpatRaster>
with "extend=TRUE" did not extend the SpatRaster if the input had no cell values. #1114 by Jasper van Doninck- setting a factor or date/time variable in a SpatVector did not work #1117 by MK Schneider
focalMat
did not work well when using terraOptions(todisk=T) #1116
Released 2023-04-08
- The
halo
function for adding halo-ed text to plots is now exposed add_legend
to allow using a keyword such as "topleft" to position a custom legend. #1053 by Márcia Barbosa- the
same.crs
function is now exported countNA<SpatRaster>
methodsplit<SpatVector,SpatVector>
to split polygons with lines
- better support for other color spaces than RGB #1060 by Dominic Royé
- path expansion in writeVector #1055 by Andrew Gene Brown.
clamp<SpatRaster>
now also accepts SpatRasters to set the lower and upper boundaries.freq
has new arguments "zones=NULL" and "wide=FALSE", to allow tabulation of values by zone.expanse<SpatRaster>
has new arguments "zones=NULL" and "wide=FALSE", to allow tabulation of values by zone.unique<SpatRaster>
has new argument "digits=NA"rasterize<SpatRaster,SpatVector>
now accepts fun="table" to tabulate cells by cell valuerast<character>
has new argument "snap" to snap the window in or out. #1094 by Derek Friendplot
has new argument "clip=TRUE" that can be set to FALSE to avoid clipping the axes to the mapped area #1080 by Márcia Barbosa- better error message when coercing an sf object that is not fully formed #1098 by Brandon McNellis
writeCDF<SpatRaster>
had new argument "split" allowing to treat each layer as a subdataset #1077 by Andrea Manicaglobal
now accepts multiple summarizing functions
- A SpatRaster with RGB layers was forced to INT1U when writing #1051 by Cesar Aybar
- In files with multiple vector layers, the crs of the first layer was always used; ignoring that the crs could be different for other layers #1052 by Andrew Gene Brown
sieve
was not able to write to file #1061 by leorasterize
did not work with sf objects #1054 by Jakub Nowosadquery
did not work for hyphenated layer names #1058 by Robbie Pricefocal3D
na.policy did not work #1057 by Flávio MotalayerCor
withna.rm=TRUE
failed for a SpatRaster with more than 2 layers #1056 by Alex Ilich.- inset with keyword positioning did not work well #1053 by Márcia Barbosa
- yearmonths time stamps were not read from file for years <1970 and >2037 #1062 by Colin Brust
compareGeom
did not work for multiple SpatRasters #1063viewshed
could not handle a filename argument. #1100 by kamistick
Released 2023-03-06
- argument
order=FALSE
tosort<SpatRaster>
sort<SpatVector>
(and<data.frame>
method- argument
by=NULL
torasterize>
#986 by Sam Weber meta<SpatRaster>
method to get metadatacompare<SpatRaster>
andlogic<SpatRaster>
methodsvect<SpatExtent>
methodpanel<SpatRaster>
for "panel" plots (multiple layers, single legend)
- it is now possible to save terra options across sessions #995 by Guillaume Patoine.
- better warnings for
is.lonlat
#1006 by Andrew Gene Brown - argument
na.rm
tomerge<SpatRaster>
- the axes of maps created with
plot
are now snug around the mapped area, instead of at the limits of the graphics figure region. - C++ cleaning to avoid warnings by clang-tidy (e.g. now using
.empty()
instead of.size()==0
). [#1013-1017] by Michael Chirico rasterize
with lines and polygons can now use the "fun" argument (for min, max, mean, and sum) #1041 by Bart Huntley
- the legend created by
plet
was not always correct. #983 by Simon Rolph spatSample<SpatRaster>(regular=TRUE)
failed with providing two numbers (row, col) as sample size. #991 by srfallmerge<SpatRaster>
did not ignore NAs #1002 by jmmonnet.writeCDF
failed when using argument force_v4 #1009 by R. Kyle Bocinskypredict
better handling of rasters with many NAs #988 by Lucas JohnsonlayerCor
did not handle NAs well if they were in different cells across layers [#1034](https://github.com/rspatial/terra/issues/1034} by François Rousseu.
Released 2023-01-24
- argument
w
tozonal<SpatRaster,SpatRaster>
to compute weighted means zonal<SpatRaster,SpatVector>
methodclamp_ts
method
- in the previous version, a bug was introduced such that the order of operation in arithmetic operations with SpatRasters was ignored. #978 by Andrew Marx
- Fixed
split<SpatVector>
. #979 by srfall spatSample
withas.df=FALSE
returned a data.frame instead of a matrix #982 by Alex Ilich
Released 2023-01-17
- arithmetic and logical operations between a SpatRaster and a matrix, to allow for using cell-varying and cell/layer-varying scalars. layer-varying scalars were already supported via vectors.
shade
is now vectorized for argumentsangle
anddirection
to facilitate generating multiple hillshades that can be combined for a better result #948 by Jürgen NiedballasharedPaths
now uses spatial indices #960 by Jeff Hansonpredict
has better support for models such as ranger that do not return anything for missing values #968 by Alex Ilich
writeCDF
now supports writing yearly time steps #926 by Andrea Manicaas.contour
now works for a single level #966 by Johannes Signer- subsetting a SpatRaster with a window returned a SpatRaster with the dimensions of the non-windowed raster, thus changing the resolution. #964 by Derek Friend
- removing a factor variable from a SpatVector crashed R. #969 by Andrew Gene Brown
- median did not always return the correct number for a SpatRaster with 3 or more layers #970 by MatteaE
Released 2022-12-02
roll<SpatRaster>
method for rolling (moving) average and other rolling functionsnoNA<SpatRaster>
method to identify cells that are not NA (across layers)rangeFill<SpatRaster>
method
- argument
exhaustive
tospatSample<SpatRaster>
for large sparse rasters. [#905] by PetiteTong. focalPairs
andfocalReg
can now use the values in custom windows as weights. [#907] by Fabian Fischer.focalReg
now has additional argument "intercept=TRUE". [#916] by Jordan Adamsoncrs(x, warn=TRUE)<-
now emits a warning about the difference between transforming and setting a crs when x already had a crs. [#897] by Márcia Barbosa.- it is now possible to write a scale and offset with
writeRaster
[#900] by Kyle David crosstab
now shows the labels names for a categorical SpatRaster. [895] by Derek Corcoran BarriosmakeTiles
can now take a SpatVector to define the tiles. [920] by Tristan Goodbody
focalPairs
andfocalReg
now work for custom windows [#907] by Fabian Fischer- argument "alpha" in
plot<SpatVector>
was not working properly. [#906] by Márcia Barbosa. time<-
with time-step "years" could not handle negative years. [#911] by Andrea Manicawrap
/unwrap
(and by extensionsaveRDS
/readRDS
) did not handle categorical rasters well [#912] by Christine Anderson.interpIDW
failed with GDAL 3.6 [#910] by Roger BivandspatSample
with strata bug fix "unable to find an inherited method for function 'trim'" [#919] by Alfredo Ascanio- it is possible to slice a SpatRaster with a SpatExtent [#914] by Jakub Nowosad.
merge
/mosaic
did not handle NAs when using two layers [#913] by Joao Carreiras.
- focalCor -> focalPairs to reflect its possible use beyond correlation
Released 2022-11-18
[
and[<-
for SpatRaster now have a third indexk
for subsetting or assigning values by layeranyNA
andallNA
for SpatRasterunwrap
to restore a PackedSpatVector or PackedSpatRasterrasterizeWin
method for rasterization with a moving window (circle, ellipse, rectangle, buffer)interpIDW
method for inverse-distance-weighted interpolation of points with a moving windowinterpNear
method for nearest neighbor interpolation of points with a moving windowviewshed
method for SpatRasterupdate
method for SpatRaster to write new names or a new extent or crs to an existing raster file.sieve
filter for SpatRaster- argument
segments=FALSE
todisagg<SpatRaster>
sprc<character>
method to create a SpatRasterCollection from a file with subdatasetsgraticule
function to create a SpatGraticule and related methodsplot<SpatGraticule>
andcrop<SpatGraticule>
elongate
method for SpatVector lines
- faster
mosaic
andmerge<SpatRaster>
[#577] by Jean-Romain wrap<SpatRaster>
now uses file references if the data is deemed to large to all load into memory. [#801] by Jean-RomainreadRDS
andunserialize
now return a SpatRaster or SpatVector (instead of a PackedSpat*)- better support for a "local" arbitrary Euclidean crs [#797] by Agustin Lobo
clamp
can now take low and high values for each layer- The
pax
argument inplot
now provides more control over what to draw on each axis via parametersside
,tick
andlab
- The
pax
argument inplot
now has argumentretro
to use a sexagesimal notation of degrees extend
has a new argumentfill=NA
- A warning is now given when
c
ombining SpatRasters with different CRSs. [#818] by Andrew Marx plotRGB
now accounts for the value of zlim when stretching; allowing to use the same coloring scheme across SpatRasters [#810] by Agustin Lobo.- the center of rotation for
spin
is now vectorized
- The annoying garbage collection messages
Error in x$.self$finalize() : attempt to apply non-function
is now suppressed in most cases. [#218] by Charlie Joey Hadley. This problem should go away altogether when a new version of "Rcpp" is released (ETA Jan 2023) thanks to a fix by Kevin Ushey [#30] spatSample
withna.rm
and SpatRasters with multiple layers did not work. [#800] by Andrea Manicaadjacent<SpatRaster>
withpairs=TRUE, include=TRUE
ignoredinclude=TRUE
[#808] by Joseph Lewisrasterize
did not accept "NA" as value for updating [#809] by Márcia Barbosaextract
with a perfectly vertical or horizontal line failed in some cases [#823] by Dimitri Falkwrap<SpatVector>
failed if there was a single point geometry [#815] by Patrick Schaeferextract<SpatRaster>
withweights=TRUE
did not return values [#814] by Jean-Luc Dupouey.x[["newname"]] <- r
for SpatRastersx
andr
did not work [#795] by Jim Shady- fixed support for some non-conventional netCDF files [#869] by Mike Sumner, [#864] by eleanorecc, and [#851] by Philippe Massicotte.
costDistance
->costDist
to avoid conflict with {gdistance}gridDistance
->gridDist
for consistency
Released 2022-09-10
droplevels
for SpatRaster. [#757] by Rodolfo Jaffe.normalize.longitude
for SpatVector.scoff
to get andscoff<-
to set the scale (gain) and offset of a SpatRaster.
- new argument
raw=FALSE
toextract<SpatRaster>
[#776] by Thomas Roh. as.data.frame
now takesna.rm=NA
to only remove rows that are NA for all layers. The default value changed fromTRUE
toNA
. [#792] by Ed Carnell- faster plotting of SpatVector data [#774] by Krzysztof Dyba
distance<SpatRaster>
has new arguments "target" and "exclude". [#560] by Bernardo Brandão Niebuhr- new argument
sparse=FALSE
for `relate<SpatVector,SpatVector>. - new argument
usenames=FALSE
forlapp<SpatRasterDataset>
[#793] by Colin Brust. vect<character>
now reports that a file is non-existent [#784] by John Baums- faster
relate
[#716] by Krzysztof Dyba focal3D
now checks if all the window's dimensions are odd [#772] by Neander Marcel Heming
all.equal
bug [#756] fixed by John Baumsextract<"SpatRaster","sf">
ignored the ID argument. [#755] by Dainius Masiliūnas.- There is now (in all cases) a check to avoid overwriting (one of) the input file(s) when writing a raster file [#760] by John Baums
vrt
is no longer constrained by the maximum number of files that can be opened [#780] by 8Ginette8weighted.mean
crashed with numeric weights and na.rm=TRUE [#777] by David Holstiusproject<SpatRaster>
did not consider an extent that was set by the user [#775] by Philippe MassicottefocalCor
failed for large rasters [#607] by John Clarkfocal
withexpand=TRUE
was prone to run out of memory [#610] by Nathan Elliottcrop<SpatVector>
did not work well when the second argument were points or lines [#782] by Márcia Barbosaadjacent
withpairs=TRUE
now respects theinclude=TRUE
argument [808] by Joseph Lewis
Released 2022-08-07
- method
blocks
to guide reading raster data in chunks. [#748] by John Baums
- A warning is given when writing raster values that are outside the limits of the requested datatype [#752] by Jim Shady
- Arguments to
extract
were simplified. [#736] by François Rousseu
- values of
focal
where not correct if the input SpatRaster had multiple layers and a "custom" function. [#727] by Jean-Luc Dupouey. plot<SpatRaster>
did not honor argumentlegend=FALSE
. [#738] by Grzegorz Sapijaszkoexpanse
failed when processing in chunks [#741] by Gareth Daviescrop<SpatRaster,SpatExtent>
with argumentsnap="out"
could lead to a crash if the extent was beyond the SpatRaster. [#740] by Mauricio Zambrano-Bigiarini
Released 2022-07-25
subst
no longer uses values that it changed earlier on. [#639] by Paul Smithas.points<SpatRaster>
could return wrong factor labels. [#640] by Attilio Beninimask<SpatRaster,SpatVector>
crashed when the results were written to disk. [#646] by Monika Anna Tomaszewskaextract<SpatRaster,SpatVector(points)>(xy=TRUE)
returned the locations of the points, not the xy-coordinates of the cells. [#650] by Ward Fonteynwrap<SpatRaster>
did not return the correct labels for some categorical rasters. [#652] by Jakub Nowosad- better support for non-latin characters in the legend [#658] by Krzysztof Dyba
- holes in small lon/lat polygons are now properly buffered [#689] by David Hofmann
subst
can now substitute the values from multiple input layers with a single output value (layer)subset<SpatVector>
now behaves likesubset<data.frame>
[#648] by Andrew Gene Brown- setting category labels with a vector of names is now deprecated. A data.frame with at least two columns should be used. The first column should have the cell values (IDs).
- It is now possible to "drop" a layer from a SpatRaster by setting it to NULL [#664] by Daniel Valentins
freq
now provides the labels of factors, even ifbylayer=FALSE
. It now always returns adata.frame
(it used to return amatrix
in some cases. [#687] by Rodolfo Jaffédisagg
andaggregate
now return a warning instead of an error when using a (dis)aggregation factor of 1.[#684] by Justin Fain.project
crashed when erroneously projecting raster data from one celestial body to another [#688] by Mike Sumner- you can now set a color table with a two column (value, ID) data.frame
- categorical rasters can now be updated more easily [#667] by Alex Ilich
- more control over matching values with colors when using
plot
. [#673] by Jakub Nowosad. - SpatVector attributes can now also be a factor, date, or POSIXct. [#697] by Grant Williamson
- improved handling of missing values in
extract(method="bilinear")
. [#693] by swooping-magpie
- argument
as.raster
tounique<SpatRaster>
to create a categorical raster with the unique combinations in the layers of the input raster. The default for argumentna.rm
was changed toFALSE
sort<SpatRaster>
to sort cell values across layers.has.colors
andhas.RGB
for SpatRastercover
can now combine categorical rastersconcats
to combine the levels of two SpatRaster into new categories [#663] by Alex Ilichzonal<SpatVector,SpatVector>
method to aggregate SpatVector attributes by polygons
Released 2022-06-09
- "flipped" rasters were not always handled well. [#546] by Dan Baston
- better reading of GTiff with subdatsets. [#601] by Kyle Doherty
- better handling of multi-layer categorical rasters and
extract
. [#580] by André M. Bellvé weighted.mean
did not adjust the weights if there wereNA
s in the values. [#574] by Lars Dalby- bug in masking. [#552] reported by Márcia Barbosa and [565] by Jakub Nowosad.
- fixed
stretch
option inplotRGB
[#550] by Agustin Lobo - unwrap of a SpatRaster failed with a crs including a "'". [#602] by Jean Romain.
spatSample
withcells=TRUE
failed for planar data [#544] by Benjamin MisiukcompareGeom(x, y, stopOnError=FALSE)
did not remove the error messages stored inx
leading to unexpected warnings later on. [#568] by David Hofmann.
- Using & or | with SpatRasters now returns a boolean SpatRaster. [#594] by Dan Baston
- SpatVector now supports logical values. [#593] by Derek Friend
- Attempt to create SpatRaster with an invalid number of rows now gives an error. [#544] by Dan Baston
layerCor
does not create temp files anymore. [#551] by Christine Anderson- not using the same iterator symbols in nested loops to avoid warnings on the Intel compiler. [#573] by Gareth Davies.
- new arguments
res
andorigin
toproject<SpatRaster>
method. [#596] by Alex Ilich - new argument
inside=TRUE
tocentroids
to get a centroid-like point that is guaranteed to be on the geometry ("point on surface"). [#588] by Márcia Barbosa - new argument
keepgeom=FALSE
tovect<data.frame>
that allows setting (keeping) the geometry as an attribute. [#586] by Márcia Barbosa saveRDS
andserialize
methods for SpatRaster and SpatVector. [#549] by Andrei MîrțxFromCol
andyFromCol
now have a<SpatRaster,missing>
method. [#583] by Michael Sumner.svc<sf>
method to deal with GeometryCollection types. [#585] by Sarah Endicottas.points<SpatRaster>
andas.polygons<SpatRaster>
have a new argumentna.all=FALSE
that affects the interpretation ofna.rm
. [#548] by Jean-Luc Dupouey.setGDALconfig
andgetGDALconfig
to set GDAL configuration options. [#608] by Erik Bolch.- new argument
circular
torapp
to allow the start to be after the end (for if layers represent days of the year) - new method
costDistance<SpatRaster>
- new methods
where.min
andwhere.max
forSpatRaster
to get the cell numbers for the extreme values in a SpatRaster. - new method
emptyGeoms<SpatVector>
to get the indices of empty (null) geometries - new method
rasterizeGeom
to rasterize the geometry count or the area of (small) polygons or the length of lines. - new method
not.na
forSpatRaster
which is a shortcut for!is.na(x)
. as.list
implemented for<SpatRasterDataset>
.sources
implemented for<SpatRasterDataset>
,<SpatVector>
and<SpatVectorProxy>
[#638] by Andrew Gene Brown
- delauny -> delaunay [#627] by Derek Friend
Released 2022-02-17
writeVector
andvect
now work with GPGK if the path has non-ascii characters [#518]- The results of
predict
withcores > 1
and more than one output variable were garbled zonal
dropped category names when using an external (R) function [#527] by Jakub Nowosad- focal/focalCpp showed strange patterns when the window size was larger than the block size [#519] by Alex Ilich
- using
xy=TRUE
inas.data.frame
normalized the names [#538] by Kodi Arfer - new argument
options
tovrt
[#629] by Monika Tomaszewska.
makeTiles
has new argumentsextend
andna.rm
[#520] by by L. Dalbyproject<SpatRaster>
now uses nearest neighbor as default method for RGB rasters- new argument
na.rm=TRUE
tounique
. [#561] by Matthieu Stigler
Released 2022-01-30
app<SpatRasterDataset>
ignored the filename. [#498] by jszhaovect<data.frame>
failed silently if xy coordinates were integers [#496] by Márcia Barbosa- The output of
aggregate<SpatRaster>
was malformed whennrow(x) %% fact != 0
. [#492] by Jean-François Bourdon - Integer
NA
s in SpatVector attributes where only recognized on Windows [#491] by Márcia Barbosa plot<SpatVector>
failed when using a character variable with many unique values. [#489] by Márcia Barbosarotate
failed on large files. Reported by Ujjawal Singh- writing raster files with a color table could lead to a crash [#501] by Kodi Arfer
crds
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
andpatches
now process all layers of the input SpatRaster. [#503] by Chris Haak- consistent copy-on-modify behavior in
()<-
methods. in-place updating available withset.
methods such asset.names
andset.values
. [#493] by Jean Romain and [#511] by Bryan Fuentes - much faster writing of GPGK vector data by using a single transaction (following sf) [#460] by Krzysztof Dyba
aggregate<SpatRaster>
now accepts functions that return more than one value per aggregated cellwriteVector
has new argumentinsert
to add a layer to an existing file (e.g. GPKG).
- new option
method="weights"
forspatSample<SpatRaster>
- new
mask<SpatVector,SpatVector>
method to select intersecting geometries - new method
is.related
values<SpatRaster>
has new optionna.rm=TRUE
. [#490] by Henk Harmsen- new class
SpatVectorProxy
to provide access to large vector databases that cannot or should not be read into memory in its entirety. - new argument
proxy=FALSE
tovect
to create a SpatVectorProxy object - new method
query<SpatVectorProxy>
to extract parts of a SpatVectorProxy - new method
vector_layers
that returns, and can delete, vector format layers from a database/file such as GPKG
To avoid name clashes with tidyverse
- arrow -> north
- src -> sprc
- simplify -> simplifyGeom
For consistency
- setCats -> set.cats
Released 2022-01-13
setValues
andinit
failed (or even crashed R) when using a single value on a largish raster. [#414]- conversion from
sfc
toSpatVector
lost the crs. [#415] by Jean-Luc Dupouey buffer
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 Lobo- argument
main
was ignored indensity
when using a single layer SpatRaster [#424] by dvictori - Summary type math functions such as
min
andmean
, when used with multiple SpatRasters and numbers, ignored additional SpatRasters [#426] by Zhuonan Wang - names are now conserved when creating a SpatRaster from a RasterStack that points to file(s) [#430] by Dan Baston
classify
withright=FALSE
ignoredinclude.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 Barbosa
values(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 asdata.table::as.data.table
. See [#284] by Patrick Schratzcrs
now shows the correct authority if it is not EPSG. [#419] by Matthew Williamson- It now possible to add a SpatRaster to an empty SpatRaster (with no values), even if it has a different geometry, ignoring the empty SpatRaster [#421] by Alex Ilich.
rast<filename>
has a new argumentlyrs
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 inrast<data.frame>
. [#438] by RS-ecoclassify
has a new argumentbrackets
to show if a side of an interval is open or closed.- further support for categorical data in
freq
andas.data.frame
. [#441] ngould7 - speed up in processing of multi-layer in memory data. [#437] by Krzysztof Dyba
vect<matrix>
andvect<data.frame>
are now much faster. [#413] by BastienFRextract
with points provided as a matrix or cell numbers is not much faster. [#341]focal
has a new argumentna.policy
that can be set to one of "all" (default), "only" or "omit". argumentna.only
has been removed, as you can now usena.policy="only"
inset
argumentborder
changed toperimeter
to allow passingborder
on toplot<Spat*>
. [#456] by Márcia Barbosa- The compile-time and run-time versions of GEOS are now compared and a warning is given if they are not the same. [#459] by Edzer Pebesma
- it is now possible to add sub-datasets to GPKG and GTiff files. [#300] by gtitov
- general option
memfrac
can now be set to zero (in stead of not lower than 0.1). [#476] by Matt Strimas-Mackey - new argument
allowGaps
inpatches
to disallow gaps between patch IDs. See [#478] by Dunbar Carpenter.
- timestamps and units are now saved to an auxiliary file (filename.aux.json) for all raster formats except NetCDF when using writeCDF (because in that case they are stored in the netcdf file)
- new method
mergeTime
to combine multiple rasters, perhaps partly overlapping in time, into a single time series - new method
fillTime
that can add empty layers in between existing layers to assure that the time step between layers is constant - new method
approximate
to fill in missing values by cell across layers - new methods
is.bool
andas.bool
for SpatRaster and explicit recognition of Boolean raster data in various places (e.g., extract, plot) - new methods
is.int
andas.int
for SpatRaster. - when assigning integer values to a SpatRaster, or when reading an integer file, the corresponding layers are now classified as being of integer type [#446] by L. Dalby
- new method
layerCor
(likeraster::layerStats
). [#420] by Alex Ilich - new method
focalCor
(likeraster::corLocal
). [#427] by Zhuonan Wang - new method
all.equal
forSpatRaster
. See [#428] by Dongdong Kong - new method
math
forSpatRaster
that implements the Math-generic methods and accepts a filename - new method
sds<array>
- new method
rasterize<matrix>
, see [#413] by BastienFR - new method
colorize
to transform color representations - new method
arrow
to draw a (North) arrow on a map. [#461] by Márcia Barbosa - new method
densify
to insert nodes between existing nodes of a line or polygon SpatVector - new method
direction
for SpatRaster. [#462] by Márcia Barbosa - new method
focal3D
to compute focal values for a three-dimensional (row, column, layer) window - new function
makeVRT
to create a vrt file for a file that needs a header to be read. - new option
method="stratified"
forspatSample<SpatRaster>
. [#470] by Michael Mahoney - new general option
memmax
to cap the amount of RAM that terra can be used in raster processing [#476] by Matt Strimas-Mackey - new method
gridDistance
to compute distances traversing a raster, perhaps with obstacles. [#477] by Márcia Barbosa
Released 2021-11-24
focal
now has ellipses (...
) to allow for providing additional arguments tofun
. For this reason it does not have ana.rm
argument anymore as that can be supplied via the ellipses. In practice this means that the default will bena.rm=FALSE
for the standard functions such asmean
andsum
.
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
andtapp
now have acores
argument (as doapp
andpredict
). Suggested by Dongdong Kong [#365]focal
now also works with a function that returns multiple values. See [#318] by Alex Ilich.focal
can now process multiple layers in one step.- expanded support for conversion from
stars
objects [#220] by Jakub Nowosad
focalCpp
takes a C++ function that iterates over cells to speed up computation by avoidingapply
(see [#318] by Alex Ilich).focalReg
for focal OLS regression models between layers
Released 2021-11-16
terra
did not install with versions of GDAL below 3 [#402] by Alex Ilich.distance
between two SpatVectors or matrices withpairwise=FALSE
returned a matrix that was filled by column instead of by row [#403] by Paul Smith
Released 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 Schratz- The filename argument in
rasterize
was not ignored, also causing errors when writing to temporary files. [#377] by Robbie Price rast<character>
crashed if the sds was an empty character string. [#381] by Dan Bastonplot<SpatVector>
now responds to therange
argument [#385] by Márcia Barbosazonal
failed for user-defined functions. [#393] by mqueinnec
- new method
selectHighest
to select n cell values with the highest or lowest values. - new method
vect<list>
to append SpatVectors (faster thando.call(rbind, x)
) - new argument
align=FALSE
toproject
to align to the template SpatRaster but ignore the resolution - new method
gdalCache
to set the GDAL cache size, contributed by Dan Baston [#387] - new method
fileBlocksize
- new argument
options
towriteVector
to pass layer creation options to GDAL - new SpatVector topology methods
mergeLines
,snap
,makeNodes
,removeDupNodes
,gaps
,simplify
- new SpatVector characterization methods
width
andclearance
terra
now installs with older versions of GEOS [#363]terra
now installs on CentOS 7 with GDAL 2.1.4 and a C++ compiler that does not support std::regexp. [#384] by Ariel Paulson
Released 2021-10-11
- the definition of
setValues
now has two arguments (x
andvalues
), just likeraster
had; to avoid reverse dependency problems withraster
Released 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
andresample
now choose the resampling method based on the first layer, using "near" for categorical data. Thanks to Matthew Lewis [#355]
hist
failed with small samples. Issue [#356] by Martin Queinnec
Released 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 argumentusenames
. See issue [#309] by Bappa Dasrast<character>
has a new argumentopts
that can be used to pass GDAL open options. See issue [#314]rast<SpatRaster>
now takes argumentsnames
andvals
. See issue [#323] by Dongdong Kongcrs<-
now warns if an unsupported datum is used. See issue [#317]spatSample
now returns factor values if a SpatRaster layer is.factor except when usingas.df=FALSE
- new method
origin<-
to set the origin of a SpatRaster. See issue [#326] by Jakub Nowosad crs
has a new argumentparse
. See [#344]plot<SpatRaster,missing>
has a new argumentreset=FALSE
that allows resetting the par()$mar parameters after plotting. See issue [#340] by Derek Friendcrds
has a new argumentna.rm
. See [#338] by Kodi Arfershow(Spat*)
now prints the name and EPSG code of a crs if available. See [#317] by Jakub Nowosad
plotRGB
failed if there wereNA
s. Issue [#308] by Jakub NowosadwriteVector
crashed R when used with a SpatVector with no geometries. Reported by Timothy White in issue [#319]summary<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 withmask=TRUE
). Issue [#339] by Jean-Luc Dupoueybuffer<SpatVector>
no longer treats lines like polygons [#332] by Márcia Barbosaplot
now passes the layer index tofun
[#310] by Ben Tupper- the
to_id
innearest
was sometimes wrong. See [#328] by Shawn Ligocki - better support for ESRI value attribute tables (VAT). See this SO question
focal
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 [#347]zonal
withas.raster=TRUE
failed for categorical SpatRasters [#348] by Jakub Nowosad
Released 2021-08-20
- if
time(x) <- d
is set with aDate
class object,time(x)
now returns aDate
object instead of aPOSIXct
object. Issue [#256] by Mauricio Zambrano-Bigiarini - The UTF-8 encoding of character attributes of a SpatVector is now declared such that they display correctly in R. See issue [#258] by AGeographer. Also implemented for names in both SpatVector and SpatRaster
rast<data.frame>
method to avoid confusion with thematrix
andlist
methods in response to a SO question by Stackbeans- the extreme values used to represent NA where not as intended (one or two lower) for INT2U and INT4U. Reported by Jean-Luc Dupouey on stackoverflow
writeCDF
now also writes the time dimensions if there is only one time-step. See this SO questionvect<character>
(filename) now has argumentlayer
to select a layer from a multi-layer file / database, and argumentsquery
,extent
andfilter
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 Lobo- Argument
alpha
ofplot<SpatRaster>
can now be aSpatRaster
. See this SO question by James McCarthy
- The
filename
andoverwrite
arguments were ignored inrasterize
- gdal options are now also honored for create-copy drivers [#260]
- buffer for lonlat now works better at the world's "edges" [#261]
- scale/offset were ignored by
project
. Reported by Fabian Fischer rasterize<SpatRaster,SpatVector>
withinverse=TRUE
crashed the R session. Issue [#264] by Jean-Luc Dupouey- The output of
merge
andmosaic
was not correct for large rasters (only the first rows were used). Reported by Zavud Baghirov in [#271] as.points,SpatRaster
did not removeNA
's correctly and shifted values. Issues [#269] and [#273] by Julian Hagenauerrast<matrix>
rotated values when using an equal-sided matrix [#274] by Jakub Nowosad- the number of rows and columns were reversed when using
project
with a crs argument. [#283] by Timothée Giraud - In
classify
, argumentright
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 Dalby- regular sampling of polygons with
spatSample
is now much more regular [#289] by Jakub Nowosad
Released 2021-06-20
na.omit<SpatVector>
to remove empty geometries and/or attribute records that have anNA
- new method
src
to create aSpatRasterCollection
(a loose collection of tiles). merge
andmosaic
now have methods for aSpatRasterCollection
. To avoid the (inefficient) use ofdo.call
. #210 by Matthew Talluto.activeCat
andactiveCat<-
to get or set the "active" category if there are multiple categories (raster attributes)as.numeric
andcatalyze
to transfer categories to numeric cell values- summarize methods such as
range
andmean
for (the attributes of) aSpatVector
- new method
shade
, to compute hill shading
- additional arguments (such as
na.rm
) are now used byrasterize
with point geometries. #209 by Jakub Nowosad - improved handling (and documentation) of
gstat
models byinterpolate
. #208 by Jakub Nowosad - new argument
cpkgs
topredict
to list the packages that need to be exported to the cores if argumentcores
is larger than one.?predict
now shows different approaches to parallelizepredict
(based on examples in issue. #178 by by Matthew Coghill. freq
now returns labels for categorical layersadjacent
now has apairs
argument. #239 by Kenneth Blake Vernonadjacent
now also takes a matrix to specify adjacent cellsmean
and other summarize methods now take afilename
argument and disallow non-recognized named arguments. #238 by Jessica Nephin- The raster attribute table of ESRI-GRID integer data, or from an ESRI
vat.dbf
file is now ignored if it only has the counts of the values. #234 by Jullee - time attributes are no longer lost when doing raster operations. #246 by Mauricio Zambrano-Bigiarini
- resample (and project) no longer ignore
gdal=""
write options and use BIGTIFF if necessary (suggested by Ani Ghosh) - new argument
layer
in theextract-SpatRaster,SpatVector
method to extract values for a single layers specified for each geometry (see this question).
- better handling of paths with non-ASCII characters (e.g., Chinese) for GeoTiff but still fails for NetCDF. [#233] by Dongdong Kong
extract
with points andcells=TRUE
orxy=TRUE
gave garbled outputas.character<SpatRaster>
(called bywrap
) did not capture the layer names. [#213] by Pascal Titlefocal
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. [#229] by Karl Dunkle Wernerapp
withncores > 0
and a function that returns multiple layers now works. [#240] by BastienFR.autocor
(local) can now handleNA
values. [#245] by Jakub Nowosad .mask
with a SpatVector and a large (out of memory) multi-layer SpatRaster only worked for the first layer. Reported by Monika Tomaszewska.
Released 2021-05-13
as.lines
method for SpatRasteras.polygons
method for SpatVector linesautocor<numeric>
has new methodsmean
, to compute the local mean, andlocmor
, 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 SpatRaster
rast<Raster*>
now takes the crs from the Raster object, not from the file it may point to. [#200] by Floris Vanderhaegheconvhull
has a new argumentby=""
to make convex hulls for sub-sets of a SpatVector.- faster processing of large in memory rasters. See issue [#206] by Krzysztof Dyba.
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 withsf
objects. [#201] by Sebastian Brinkmannvect<sf>
now also works for lines, and should be fastervect<character>
crashed R if a file had empty geometries. [#202] by consumereextract(points, bilinear=TRUE, cells=TRUE)
now works. [#203] by fab4appzonal
now works formin
andmax
. [#207] Reported by Jakub Nowosad
To 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 2021-04-30
trim
has a new argumentvalue
that allows trimming rows and columns with other values than the defaultNA
rapp
has a new argumentclamp
that allows clamping start and end values to1:nlyr(x)
, avoiding that all values are consideredNA
spatSample<SpatRaster>
has new argumentsas.points
andvalues
. Getting values, cells and coordinates is no longer mutually exclusive. In response to [#191] by Agustin Loboarea<SpatRaster>
has a new argumentmask=FALSE
classify
can now take a single number to request that many cutsmosaic
andmerge
now warn and resample if rasters are not alignedextract
has a new argumentexact
to get the fraction covered for each cell
flip(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] by Laurence Hawkernearest
now works for angular coordinates- The unit of
slope
interrain
was not correct (the tangent was returned instead of the slope), [#196] by Sven Alder quantile
now works for rasters that have cells that are allNA
. Reported by Jerry Nelson
To avoid name conflicts with tidyverse
with deprecation warning:
- separate -> segregate
- expand -> extend
- near -> nearby
- pack -> wrap
without deprecation warning:
- transpose -> trans
- collapse -> tighten
- fill -> fillHoles
- select -> sel
Released 2021-04-14
c<SpatVector>
now returns a list.rbind
is used to append SpatVector objects- overhaul of handling of factors.
rats
has been removed, andlevels
andcats
have changed
- No news recorded for this and earlier versions