Select to view content in your preferred language

Set NoData to Null

2739
8
Jump to solution
01-29-2022 06:27 AM
CandiSmith23
Emerging Contributor

Hi

Hoping someone can help me. I have 100s of geotiffs with NoData set to -99999 and I need to set NoData to null. I can’t seem to get batch SetNull to work. The images are 32 bit float.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

good luck... never seen a raster with blank holes...

"'see" means when they symbolize... you can "hide" no data values on screen but not in the raster itself.  If you don't believe me, then maybe you should file an issue with Tech Support

If they want to print the raster so that nodata is empty, then that is a text processing issue, which can be accomplished by reading each row of the file and applying a python replace function to the row

eg   ....replace("-9999", "     ")

now technically that looks empty, but there are 5 spaces there 😉


... sort of retired...

View solution in original post

8 Replies
DanPatterson
MVP Esteemed Contributor

Set Null (Spatial Analyst)—ArcGIS Pro | Documentation

what isn't it doing? Is it because it won't let you select multiple input rasters. 

 


... sort of retired...
0 Kudos
CandiSmith23
Emerging Contributor

I can put the multiple geotiffs I want to modify in for the input raster  but I don’t know what to input for The false raster or constant value. Also don’t know what expression to use. I have never used this tool and I guess I’m just not doing something right.

0 Kudos
DanPatterson
MVP Esteemed Contributor

outSetNull = SetNull("elevation", "elevation", "VALUE < 0")

from the code example would suggest that you would use the same raster as input and false raster but provide and "expression" of "VALUE == -9999"  not sure whether you need single or double = signs


... sort of retired...
0 Kudos
CandiSmith23
Emerging Contributor

When I run that my NoData Value becomes -3.4028235e+38 😞

0 Kudos
DanPatterson
MVP Esteemed Contributor

And when you symbolize it you can choose to hide the nodata values.... nodata has to be something in rasters, there is no such thing as an empty raster cell.  

The important thing is to check to make sure your nodata values don't get used in calculations, so try taking a "min"  or your raster and see what it returns (hopefully not -3.4028235e+38 ) 😉

PS  recalculate raster statistics as well


... sort of retired...
CandiSmith23
Emerging Contributor

Unfortunately the client specified they did not want to see any values for NoData they wanted it set to ‘Null’. I did mange to get it set ‘-int’ not sure what that is, it’s not a value but I guess it not Null either.

0 Kudos
DanPatterson
MVP Esteemed Contributor

good luck... never seen a raster with blank holes...

"'see" means when they symbolize... you can "hide" no data values on screen but not in the raster itself.  If you don't believe me, then maybe you should file an issue with Tech Support

If they want to print the raster so that nodata is empty, then that is a text processing issue, which can be accomplished by reading each row of the file and applying a python replace function to the row

eg   ....replace("-9999", "     ")

now technically that looks empty, but there are 5 spaces there 😉


... sort of retired...
CandiSmith23
Emerging Contributor

I never seen it either!  I think I’m trying to do something that’s  not possible.   Thank you so much for your help!

0 Kudos