 Welcome back to my YouTube channel. Recently, I got a few questions about how to handle no data with discrete rusters in QGIS. In this video, I'm going to show you first how to hide a certain value from the visualization in the map canvas. Then I'll show you how to indicate or to assign a no data value, which is a value in your dataset that you want to treat as no data. Then I'll also show you how to calculate the amount of cells that are no data and how to replace no data values with values from another ruster layer. Here we have a ruster with zeros and ones. It's a catchment ruster where one is the catchment and zero is outside of the catchment. Let's style this ruster. It's a discrete ruster. We use palleted unique values and that will classify each unique value found in the ruster. Blue for zero and one is then red. With the minus button, we can remove the zeros so they are transparent. This is just a visual trick. The zeros are still in the data. Just to make it clear, I've now put OpenStreetMap in the background. You can see that the zeros are transparent and the ones are visible in red. There's another way of dealing with this. Let me just classify it again to have the zeros back. You can also go to the transparency tab and add a value that you want as no data. Here if I type zero, the zeros become transparent. Let's remove it. This only visually, the next step is to show you how to really indicate that the zeros are no data in this data set. In the ruster menu, go to extraction and clip ruster by extent. There you choose the layer for which you want to indicate the no data value. You choose the same layer here for the extent. Then you can assign here a no data value. If I type here zero, all the zeros will be indicated, assigned really in the data as no data. I call it catch no data. It uses g.translate in the background and there we have our result. Now the zeros are not anymore present as data but as no data in the ruster. Now I'm going to show you a few other tools with no data. I will use some tools from the PC ruster tools plugin. In another video I explained how to install it. We convert here catch no data to a nominal PC ruster map. Let's call it catchment no data. It's exactly the same as the TIFF file but now in the PC ruster format so I just copy the style. The zeros are no data. I can now use a tool from the map operations, map area. If I change the unit to cells it will give me the count of the non no data cells. So the number of data cells. If you choose here unit area you will get it in square meters. And with the identify button I can get the value. So these map operations assign the output value to all the pixels of the ruster. So all pixels here have a value which represents the number of data values in this ruster. If you have a ruster with more classes in this case we only have one class of one. Then you can use the area area tool. This will calculate the area in number of cells or in the map units for each class. Each data cell that is in the map that belongs to a class. There are a few other tools that I want to demonstrate. With the defined tool you can assign boolean true for each data cell. And with the cover tool you can take the no data cells from a layer and replace it with a value from one or more other layers. So here we use the original catchment which has the zeros. So what we started with. And I'm going to save this to a name called merged. And here I've added all the zeros back again to the no data cells. So we have the zeros and the ones again. I can copy the style and paste it. So now we see that we have replaced the no data values of the catchment with zeros. That's what you can do with cover. So in this video you've learned how to deal with no data values in discrete rusters using QGIS and tools from the PC Ruster Tools plugin. With continuous rusters you can also interpolate the no data values using tools from the processing toolbox. There are other videos on my YouTube channel explaining that. Please subscribe to the channel if you want to receive updates and you like these videos. Looking forward to see you again next time.