Quantcast
Viewing latest article 6
Browse Latest Browse All 190

Setting specific pixel value to null in categorical raster

I have a raster where each pixel value indicates a crop type. For example, 10 is corn, 14 is barley, and 20 is blueberries, 26 is cranberry, and so on.

I'm trying to convert this into a binary raster of two groups of classes. One being 0, and the other 1. Some classes I want to remove entirely, for example, pixels with value 34. I have the below, which works in part, but I don't know how to set pixels of value 34 to null, essentially clipping them from the resulting binary image.

formula = (((A==10)|(A==14))*0) + (((A==20)|(A==26))*1) + ((A==34)??)

Alternatively is there a better way of removing the classes that I don't even want to consider? Perhaps even before the rastercalculator step?


Viewing latest article 6
Browse Latest Browse All 190

Trending Articles