Hi GIS users,
I have two different rasters as below
First raster shows all green pixels, and second raster shows other color pixels.
I would like to delete pixels if the pixels are located out of green pixels.
I tried to use clip and mask tools, but I could not delete those pixels.
What tool should I used to solve this problem?
Please help me!
Solved! Go to Solution.
What happens if you write the following expression in Raster Calculator?
Con(("RASTER1" > 0), "RASTER2", 0)
where RASTER1 = Green Raster
Raster2 = Multicolour Raster
If required, you can set the NoData Value as 0 in tool Environment setting.
The con tool Con—Help | ArcGIS for Desktop
and read the notations
Thank you so much your response.
I tried used code that Con(("Raster_A" == 1) & ("Raster_B" == 1), 1, 0), and it works OK.
In Raster_A, I have 3 different objectives as shown in attached picture (pixels with Orange, Brown, and Purple colors).
I would like to keep 3 different objectives in Raster_A and just delete pixels if pixels are not located within Raster_B.
I tried to use Con(("Raster_A" == 1) & ("Raster_A" == 2) & ("Raster_A" == 3) & ("Raster_B" == 1), 2, 1, 0), but it gives me an error message. Do you have any ideas to deal with this problem?
Thanks again.
Con(("Raster_A" == 1) & ("Raster_A" == 2) & ("Raster_A" == 3) & ("Raster_B" == 1), 2, 1, 0)
why not if raster_A is <= 3. Also a cell cannot be class 1, 2, 3 all at once which you mean when using & you want 'or' specifically boolean or, not bitwise or
|—Spatial Analyst module | ArcGIS for Desktop that is what | is... it isn't a big i
What happens if you write the following expression in Raster Calculator?
Con(("RASTER1" > 0), "RASTER2", 0)
where RASTER1 = Green Raster
Raster2 = Multicolour Raster
If required, you can set the NoData Value as 0 in tool Environment setting.
It works perfectly.
Thank you so much.
Glad it worked!!!