Using Raster Calculator to Convert 0 values to NoData in a raster?

1537
1
06-08-2012 01:57 PM
Highlighted
New Contributor
I am using Arc 10.0........

I have 2 files... a raster made from a Polyline shapefile and a masked area from a polygon...

[ATTACH=CONFIG]15077[/ATTACH]

I am trying to use Raster Calculator Map Algebra to convert the values of 0 from blue area to NoData in the overlapping area behind there...

This expression below converts those pixels to 0..

Con("polrecl", 0, "maskdpoly")

I want to convert to "NoData" instead because I want to do statistics on the area inside the boundary only.

I tried Con("polrecl", NoData, "maskdpoly") but this doesn't work...

I am new to this stuff, can anyone assist?
Reply
0 Kudos
1 Reply
Highlighted
MVP Esteemed Contributor
I am trying to use Raster Calculator Map Algebra to convert the values of 0 from blue area to NoData in the overlapping area behind there...

This expression below converts those pixels to 0..

Con("polrecl", 0, "maskdpoly")


I think what you're missing are the IsNull and SetNull tools, which are very useful for this kind of thing.

These two (equivalent) Raster Calculator expressions should do what you want, if I'm understanding you correctly:


SetNull(not IsNull("polrecl"),"maskdpoly")
Con(IsNull("polrecl"),"maskdpoly")


The Extract By Mask tool may do what you want without any map algebra, or you could even just set the geoprocessing environment mask to control which cells are used by the Zonal Statistics As Table tool.

There are a zillion ways to do things in Spatial Analyst, as you can see!
Reply
0 Kudos