Spectral indices

From AWF-Wiki
(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
 
# Click {{mitem|text=Raster --> Raster calculator}}.
 
# Click {{mitem|text=Raster --> Raster calculator}}.
 
# A powerful normalization is realized by the ''normalized difference vegetation index'' that forms the basis of most vegetation indices $NDVI = (Nir - Red) / (Nir + Red)$. It can be implemented using {{tool|text=Raster Calculator}} as seen in the following screenshot:
 
# A powerful normalization is realized by the ''normalized difference vegetation index'' that forms the basis of most vegetation indices $NDVI = (Nir - Red) / (Nir + Red)$. It can be implemented using {{tool|text=Raster Calculator}} as seen in the following screenshot:
[[File:Qgis_raster_calc_ndvi.png|thumb|left|800px]]
+
[[File:Qgis_raster_calc_ndvi.png|800px]]
 
# Define path and file name of the output layer. {{button|text=OK}}.
 
# Define path and file name of the output layer. {{button|text=OK}}.
 
# Map visualization: Open the raster layer properties by right-clicking the ndvi raster in the [[TOC]] selecting {{button|text=Properties}}, or by simply double clicking.  
 
# Map visualization: Open the raster layer properties by right-clicking the ndvi raster in the [[TOC]] selecting {{button|text=Properties}}, or by simply double clicking.  
Line 13: Line 13:
  
 
== Spectral indices using Processing Toolbox ==
 
== Spectral indices using Processing Toolbox ==
A convenient module for calculating spectral indices can be found in the QGIS processing toolbar. Type {{typed|text=Radiometric}} into the search field and find the {{button|text=Orfeo Toolbox --> Feature Extraction --> Radiometric Indices)}} tool. Open it with a double click.  
+
A convenient module for calculating spectral indices can be found in the QGIS processing toolbar. Type {{typed|text=Radiometric}} into the search field and find the {{button|text=Orfeo Toolbox --> Feature Extraction --> Radiometric Indices)}} tool. Open it with a double click. Assign the spectral ranges to the right order of bands in the multiband file. Choose ndvi from the ''Available Radiometric Indices'' drop-down list. {{button|text=OK}}.  
Assign the spectral ranges to the right order of bands in the multiband file. Choose ndvi from the ''Available Radiometric Indices'' drop-down list. {{button|text=OK}}.  
+
[[File:Qgis_radio_index.png|400px]]
[[File:Qgis_radio_index.png|thumb|left|400px]]
+
  
 
== Spectral indices using OTB graphical user interface ==
 
== Spectral indices using OTB graphical user interface ==
Line 26: Line 25:
 
{| class="wikitable"
 
{| class="wikitable"
 
| style="border: 0pt" | [[file:Qgis_ndvi_pseudo.png|thumb|left|400px|'''Figure A:''' NDVI pseudocolor]]
 
| style="border: 0pt" | [[file:Qgis_ndvi_pseudo.png|thumb|left|400px|'''Figure A:''' NDVI pseudocolor]]
| style="border: 0pt" | [[file:hillshade2.png|thumb|left|400px|'''Figure B:''' Color composite of three spectral indices: SAVI, NDWI and BI2]]
+
| style="border: 0pt" | [[file:Qgis_vi_composite.png|thumb|left|400px|'''Figure B:''' Color composite of three spectral indices: SAVI, NDWI and BI2]]
 
|}
 
|}
 
[[Category:Working with Raster Data]]
 
[[Category:Working with Raster Data]]

Revision as of 12:17, 10 November 2017

Vegetation index using the Raster Calculator

  1. Click the Add raster layer QGIS 2.0 addrast.png and select a multiband Sentinel-2 satellite image
  2. Check the rank and spectral range of bands in the multiband file (e.g. see table Changing Raster Layer Style).
  3. After clicking Open, the raster layer appears in the QGIS canvas.
  4. Click Raster --> Raster calculator.
  5. A powerful normalization is realized by the normalized difference vegetation index that forms the basis of most vegetation indices $NDVI = (Nir - Red) / (Nir + Red)$. It can be implemented using Raster Calculator as seen in the following screenshot:

Qgis raster calc ndvi.png

  1. Define path and file name of the output layer. OK.
  2. Map visualization: Open the raster layer properties by right-clicking the ndvi raster in the TOC selecting Properties, or by simply double clicking.
  3. Select the Style tab. Under Render type select Singleband pseudocolor.
    1. In the Generate new color map section select RdYlGn. In the Mode pulldown menu select Equal interval. Set the number of Classes to 10 and click Classify.
    2. To finish, click Apply (see Figure A).

Spectral indices using Processing Toolbox

A convenient module for calculating spectral indices can be found in the QGIS processing toolbar. Type Radiometric into the search field and find the Orfeo Toolbox --> Feature Extraction --> Radiometric Indices) tool. Open it with a double click. Assign the spectral ranges to the right order of bands in the multiband file. Choose ndvi from the Available Radiometric Indices drop-down list. OK. Qgis radio index.png

Spectral indices using OTB graphical user interface

If you want to calculate several spectral indices and stack the resulting layers into a new multiband file use an OTB Graphical user interface.

  • In the Search box on the Windows Start menu type OSGeo4W Shell. You should be able to open the shell by clicking on it.
  • Type into the shell: otbgui_RadiometricIndices. Select a multiband input file and assign the spectral ranges to the bands as seen in the screenshot.

Qgis otbgui radio.png

  • In the Documentation tab you'll find an overview on available spectral indices in three categories (vegetation, water, soil) and relevant channels of the input image. Several Indices can be selected in the drop-downlist. Note, the rank of marking defines the order of bands in the resulting multiband file. Mark SAVI, NDWI and BI2 in the list.
  • Display the output multiband spectral indices image as a color composite in the canvas (Figure B).
Figure A: NDVI pseudocolor
Figure B: Color composite of three spectral indices: SAVI, NDWI and BI2
Personal tools
Namespaces

Variants
Actions
Navigation
Development
Toolbox
Print/export