I am using SetRaster properties
with arcpy
to quickly set the no data value of a raster.
import arcpy
import os
arcpy.SetRasterProperties_management("InputRaster", nodata = "1 0")
I also want to assign value 15
to nodata in my example, so that both values 0
and 15
are assigned no data. In the ArcGIS help for the tool (http://desktop.arcgis.com/en/arcmap/10.4/tools/data-management-toolbox/set-raster-properties.htm) I found the following
If you want to define multiple NoData values for each band selection, use a space delimiter between each NoData value within the bands_for_nodata_value parameter.
I haven't found nodata = [[1, 0], [1, 15]] to be working. The reason why I would like to use SetRasterProperties
is because it is way faster than for example SetNull
. I am using ArcGIS 10.4.1.