You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The update() method of spatraster is supposed to be used to write new names or a new extent or crs to an existing raster file. However, this functionality is not working as intended. When running the provided example code, the names are not updated.
Example code (Pulled from the documentation):
s <- rast(system.file("ex/logo.tif", package="terra"))
fname <- paste0(tempfile(), ".tif")
x <- writeRaster(s, fname)
names(x) # Original names are red, green, blue
names(x) <- c("A", "B", "C") # names are changed to A, B, C
ext(x) <- ext(x) + 1
crs(x) <- "+proj=utm +zone=1
update(x, names=TRUE, crs=TRUE, extent=TRUE) # update method is called
rast(fname) # Should now be "A,B,C", but is instead still "red, green, blue"
The update() method of spatraster is supposed to be used to write new names or a new extent or crs to an existing raster file. However, this functionality is not working as intended. When running the provided example code, the names are not updated.
Example code (Pulled from the documentation):
Raster summary before the operation:
raster summary after the operation:
The CRS is updated, but the layer names remain unchanged.
The text was updated successfully, but these errors were encountered: