Update layer's raster

373
1
12-16-2019 09:01 AM
MaxMax2
Occasional Contributor II

I have raster layer added to map. I need to change its raster on current extent change. So I take Raster, set its RasterProps (width, height, extent) and write PixelBlock. And after that I expect raster layer updated showing new raster.

But instead exception thrown on RasterEdit.Write. How can I update raster of raster layer to completely replace old raster data including numbers of columns and rows?

0 Kudos
1 Reply
GKmieliauskas
Esri Regular Contributor

Hi,

You can't update raster layer because it is locked. You need to remove layer from TOC, make SaveAs call and add raster back to TOC.

0 Kudos