This lesson builds on the content and setup done in Multispectral Data Visualization.
Learning Objectives
- Create a shapefile layer manually
- Edit the features and data of a shapefile layer
- Use a shapefile layer to extract data from a raster image
A shapefile layer (in this case) will be a set of polygons that define the area of interest.
Layer » Create Layer » New Shapefile Layer...Polygon for the geometry typeOK to save the blank shapefile

Check-in
The coordinate reference system (CRS) of the image and the shapefile must match not only for accuracy but also to be able to perform functions such as extracting data. To check the CRS of the raster layer right click on the raster layer Solano_2l20l20_index_ndre and navigate to
Properties.... In theImage Propertieswindow under theInformationtab look for CRS (it should be 3rd from the top). The EPSG number displayed is a unique number for each CRS. in the case of the Solano_2l20l20_index_ndre layer the CRS is EPSG:32610 - WGS 84 / UTM zone 10N - Projected. A UTM projection has a unit of meters. This is also shown in the layer information.
Check-in
If the
Digitizing Toolbarand/orAdvanced Digitizing Toolbaris not visible turn it on by navigating toView»Toolbars»Digitizing Toolbarand/orView»Toolbars»Advanced Digitizing Toolbar

Add Polygon Feature in the Digitizing Toolbar (Ctrl + .)

Toggle editing button (yellow pencil)Another way to create features
Rectangular features can also be created using the
Shape Digitizing Toolbar. If theShape Digitizing Toolbaris not visible turn it on by navigating toView»Toolbars»Shape Digitizing Toolbar. Use theAdd rectangle from 3 pointstool, choosingAdd Rectangle from 3 Points (Distance from 2nd and 3rd point).
Check-in
The areas of interest in this example are the areas of the field where a higher amount of N fertilizer were added in order to determine if the field would response to an in-season fertilization (see image below).
If a shapefile needs to be copied, moved, or resized it can be done!
Toggle Editing on, highlight the shapefile in the Layers panel.Attributes Toolbar click Select Features by area or single click.Digitizing Toolbar,
Vertex Tool allows the user to move the vertices’s of a featureCopy Feature (Ctrl + C) button copies the selected feature(s)Paste Feature (Ctrl + V) button pastes the selected features(s) over the current featuresDelete Selected button, does exactly what is impliesAdvanced Digitizing Toolbar,
Move Feature(s) the click and drag the feature(s) to their new locationAs long as the edits are not saved, Edit » Undo (Ctrl + Z) works.
Attribute Table by right clicking the shapefile layer and choosing Open Attribute Table

New Field button to create a new field. (Ctrl + W)

Type and Length fields as they determine what kind of variable will be in that column and the length limits for that variable.


Check-in
If the
Processing Toolboxis not visible turn it on by navigating toView»Panels»Processing Toolbox
Zonal statics is like using the shapefile just created as a cookie cutter for the image. It ‘cuts’ the area below the shapefile and then summarizes it with different functions (mean, median, max, etc).
Zonal Statistics tool under Raster Analysis in the Processing ToolboxZonal Statistics to open the Zonal Statistics tool.Vector layer containing zonesOutput column prefix (in this case ndre_)... and check whichever boxes of statistics you want to calculate.Run to run the algorithm. This will create a new layer with the selected statistics fields.

Zonal Statistics tool.Open Attribute Table

Zonal Statistics tool.Export » Save Feature As…

Comma Separate Value [CSV]OK when everything is set to output and save the CSV

Now the drone data can be analyze in programs such as Excel or R. Models can be made. ANOVAs can be run. There are many more things that can be done with both the data values as well as the images.
Now you are ready to move on to Multispectral Data Extraction (High throughput)!