I have 8 rasters (GeoTIFF; LANDFIRE layers) that I need to stack into a multiband raster for use with downstream analyses (i.e., within FlamMap). I have a workflow using Python and ArcPy and would like to continue to do so for this task. I need to repeat that task for many locations, hence the desire to find a more automated solution.
All of the TIFFs have the 'correct' values before I stack them with arcpy.CompositeBands_management
, but after compositing some of the nodata
values change for the bands. But this only matters for one of the bands. This band is the only one that has categorical data, which it reports as text and a numerical code. This band reports nodata
as 255
, but in order for the downstream analyses to work this needs to be remain nodata
or be reported as 99
.
When I use the stack
function from the raster
package, the resultant stacked raster works and nodata
remains nodata
.
I'd prefer to keep everything within Python and ArcPy if possible. I've tried removing the other attribute information from this categorical TIFF, leaving just count
and value
. This did not work. Any ideas on why compositing changes nodata
values or how to fix it?