Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Spectral-Value-Extractor-QGIS-Tooolbox

A QGIS Processing tool that extracts raster pixel values (satellite imagery bands, vegetation indices such as NDVI, NDWI, MNDWI, SAVI, etc.) at field sample point locations automatically

Repositori di GitHub

Author: Defani Arman Alfitriansyah
Date: June 09, 2026
Version: 1.0.0
GitHub: https://github.com/Defani/Spectral-Value-Extractor-QGIS-Tooolbox


Overview

A QGIS Processing tool that extracts raster pixel values (satellite imagery bands, vegetation indices such as NDVI, NDWI, MNDWI, SAVI, etc.) at field sample point locations automatically.

Key advantage over the built-in QGIS Sample Raster Values tool:


Installation & Step-by-Step Usage

Step 1 — Add Script to Processing Toolbox

Open Processing → Toolbox, then click the Python icon (⚙️) at the top of the Toolbox panel and select Add Script to Toolbox...

Screenshot 2026-06-09 162714

Step 2 — Browse and Select the Script File

In the file browser that opens, navigate to where you saved SpectralValueExtractor_script.py and select it, then click Open.

Screenshot 2026-06-09 162805

Step 3 — Find the Tool in the Toolbox

The tool will now appear under Scripts → Remote Sensing Tools → Spectral Value Extractor in the Processing Toolbox. Double-click it to open. Screenshot 2026-06-09 162824


Step 4 — Fill in the Parameters

The tool dialog will open. Fill in the following:

Screenshot 2026-06-09 162852

Step 5 — Select Raster Layers

When you click ... next to Raster Layers, a panel opens listing all rasters currently loaded in QGIS. Check all the layers you want to extract values from. You can also use Add File(s)... to load rasters directly from disk without adding them to the map first.

Screenshot 2026-06-09 162904

Step 6 — Run and Check the Log

Click Run. The Log tab will show the progress and results — number of points processed, bands extracted, and the CSV output path.

Screenshot 2026-06-09 162921

Step 7 — Output Layer Added to QGIS

Once finished, the output point layer is automatically added to the Layers panel. It contains all the original point attributes plus the new spectral value columns.

Screenshot 2026-06-09 162941

Step 8 — View Results in Attribute Table

Open the attribute table of the output layer to see the extracted spectral values for each point — including X/Y coordinates and all selected band/index values.

Screenshot 2026-06-09 162958

Parameters Reference

ParameterDescription
Field Sample PointsPoint vector layer (.shp / .gpkg / etc.) containing field sample locations
Point ID / Label FieldSelect the column that uniquely identifies each point (e.g. Sample_ID, No, Name)
Raster / Spectral Index LayersSelect one or more raster layers — different CRS and resolutions are handled automatically
Custom Band NamesOptional. Example: B2_Blue,B3_Green,B4_Red,NDVI — if left empty, column names are taken from the raster file names
Include X and Y Coordinate ColumnsCheck to append X and Y coordinate columns to the output
Save Output as CSVFile path for the CSV output
Output LayerNew point layer in QGIS with spectral values as attributes

Notes


Requirements