Quantcast
Channel: Active questions tagged raster-calculator - Geographic Information Systems Stack Exchange
Viewing all articles
Browse latest Browse all 222

Setting specific pixel value to null in categorical raster

$
0
0

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 all articles
Browse latest Browse all 222

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>