Get nodata value from raster using arcpy

726
3
Jump to solution
07-11-2022 05:48 AM
WadeWall
Occasional Contributor

Hi all,

I am using ArcGIS Pro 2.9. I want to use arcpy to obtain the nodata value for a raster, but can't figure out how to do that. It is not listed in getRasterProperties(). Any help would be appreciated.

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

Raster Band properties—ArcGIS Pro | Documentation

even for single band rasters... aka rasters

noDataValue
(Read Only)
The NoData value of the raster band.


... sort of retired...

View solution in original post

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

Raster Band properties—ArcGIS Pro | Documentation

even for single band rasters... aka rasters

noDataValue
(Read Only)
The NoData value of the raster band.


... sort of retired...
0 Kudos
WadeWall
Occasional Contributor

I am not sure how I missed that in the documentation. I appreciate your assistance and not sure I want my question preserved for all eternity, but maybe someone else will ask the same question. Thanks again

Luke_Pinner
MVP Regular Contributor

To add to Dan's answer

arcpy.da.Describe(your_raster)["noDataValue"]
# or
arcpy.Raster(your_raster).noDataValue

 

https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/raster-object.htm#P_GUID-E0D56F9F-CABB-4BB7-B...