1

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.

1
  • 1
    If 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. Commented May 30, 2023 at 14:54

1 Answer 1

2

Here is an example:

  1. 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. 

enter image description here

  1. You can redefine your NaN values if you don't want them. You can use GRASS r.null tool

enter image description here

FIANL OUTPUT

enter image description here

1
  • 1
    Hi Binx, thanks a lot! I got exactly what I wanted, now onto my land use and land cover analysis Commented May 31, 2023 at 8:42

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.