Skip to content
github-actions[bot] edited this page Nov 5, 2026 · 2 revisions

This page is generated from the repository on every merge to main; changes made here are overwritten.

apply_raster_stretch

Apply a min/max contrast stretch or pseudocolor ramp to a single-band raster layer -- every raster-producing tool in this plugin (calculate_ndvi/calculate_ndwi/calculate_ndre, calculate_raster_change_detection, hillshade/slope_analysis/aspect_analysis, interpolate_surface, hotspot_analysis, weighted_overlay_analysis, etc.) lands on the canvas with QGIS's raw, unstretched single-band default rendering, which usually looks flat grey and unreadable until this is applied -- this plugin's vector styling toolkit (apply_graduated_style, apply_categorized_style, apply_heatmap_style) has no raster equivalent, this tool is it. Two modes: 'color_ramp' applies a QgsSingleBandPseudoColorRenderer with a named QGIS color ramp (e.g. a diverging ramp centered on 0 for a -1..1 vegetation/water index); 'stretch' applies a grayscale linear min/max contrast stretch via QgsSingleBandGrayRenderer, the usual fix for a flat-looking DEM/hillshade/panchromatic band. 'auto' (default) picks 'color_ramp' with a sensible diverging ramp for layers whose name contains 'ndvi'/'ndwi'/'ndre', 'stretch' otherwise. Min/max values default to the band's actual computed data min/max unless overridden.

Parameter Type Required Description
layer_name string yes
mode string no 'auto' (default), 'stretch' (grayscale contrast stretch), or 'color_ramp' (pseudocolor). 'auto' picks 'color_ramp' for layers named like NDVI/NDWI/NDRE, 'stretch' otherwise.
color_ramp string no QGIS color ramp name (e.g. 'Viridis', 'RdYlGn', 'RdBu', 'Spectral'). Only used in 'color_ramp' mode. Defaults to a diverging ramp for known vegetation/water indices, or 'Viridis' otherwise.
band integer no Raster band number to style. Defaults to 1.
min_value number no Optional. Overrides the auto-computed stretch/ramp minimum.
max_value number no Optional. Overrides the auto-computed stretch/ramp maximum.
keep_population_ramp boolean no Default true: a WorldPop population layer keeps the plugin's own ramp (empty cells transparent, unit on the legend) because a generic stretch over a whole country is unreadable. Pass false only if the user explicitly asked for a different look.

aspect_analysis

Calculate aspect map from DEM layer.

Parameter Type Required Description
dem_layer string yes

band_composite

Create RGB band composite from single band rasters.

Parameter Type Required Description
layer_name string yes
red_band string yes
green_band string yes
blue_band string yes

calculate_ndre

Calculate NDRE (Normalized Difference Red Edge index) from Red Edge and Near-Infrared raster bands -- a precision-agriculture vegetation index more sensitive than NDVI to chlorophyll/nitrogen status in mid-to-late-season crops: 'crop nitrogen stress', 'plant chlorophyll health', 'precision agriculture crop monitoring'. Needs a Red Edge band (not standard on every sensor -- confirm the imagery actually has one before calling this over calculate_ndvi, which only needs Red/NIR and works with far more common sensors). Produces a new single-band raster layer named 'NDRE' with QGIS's default (unstretched) rendering -- follow up with apply_raster_stretch(layer_name='NDRE') to apply a readable diverging color ramp (auto-selected for NDRE-named layers) instead of leaving it flat/unstretched.

Parameter Type Required Description
red_edge_layer string yes
nir_layer string yes
align_to_first boolean no If the rasters are not on one pixel grid, warp the others onto the first raster's grid (its CRS, extent and cell size) instead of refusing. The result says which raster was the reference and the resampling used. Default false: refuse.
resampling string no With align_to_first: 'bilinear' (default, for continuous values such as reflectance), 'nearest' (for classes or counts) or 'cubic'.

calculate_ndvi

Calculate NDVI (Normalized Difference Vegetation Index) from Red and Near-Infrared raster bands -- the standard remote-sensing measure of vegetation health/greenness/density: 'how green is this area', 'is this crop/vegetation healthy', 'vegetation health check'. Output ranges roughly -1 to 1: values near 1 indicate dense healthy vegetation, near 0 bare soil or built-up areas, negative values open water. Produces a new single-band raster layer named 'NDVI' added to the project with QGIS's default (unstretched, low-contrast) rendering -- follow up with apply_raster_stretch(layer_name='NDVI') to apply a readable diverging color ramp (auto-selected for NDVI-named layers) instead of leaving it flat/unstretched.

Parameter Type Required Description
red_layer string yes
nir_layer string yes
align_to_first boolean no If the rasters are not on one pixel grid, warp the others onto the first raster's grid (its CRS, extent and cell size) instead of refusing. The result says which raster was the reference and the resampling used. Default false: refuse.
resampling string no With align_to_first: 'bilinear' (default, for continuous values such as reflectance), 'nearest' (for classes or counts) or 'cubic'.

calculate_ndwi

Calculate NDWI (Normalized Difference Water Index) from Green and Near-Infrared raster bands -- the standard remote-sensing measure of surface water/moisture: 'how much water is in this area', 'map surface water extent', 'is there flooding here'. Output ranges roughly -1 to 1: values above ~0 typically indicate open water, below ~0 vegetation/dry land. For a flood-specific before/after comparison rather than a single-image water map, use calculate_raster_change_detection instead. Produces a new single-band raster layer named 'NDWI' with QGIS's default (unstretched) rendering -- follow up with apply_raster_stretch(layer_name='NDWI') to apply a readable diverging color ramp (auto-selected for NDWI-named layers) instead of leaving it flat/unstretched.

Parameter Type Required Description
green_layer string yes
nir_layer string yes
align_to_first boolean no If the rasters are not on one pixel grid, warp the others onto the first raster's grid (its CRS, extent and cell size) instead of refusing. The result says which raster was the reference and the resampling used. Default false: refuse.
resampling string no With align_to_first: 'bilinear' (default, for continuous values such as reflectance), 'nearest' (for classes or counts) or 'cubic'.

create_shaded_relief

Generate a publication-grade shaded relief composite from a DEM layer combining hypsometric elevation tinting with hillshade using Multiply blending (QPainter.CompositionMode_Multiply). First styles the DEM with a pseudocolor elevation color ramp (e.g. 'BrBG', 'Spectral', or 'Terrain'), generates or links the hillshade layer, and applies the Multiply blend mode so the topography modulates the elevation colors cleanly without flattening.

Parameter Type Required Description
dem_layer string yes Name of the DEM/elevation raster layer.
color_ramp string no Color ramp name for hypsometric tinting. Defaults to 'BrBG' (CVD-safe diverging ramp).
azimuth number no Sun azimuth angle in degrees (default 315).
altitude number no Sun altitude angle in degrees (default 45).
opacity number no Hillshade layer opacity between 0.0 and 1.0 (default 1.0).

elevation_profile

Sample a DEM raster along a line to produce a distance/elevation profile -- e.g. terrain along a proposed route, or a valley cross-section. Returns distance-along-line and elevation arrays of equal length; feed them into generate_chart (chart_type='line') for a real elevation-profile chart.

Parameter Type Required Description
line_layer string yes Line layer to sample along. Uses the first feature if it has more than one.
dem_layer string yes Raster (DEM) layer to sample elevation from.
num_samples integer no Number of sample points along the line. Defaults to 100.
dem_vertical_unit string no Vertical unit of the DEM's elevation values: 'm' (default), 'ft' or 'us_ft'. A raster does not carry its vertical unit, so say so if the DEM is in feet.

estimate_population_exposure

Sum population within each polygon of a vector layer, using an already-loaded population raster (e.g. from fetch_worldpop_population) -- e.g. 'how many people live within 5km of this facility' (combine with buffer_analysis first to build the area), or 'population per district' (pass admin boundaries directly). Does not modify the vector layer; returns one total per zone (keyed by name, made unique when names repeat) and says whether zones overlap. Returns an ESTIMATE derived from a gridded population raster, not a verified count of people actually present -- report results as 'estimated population within ', never as a confirmed or affected-population figure, unless field data corroborates it.

Parameter Type Required Description
population_raster_layer string yes A population-per-pixel raster layer (e.g. from fetch_worldpop_population).
area_layer string yes Polygon layer to sum population within, one total per feature.
raster_unit string no 'people_per_cell' (default; counts per cell, e.g. WorldPop ppp) or 'people_per_km2' (a density raster: each cell is multiplied by its area before summing). A raster does not carry its unit; a layer named like a density raster is refused unless this is set.
output_layer_name string no Optional: also add a NEW polygon layer with this name holding each zone's estimated population (field pop_estimate), styled in exposure classes. The area layer itself is never changed.

georeference_image

Georeference a scanned map or unreferenced image using control points (pixel coordinates matched to real-world coordinates) -- e.g. aligning a scanned paper map to its true location and scale on the map. Needs at least 3 non-collinear control points; more (well-distributed across the image) generally gives a more accurate result than the minimum. Produces a real, spatially-referenced raster, loads it into the project, and reports the fit's RMSE (in the target CRS's units) so alignment quality can be judged -- QGIS Georeferencer shows the same number for the same reason.

Parameter Type Required Description
image_path string yes Absolute path to the source image (e.g. a scanned map).
control_points array[object] yes At least 3 points, e.g. [{"pixel_x": 120, "pixel_y": 340, "lon": 35.93, "lat": 31.95}].
output_path string yes Where to save the georeferenced raster (.tif).
target_crs string no CRS of the lon/lat control point coordinates. Defaults to EPSG:4326.
transform_type string no 'tps' (default): thin-plate-spline rubber-sheeting -- best when the source image itself is locally distorted (an uneven scan, a hand-drawn sketch map) since it bends to fit every control point exactly. 'linear': a single 6-parameter affine (independent x/y scale, shear, rotation) fit by least squares -- QGIS Georeferencer's 'Linear'. 'helmert': a single 4-parameter similarity (one uniform scale, one rotation, no shear) fit by least squares -- QGIS Georeferencer's 'Helmert', the right choice for a clean scan of a rigid printed map where the true transform can't have shear.

hillshade

Generate hillshade surface from DEM layer.

Parameter Type Required Description
dem_layer string yes

histogram_equalization

Enhance raster image contrast using histogram equalization. Writes a NEW 8-bit raster (0-255) of one band; no-data cells stay no-data. A global equalisation of the band, for display and visual interpretation: the values are no longer the original measurements.

Parameter Type Required Description
raster_layer string yes
band integer no Band to equalise, default 1.

interpolate_surface

Create a continuous raster surface from scattered point values using spatial interpolation -- e.g. estimating rainfall/elevation/population density between sample points. 'idw' (inverse distance weighting, default) is simple and fast; 'tin' (triangulated irregular network) preserves exact sample values but can look faceted at the triangle edges. Neither is a true geostatistical kriging model -- use this for a reasonable estimate, not a statistically rigorous prediction with confidence bounds.

Parameter Type Required Description
point_layer string yes
field string yes Numeric field to interpolate.
method string no 'idw' (default) or 'tin'.
cell_size number no Output raster cell size in the layer's CRS units. Defaults to a size producing roughly a 250x250 grid.

mosaic_rasters

Merge/mosaic multiple raster layers together.

Parameter Type Required Description
raster_layers_list array[string] yes

pan_sharpening

Pan-sharpen multispectral raster using panchromatic band.

Parameter Type Required Description
ms_layer string yes
pan_layer string yes

raster_clip

Clip raster layer by vector mask layer.

Parameter Type Required Description
raster_layer string yes
mask_layer string yes

slope_analysis

Calculate slope map from DEM layer. Elevations are taken as metres unless dem_vertical_unit says 'ft' or 'us_ft'.

Parameter Type Required Description
dem_layer string yes
dem_vertical_unit string no Vertical unit of the DEM's elevation values: 'm' (default), 'ft' or 'us_ft'. A raster does not carry its vertical unit, so say so if the DEM is in feet.

supervised_classification

Supervised classification using training polygons.

Parameter Type Required Description
layer_name string yes
training_layer string yes

unsupervised_classification

Unsupervised K-Means raster classification of up to the first 8 bands into num_classes spectral classes (1..num_classes; 0 = no data). Classes are statistical clusters of pixel values, NOT land-cover categories: label them yourself. Reproducible with a seed; works through the raster in blocks, so memory is not the limit, and on a large raster it runs in the background so QGIS stays responsive and Stop works; a raster over 400 million cells is refused (clip it first).

Parameter Type Required Description
layer_name string yes
num_classes integer yes Number of clusters, 2 to 50.
seed integer no Random seed (default 0).

weighted_overlay_analysis

Combine multiple rasters into a single weighted suitability/risk surface -- e.g. 'best sites for a new clinic' combining slope, distance-to-road, and population density rasters with different weights. Each input raster should already be normalized to a comparable scale (e.g. 0-1 or 0-100) before combining -- this tool weights and sums them, it doesn't rescale them. All rasters must share the same CRS and cover roughly the same extent/resolution, or the result is meaningless; mismatched CRS is rejected outright rather than silently misaligned.

Parameter Type Required Description
raster_layers array[string] yes 2 to 6 raster layer names to combine.
weights array[number] yes One weight per raster, same order as raster_layers. Don't need to sum to 1 -- normalized automatically.
align_to_first boolean no If the rasters are not on one pixel grid, warp the others onto the first raster's grid (its CRS, extent and cell size) instead of refusing. The result says which raster was the reference and the resampling used. Default false: refuse.
resampling string no With align_to_first: 'bilinear' (default, for continuous values such as reflectance), 'nearest' (for classes or counts) or 'cubic'.

zonal_statistics

Compute zonal statistics of raster over vector polygons.

Parameter Type Required Description
raster_layer string yes
vector_layer string yes

Clone this wiki locally