Changing NoData values to zeros (map algebra exoression error) !!

535
5
05-07-2012 12:49 PM
ZarehDemirdjian
New Contributor III
Hello,

I am trying to change the NoData to 0 for my raster dataset, but everytime i am typing this expression its giving me an error:
con(myraster==NoData,0,myraster) !!! is this expression incorrect??

Thanks in advance
0 Kudos
5 Replies
DarrenWiens2
MVP Honored Contributor
Try this:
Con(IsNull("myraster"),0,"myraster")

This works in the Raster Calculator, for v10, with ESRI GRIDs. Not sure if it's the same for v9.3, or for other formats.
0 Kudos
TarunJaiswal
Esri Contributor
Greetings!

Also for future reference, here is a link of a Knowledge Base - Technical Article on

HowTo:  Convert NoData values to other values for raster data

Thank you.
0 Kudos
ZarehDemirdjian
New Contributor III
Try this:
Con(IsNull("myraster"),0,"myraster")

This works in the Raster Calculator, for v10, with ESRI GRIDs. Not sure if it's the same for v9.3, or for other formats.


Thanks i am using ver 10 as well, i used this it worked without the " ", i just wrote con(isnull(myraster.tif),0,myraster.tif) and it worked one time and that was it, it stoped again, is there any syntax error in my used format?
0 Kudos
DarrenWiens2
MVP Honored Contributor
Did it say something like "myraster.tif does not exist or cannot be found"? I'm not sure why but after one or two times, I have to restart Arc to get it to do more.
0 Kudos
curtvprice
MVP Esteemed Contributor
Thanks i am using ver 10 as well, i used this it worked without the " ", i just wrote con(isnull(myraster.tif),0,myraster.tif) and it worked one time and that was it, it stoped again, is there any syntax error in my used format?


The quotes are required if you are using the Raster Calculator tool. The text inside the quotes must either be the path to a raster (or simply its name if the raster is in the current workspace) or the name of a raster layer in ArcMap.
0 Kudos