At the time of writing this, FarmLens currently offers only rDVI or NDVI (depending on your camera) as a downloadable product that we refer to as the Field Health Map. However, we allow you to download the raw stitched image so that you can create your own indices until we have the ability to do so. In this article I describe how you can download the "Stitched Image" and use QGIS (a free GIS software) to calculate the NDRE vegetation index (but this can be applied to any index as I'll note later in the article).
To start, be sure you download the "TIF" from the "Stitched Image" section under the "Basic Service Results":
Now the index calculation:
- Open QGIS Desktop
- Click the "Add Raster Layer" button from the left hand side:
Browse to the geotiff you downloaded and it should render on the map.
- From the menu at the top, select "Raster" -> "Raster Calculator", you should see something like the following:
The "Raster bands" on the left hand side will be what you want to calculate your index. In my case, I have a 5-Band geotiff (It's from a Sequoia camera), but depending on your camera, you may have 2, 4, 6+ bands. In general, the last band is always the alpha channel (an invisible band to add transparency).
- Using the information I've collected from FarmLens, I know the band order is according to this image:
In my case, band 1 is the "GRE" (green) band identified as the "SequoiaTest_StitchedNIR@1" item in the raster bands, band 2 is the "NIR" band, band 3 is the "RED" band and band 4 is the "REG" (red edge) band. If your camera produces only a 4 band geotiff (or specifically an RGB image with an alpha channel) then you will either need to contact firstname.lastname@example.org or your camera manufacturer to find out which band is which.
- From the "Raster bands" I can double click them to add them to the "Raster calculator expression" which is pretty much just a calculator. You'll also want to select an "Output Layer" which can be found at the top of the Raster Calculator bye clicking on the "..." button. In the following image I use the fact that NDR is (NIR-REG)/(NIR+REG) to write the following expression (it's important to keep your parentheses correct):Note: You can use the table at the bottom of this article to identify other indices and use them here.
- Click "OK"
- You'll then be taken back to QGIS with a grayscale image. This might or might not be useful in it's current form, however you'll notice that on the left hand side it provides you the scale for what black represents and what white represents (-0.09 for black and 0.21 for white in my case):
- If you want to have it colorized (the Red -> Yellow -> Green scale is very helpful in re-interpreting), you can right click on the layer that was added and is currently highlighted ("NDRE" in my case). Click "Properties", then "Style" from the left hand side in the new window.
- At the top, under the section "Band rendering", change the "Render Type" from "Singleband gray" to "Singleband psuedocolor".
- You can mess around with the various options in this window, but we suggest changing the "Interpolation" to "Linear" and the "Color" to "RdYlGn", like the following:
Click "Classify" to get the values populated in that table. Then finally click "Apply" and "OK"
- You should now see the colorized image in QGIS on the map.
Finally, you'll probably want to save this image, to do so:
- Right click on the layer (in my case "NDRE") and click "Save As..."
- At the top, click the radio button that says "Rendered image", then click browse at the right to select where to save this colorized image. Probably something like "INDEXColorized.tif" and hit "OK".
Other Indices and their Equations
Note: Red Edge is often abbreviated as "REG" or "RE". I'll use "REG" in the following table
|Vegetation Index (VI)||Equation|
|SAVI (learn more here) L=0.5 in most situations||(1+L) * ( (NIR-Red)/(NIR+Red+L) )|