Search code examples
roverwriteraster

R Raster writeRaster doesn't overwrite


Identifying a potential bug here. When calling writeRaster overwrite=TRUE, the new raster values remain unchanged. I originally wrote the wrong raster object, then corrected the code, and wrote a new raster to the same file name. The values in the attribute table of the written file are the same as the original, even though the raster object I am writing has the correct attributes when viewed in R.

Workaround was to give the new raster a different name (or manually delete the old).

R 3.0.0, Windows 7 64-b


Solution

  • Apologies to Brian, with whom I share our modeling workstation. This was my post.

    Josh O'Brien- Looks like you were right, there was something locking the write-protection. I think ArcCatalog was locking it up.

    This tool has performed as expected many times since this incident.