I'm working on an orthomosaic and there is a particular weed species that is flowering at the moment and I need to isolate it and map it out. It's a yellowish green and is obvious in the ortho. I know there must be a way to isolate it so I can map it better.

I've tried the raster calculator with the following expression:

Narlu Orthomosaic 26-06-21@1"=190-210 AND "Narlu Orthomosaic 26-06-21@2"=210-225 AND "Narlu Orthomosaic 26-06-21@3"=78-86

I've made this a range of colors to try and best capture the range that this flower reflects.

The information shown when I use the "information" pointer is the following:

  • Band 1 = 210
  • Band 2 = 218
  • Band 3 = 83

What am I doing wrong as the other answers on this site don't seem to cover this type of question well.

I'll eventually make a vector shapefile layer out of it.

Any help would be great!

2 Answers 2


your syntax is wrong, use something like:

(("Narlu Orthomosaic 26-06-21@1">=190) AND ("Narlu Orthomosaic 26-06-21@1"<=210)) 
AND (("Narlu Orthomosaic 26-06-21@2">=210) AND ("Narlu Orthomosaic 26-06-21@2"<=225)) 
AND (("Narlu Orthomosaic 26-06-21@3">=78) AND ("Narlu Orthomosaic 26-06-21@3"<=86)) 
  • Thanks for looking into it, I ran your expression and it didn't seem to work. I had a black and white output of "0" each, not sure why as this weed grows prevalent. Is there a filter to apply after this to view it? Thanks Jun 30, 2021 at 6:21
  • 2
    the output is true (1) or false (0).
    – eurojam
    Jun 30, 2021 at 6:50
  • @Nathan_Litjens : You can multiply the black/white (0/1) raster with your original raster (or the three bands of your raster) to get a new raster with only those pixsels you selected. If you do it sperately for each band, you can than merge the three outputs together to get a color-raster with only the pixels in the value-range defined.
    – Babel
    Jun 30, 2021 at 9:00
  • My issue is that I got all 1 or all 0. I'll try the suggestions below and get back to you. Thanks Jul 2, 2021 at 6:27

Create a new raster in Raster Calculator - call it MASK

("Narlu Orthomosaic 26-06-21@1">=190) *("Narlu Orthomosaic 26-06-21@1"<=210) * ("Narlu Orthomosaic 26-06-21@2">=210) *("Narlu Orthomosaic 26-06-21@2"<=225) * ("Narlu Orthomosaic 26-06-21@3">=78) * ("Narlu Orthomosaic 26-06-21@3"<=86) 

This will give you a single band raster as a mask - it will be 1 when you have the right colour, and 0 otherwise. You can convert that to vector.

You can also apply it as a mask to the original data to make 3 bands, band by band, again in the Raster Calculator:

"Narlu Orthomosaic 26-06-21@1" * Mask@1
"Narlu Orthomosaic 26-06-21@2" * Mask@1
"Narlu Orthomosaic 26-06-21@3" * Mask@1

This creates three more rasters. Combine these to a new raster file with Raster-Miscellaneous-Merge, placing each file into a separate band.

Set the transparency of the new raster file to 100% for pixels with value 0. You should then see only your weed plantation. This can be done interactively in the Layer Styling Panel.

There are probably more elegant ways of doing this. There may be plugins that do it all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.