NOTE: This article assumes you've downloaded QGIS, downloaded a "Raw Calculated Index" file from FarmLens and loaded a shapefile that you want to load the average the DVI values into
With your shapefile and raster (image) now loaded into QGIS you should see something like the following:
The "Raw Calculated Index" isn't a normal image. It has one band (most images have three bands, a Red, Green, Blue channel) that has values ranging from -1 to 1. QGIS just automatically places the image on a grayscale for easy viewing, otherwise you'd just see a blank image since it wouldn't know how you'd want to interpret it.
Validate that you have the "Zonal statistics plugin" installed:
- From the menu, select "Plugins" -> "Manage and Install Plugins"
- Type "zonal" into the search box: Verify that you don't need to "Install Plugin" (do if you need to)
Now to get the average DVI value into each of my polygons from above:
- From the menu select "Raster" -> "Zonal statistics" -> "Zonal statistics"
- A menu should appear with your (1) "Raster Layer" and (2) "Polygon layer containing the zones" automatically populated with your two loaded layers, if not, just select them. Then be sure to (3) at least check "Mean" from "Statistics to calculate". QGIS will be using the underlying image to compute these statistics: Don't worry about the "Output column prefix" as it has a tendency to break things. Now click "OK"
- It'll seem like nothing happened, but let's make sure something did. Right click on your shapefile, "Grid" in my case, and click "Open Attribute Table" and you should now see a bunch of columns added with your needed stats:
- You'll probably want to exit out of the attribute table then right click on your shapefile and click "Save as" or "Save" depending on the state of your shapefile.