I have a raster file with two categories: category 12 (total count=350) and category 14 (total county = 500). The attribute table looks like this:
rowid Value Count 0 12 350 1 14 500
Is there any way I can give all pixel a value of 1?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
You can use a conditional statement in the raster calculator as follows:
Con("your_raster.tif" >= 12, 1, "your_raster.tif")
This command assigns any value greater than or equal to 12 a value of 1.
Have a look at the Reclassify tool (Spatial Analyst).
Rather than playing with conditional statements (which are fine, but not necessary here), I would just do the following in raster calculator:
("raster.tif" * 0) + 1
Simple and effective.