QGIS Plugin · v0.3.0 · GAIA-alpha

An AI assistant
built into QGIS

GAIA-alpha is a QGIS plugin that connects a large language model to your active GIS project. It can inspect layers, run geoprocessing, apply styles, fetch real-world data, and trigger deep learning models — all from a natural language chat panel.

QGIS 3.22 – 4.99
Python 3 / PyQt5
LLM providers OpenAI · Gemini · Claude
No pip install required
Get it on GitHub
GAIA — GIS AI Assistant
50+
AI tool actions available in chat
24
ArcGeek processing algorithms
8
External geospatial APIs integrated
6
Deep learning models (GeoAI)
01

Three integrated components

AI Chat Assistant
A dockable panel in QGIS where you interact in natural language. The AI reads your project state automatically (layers, CRS, fields, canvas extent, selected features) and executes over 50 actions by calling structured tools. Supports full multi-turn conversation with memory.
ArcGeek Calculator
24 domain-specific processing algorithms registered in the QGIS Processing Toolbox. Covers hydrology, watershed analysis, coordinate geometry, raster classification, spatial interpolation, satellite indices, terrain profiling, and more. Can be invoked headlessly by the AI or opened as interactive dialogs.
GeoAI Deep Learning
Programmatic wrappers for state-of-the-art computer vision models: SAM / SAM2 (interactive segmentation), U-Net / DeepLabV3+ (semantic segmentation), Mask R-CNN (instance segmentation), DeepForest (tree detection), OmniWaterMask, and Moondream VLM. Dependencies are auto-installed in an isolated virtual environment.
02

AI tool catalog — what the assistant can do

2a — Layer management

List & inspect layers
List all loaded layers with type, CRS, feature count, selected count, and field schema.
Create memory layer
Create a new in-memory Point, Line, or Polygon layer with custom fields.
Add WKT features
Draw new features by supplying WKT geometries and attribute values.
Edit attributes
Update field values on one or more features by feature ID.
Load layer from file
Open a vector or raster file from disk and add it to the project.
Show / hide layers
Toggle layer visibility in the layer tree panel.
Zoom to layer
Navigate the canvas to a layer's extent, with optional padding.
Set map extent
Pan and zoom the canvas to explicit coordinate bounds.
Delete layer
Remove a layer from the project with undo support.
Set active layer
Make a given layer the active selection in QGIS.
Save project
Save the current project to disk at the current or a new path.
Refresh / undo
Refresh the map canvas render, or revert the last AI-initiated change.

2b — Spatial analysis

Buffer
Create a buffer around features at a specified distance (any unit).
Intersection
Compute the geometric intersection of two layers.
Clip / Dissolve / Merge
Standard vector geoprocessing: clip to mask, dissolve by field, merge multiple layers.
Reproject layer
Transform a layer to a different coordinate reference system.
Select by expression
Select features using any QGIS expression (SQL-like attribute queries).
Select by distance
Select features in layer A that are within a distance threshold of layer B.
Select by location
Select features by a spatial predicate: intersects, contains, within, touches, etc.
Extract by expression
Create a new layer from features matching an attribute or spatial expression.
Add field & calculate
Add a new attribute field and populate it with a QGIS expression.
Nearest join
For each feature in layer A, find the nearest feature in layer B and attach its attributes.
Layer statistics
Return count, min, max, mean, sum, and standard deviation for a numeric field.
Get features / geometry
Read attribute rows and geometry details (centroid, area, length, WKT) from a layer.
Raster operations
Clip raster, warp/reproject raster, and raster calculator (band math expressions).
Run any processing algorithm
Execute any QGIS / GDAL / GRASS / SAGA algorithm by its ID, passing arbitrary parameters.

2c — Styling & visualisation

Set layer color
Apply a flat color to an entire vector layer using any CSS/hex color.
Style by expression
Partially style features — only those matching a condition change color; others stay unchanged.
Rule-based style
Apply a multi-rule renderer with custom colors, labels, and scale conditions per rule.
Categorized style
Color features by unique values in a categorical field with auto-assigned or custom palettes.
Graduated style
Create a graduated color ramp on a numeric field (Jenks, quantile, equal interval).
Proximity highlight
Visually highlight features in one layer that are near features in another layer.

2d — External geospatial data APIs

Sentinel Hub
Fetch multispectral satellite imagery (Sentinel-2, Landsat, MODIS) for the current map extent. Requires Sentinel Hub API key. Eval scripts are customizable.
NASA EarthData
Search the NASA EarthData STAC catalog for Landsat, VIIRS, ASTER, and other NASA datasets. Free, no key required.
OpenTopography DEM
Download elevation data (SRTM 30m, SRTM 90m, ALOS 30m, Copernicus DEM) clipped to the map extent. Requires OpenTopography API key.
Open-Meteo Weather
Fetch current and forecast weather (temperature, precipitation, wind) for any lat/lon. Completely free, no API key needed.
Copernicus CDS / ERA5
Search the Copernicus Climate Data Store for climate reanalysis datasets including ERA5. Requires CDS API key.
NOAA Climate Data Online
Retrieve historical weather station observations (GHCN-Daily, ISD) via the NOAA CDO API. Requires free NOAA token.
IRI Data Catalog
Browse and query the International Research Institute for Climate and Society seasonal climate dataset catalog. Free, no key.
STAC Imagery
Fetch cloud-optimized GeoTIFF imagery from any STAC-compliant endpoint. Loads result directly as a raster layer.
MapTiler basemaps
Add premium vector and raster tile basemaps (Streets, Outdoor, Satellite, Terrain) to the project. Requires MapTiler API key.
XYZ / OSM tile layers
Add any XYZ tile layer by URL — including OpenStreetMap, Stamen, CartoDB, Esri — as a raster basemap. No key needed for most providers.

2e — OpenStreetMap integration

Nominatim geocoding
Forward geocode place names and addresses (Nominatim API) and return structured results including bounding box and category.
Nominatim reverse geocoding
Reverse geocode any lat/lon coordinate to a human-readable place name and administrative hierarchy.
Overpass QL queries
Execute arbitrary Overpass API queries to extract any OSM feature type (roads, buildings, amenities, waterways…) as a new QGIS vector layer. The AI constructs the Overpass QL from natural language.

2f — Advanced & power tools

Execute Python code
Write and execute arbitrary PyQGIS code inside a sandboxed environment with pre-imported QGIS classes. The AI reads printed output and iterates. Controlled by guard rails (see Security section).
Run standalone script
Execute a multi-step PyQGIS script with broader permissions — designed for complex processing workflows that chain multiple operations.
Plan-and-execute agent
For complex goals, the AI can plan a multi-step action sequence, execute each step, verify the result, and replan if needed — fully autonomously.
Web search
Search the web for GIS documentation, CRS definitions, algorithm parameters, or any other reference — results are used to improve the next action.

2g — Suitability analysis (PyLUSATQ-based)

Weighted Sum Overlay
Combine multiple raster criteria with custom weights to produce a suitability raster.
Linear Rescale
Rescale raster values to a 0–1 (or 1–9) suitability score range.
Reclassify Field
Reclassify attribute field values into discrete suitability classes.
Point / Line Distance
Generate a distance raster from point or line features for proximity-based suitability.
Point / Line Density
Compute kernel density raster from point or line features.
IDW Interpolation
Inverse Distance Weighting interpolation from sampled point data to a raster surface.
Suitability Select
Extract areas above a suitability threshold from the output raster as a vector mask.
Erase
Remove excluded zones from a suitability layer using a vector mask.

2h — QGIS UI automation

List UI actions
Discover all available QGIS menus, toolbar buttons, and panel actions by name or keyword.
Trigger action
Click any QGIS menu item or toolbar button programmatically by its identifier.
List widgets
Inspect the tree of actionable Qt widgets (inputs, buttons, dropdowns) in any open dialog.
Click widget
Programmatically click any button or checkbox in any QGIS dialog, including modal dialogs.
Set widget text
Type text into any input field in an open QGIS dialog.
Select combobox item
Choose an option from any dropdown menu in a QGIS dialog.
Check UI state
Detect if a modal dialog is blocking QGIS, or whether a background task is still running.

2i — QGIS environment introspection

Inspect providers & plugins
List all data providers, processing providers, and installed QGIS plugins.
Search processing algorithms
Search all registered algorithms (native, GDAL, GRASS, SAGA, QGIS) by keyword, group, or provider.
Read QGIS log
Access QGIS message log to diagnose errors from recent tool executions.
03

ArcGeek Calculator — 24 processing algorithms

Algorithm key Name & description Category
watershed_stream
Watershed Stream Analysis
Delineates a drainage network from a DEM using flow accumulation. Computes Strahler stream order. Outputs ordered polyline layer with stream attributes.
Hydrology
watershed_basin
Watershed Basin Delineation
Delineates a single catchment basin from a pour point on a DEM. Uses flow direction and accumulation grids. Output: filled DEM, flow dir, flow acc, and watershed polygon.
Hydrology
basin_analysis
Basin Morphometric Analysis
Computes standard watershed morphometric parameters (compactness coefficient, elongation ratio, form factor, circularity ratio, drainage density, stream frequency, etc.).
Hydrology
multiple_basin_delineation
Multiple Basin Delineation
Batch delineation of multiple catchment basins from a set of pour points. Processes all basins in a single run from a DEM.
Hydrology
global_cn
Global Curve Number Calculator
Computes SCS-CN (Curve Number) values by intersecting hydrological soil groups with land use / land cover. Supports ESA WorldCover 2021 as a built-in LULC dataset.
Hydrology
dam_flood_simulation
Dam Flood Simulation
Simulates reservoir inundation by computing water depth raster from a DEM at a specified water surface elevation. Generates flood extent polygon.
Hydrology
coordinate
Coordinate Calculator
Adds X/Y, decimal degree, and DMS coordinate fields to point layers. Can also reproject and compute UTM zone.
Geometry
line
Calculate Line Geometry
Calculates and appends length and azimuth fields to line layers, respecting the layer CRS for accurate planar or geodetic measurements.
Geometry
polygon
Calculate Polygon Geometry
Adds area and perimeter fields to polygon layers. Supports planar and ellipsoidal calculations.
Geometry
angles
Calculate Angles
Calculates interior and exterior angles at each vertex of polygon or polyline features.
Geometry
polygon_to_points
Polygon to Ordered Points
Extracts polygon vertices as ordered point features, preserving ring structure and vertex sequence attributes.
Geometry
lines_to_ordered_points
Lines to Ordered Points
Converts line vertices to ordered point features, retaining sequence, cumulative distance, and segment direction.
Geometry
calculate_line
Generate Line from Azimuth / Distance
Constructs line features from a table of azimuth-distance traverse pairs. Useful for cadastral surveys and field traverses.
Geometry
export_to_csv
Export Attributes to CSV
Exports all attribute fields of a vector layer to a CSV file with configurable field selection and delimiter.
Geometry
land_use_change
Land Use Change Detection
Compares two raster land cover maps from different dates, producing a change matrix, transition area statistics, and a change raster layer.
Raster
weighted_sum
Weighted Sum / Overlay
Performs weighted raster overlay (WLC). Accepts N raster inputs each with a weight; produces a composite suitability surface.
Raster
least_cost_path
Least Cost Path Finder
Computes the minimum-cost route between two points over a cost raster. Considers slope, resistance layers, and microrelief. Useful for road alignment, hiking routes, pipeline corridors.
Raster
kriging_analysis
Kriging Interpolation
Geostatistical interpolation of point samples into a continuous raster surface. Supports Ordinary, Universal, and Simple Kriging with cross-validation and variogram fitting.
Raster
satellite_index
Satellite Index Calculator
Computes spectral indices (NDVI, NDWI, NDBI, EVI, SAVI, BSI, and custom expressions) from multi-band raster imagery.
Classification
enhanced_classification
Enhanced Image Classification
Supervised land cover classification using Random Forest, SVM, or K-Nearest Neighbors on raster bands. Generates accuracy metrics and a classified raster output.
Classification
topographic_profile
Topographic Profile
Extracts an elevation profile along a transect line from a DEM. Renders an interactive Plotly chart of the cross-section with slope and distance statistics.
Classification
tree_planting_pattern
Tree Planting Pattern
Generates optimized planting grids inside a polygon using square, rectangular, triangular, or quincunx (diamond) patterns at a specified spacing. Outputs planting point layer.
Classification
contour_export
Contour Export to 3D DXF/CAD
Generates contour lines from a DEM and exports them as a 3D DXF file with Z values equal to elevation. Compatible with AutoCAD, MicroStation, and BricsCAD.
CAD / Terrain
optimized_parcel_division
Optimized Parcel Division
Divides a land parcel polygon into N equal-area (or proportionally sized) sub-parcels using configurable split directions and constraints. Used in cadastral workflows.
CAD / Terrain
04

GeoAI — deep learning models

All GeoAI tools run headlessly — no dialogs or manual steps. Dependencies are auto-installed in an isolated virtual environment at ~/.qgis_geoai/. Basemaps and tile layers are automatically exported to raster before inference, so any visible map layer can be used as input.

geoai_segment · model="samgeo"
Segment Anything (SAM / SAM2 / SAM3)
Meta's Segment Anything Model for interactive, prompt-based segmentation of any geospatial raster. Produces vector polygons for all detected objects without needing labeled training data.
geoai_segment · model="segmentation"
Semantic Segmentation (U-Net / DeepLabV3+)
Pixel-level classification of raster imagery into semantic classes (buildings, roads, vegetation, water…). Supports training on custom data or inference with pre-trained weights.
geoai_segment · model="instance_segmentation"
Instance Segmentation (Mask R-CNN)
Detects and segments individual object instances in imagery. Each detected object receives its own polygon, making it ideal for counting and measuring discrete features.
geoai_detect_trees
Tree Crown Detection (DeepForest)
Detects and delineates individual tree crowns in RGB aerial imagery using the DeepForest model. Returns bounding box polygons with confidence scores.
geoai_detect_water
Water Body Segmentation (OmniWaterMask)
AI-based detection and segmentation of water bodies (rivers, lakes, reservoirs) in optical satellite or aerial imagery. Outputs a water-class vector polygon layer.
geoai_vlm_query
Vision Language Model (Moondream VLM)
Answers natural language questions about any map layer or imagery ("what type of land cover is visible?", "how many buildings are in this area?") using a small, locally-running VLM.
05

LLM provider support

Configure your preferred provider, model, and API key in the Settings dialog. The API URL is fully customizable, enabling any OpenAI-compatible endpoint (local models, proxies, Azure OpenAI, etc.).

OpenAI
gpt-4o, gpt-4-turbo, o1…
Any OpenAI-compatible endpoint
Google Gemini
gemini-1.5-pro, gemini-2.0…
Via OpenAI-compatible endpoint
Anthropic Claude
claude-opus-4, sonnet-4…
Native API with prompt caching
Custom / Local
Ollama, LM Studio, vLLM…
Any OpenAI-compatible server

→ Anthropic Claude uses prompt caching: the system prompt and tool definitions are cached server-side, cutting token costs by up to 90% on repeated turns.

06

Automatic project context injection

Before every AI request, GAIA-alpha automatically builds a context string from the live QGIS session and injects it into the system prompt. The AI always knows exactly what is in your project.

Project title & CRS
Project title and coordinate reference system EPSG code.
Canvas extent & CRS
Current map canvas bounding box coordinates and display CRS.
All layer names & types
Every loaded layer with its geometry type, CRS, feature count, and visibility state.
Active layer & field schema
Full list of field names and data types for every vector layer.
Selected feature count
Number of currently selected features per layer, flagged when non-zero.
Sample attribute rows
Optionally, up to 3 sample rows from the active layer to help the AI build correct expressions.
07

Security & guard rails

All AI-generated Python code passes through a multi-layer guard rail system before execution. A "Simple Mode" toggle in Settings disables Python execution entirely for extra safety.

File system operations blocked: rm -rf, shutil.rmtree, os.remove, os.unlink, pathlib.unlink/rmdir
Shell execution blocked: os.system, subprocess, exec(), eval(), compile(), __import__(), importlib
Network access blocked in Python exec: urllib, requests, http, socket, ftplib, smtplib, telnetlib, SSH
QGIS project destruction blocked: removeAllLayers(), QgsProject.clear(), deleteLater(), QgsProviderRegistry manipulation
Resource exhaustion blocked: infinite while loops, very large range() calls, nested list comprehensions that could exhaust memory
Secrets access blocked: os.environ, getenv(), keyring, cryptography modules
Allowed processing prefixes: gaia_arcgeek:, native:, qgis:, gdal:, grass:, saga: — only trusted algorithm providers can be executed
Configurable limits: max code length (15,000 chars), max features per operation (100,000), max execution time (30 s), max memory (500 MB)