I am working with several raster layers for which I need to do a post-processing analysis to compare land use over several years. However the raster I am using have over 40 different land use classifications while I am only focussing on one or two. Is there any way to remove these classifications from the bands? I have tried the tool "rearrange bands". It didn't give me an option to remove anything, but perhaps I am doing something wrong. I am using QGIS 3.22 białowieża.
- 1If you have done a classification then there should only be one band that contains a range of values from 1-40. You can use the raster calculator to create a new raster layer that "filters" out the desired values.Binx– Binx2023-05-30 14:54:21 +00:00Commented May 30, 2023 at 14:54
Add a comment |
1 Answer
Here is an example:
- Use raster calculator to "filter" out the classification values you want to use.
IF(("classification@1" = 1 OR "classification@1" = 2), "classification@1", -999999) a. "classification" = the layer b. @1 = band 1 c. If raster equal 1 or 2, then set value to it's self, otherwise set to some other value. - You can redefine your NaN values if you don't want them. You can use GRASS r.null tool
FIANL OUTPUT
- 1Hi Binx, thanks a lot! I got exactly what I wanted, now onto my land use and land cover analysisHartje– Hartje2023-05-31 08:42:45 +00:00Commented May 31, 2023 at 8:42


