Skip to content

Export and Reporting

github-actions[bot] edited this page Nov 4, 2026 · 2 revisions

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

export_layer

Export a layer to a file: a vector layer to ESRI Shapefile, GeoJSON, GPKG or KML; a raster layer to GeoTIFF (format 'tif'). A relative output_path is anchored to the project folder; the reply's output_path is the real location.

Parameter Type Required Description
layer_name string yes
format string yes
output_path string no
only_selected boolean no

export_layers_to_dxf

Export one or more vector layers to a single DXF file for CAD software (AutoCAD and similar). A DXF holds geometry and layer names, not attribute tables or QGIS styling: say so if the user expects either. output_path is optional -- omit it to save under the project's data/20_processed folder (or the QGIS profile folder if the project is not saved yet); a relative path is anchored to the project folder and the reply's output_path is the real location. At most 20 layers per file. Replacing an existing file asks the user first.

Parameter Type Required Description
layer_names array[string] yes
output_path string no

export_layers_to_spreadsheet

Export one or more vector layers or tables to a single spreadsheet (Excel .xlsx, or .ods) with one sheet per layer, attributes only (no styling). Use it when the user asks for an Excel or spreadsheet file; export_to_csv is for CSV. output_path is optional -- omit it to save under the project's data/20_processed folder (or the QGIS profile folder if the project is not saved yet); a relative path is anchored to the project folder and the reply's output_path is the real location. At most 20 layers per file. Replacing an existing file asks the user first.

Parameter Type Required Description
layer_names array[string] yes
output_path string no

export_temporal_animation_frames

Animate a layer over time: render one PNG frame per time step from a layer with start/end period fields already in the project -- e.g. control-area polygons over 2016-2026 -- or from an events layer with a single date field (points that stay visible from their date onward, so the map fills up frame by frame), by filtering the layer to each frame's date and exporting the current map canvas view, so the frames can be assembled into a GIF/video outside QGIS (e.g. with ffmpeg) for a native, non-HTML animation. This is the QGIS-native sibling of generate_temporal_dashboard's HTML output -- use this one when a video/GIF file is wanted instead of (or in addition to) a shareable web page. The canvas view/extent is NOT changed between frames (so the animation doesn't visually jump) -- pan/zoom to the desired extent yourself before calling this. Optionally applies a categorized style once via category_field before rendering frames. The layer's filter is restored to what it was before the call once done, even on failure. If the layer was already made temporal (set_layer_temporal) leave start_field out: its start and end fields are used; for an events layer with a single date field, give that field as start_field.

Parameter Type Required Description
layer_name string yes
start_field string no Date/text field holding when each feature's period began (the date, for an events layer). Optional when the layer is already temporal.
end_field string no Optional date/text field holding when the period ended. A feature with no value here stays visible from its start onward.
category_field string no Optional field to categorize/color the layer by (e.g. controlling faction) before rendering frames -- applied once via apply_categorized_style.
output_dir string no Directory to write frame_0001.png, frame_0002.png, etc. Defaults to a new temp directory.
step_days integer no Days between frames. Defaults to 30.

export_to_csv

Export layer attribute table to CSV file. output_path is optional -- omit it to save under the project's data/20_processed folder (or the QGIS profile folder if the project isn't saved yet), under a clean, sanitized file name derived from the layer's own name. Never prompts interactively. If features are selected on the layer, only selected features are exported by default. Point layers get X and Y columns (in the layer's CRS) instead of a WKT column unless wkt_geometry is true; the file is UTF-8 with a BOM so Excel shows non-ASCII names correctly.

Parameter Type Required Description
layer_name string yes
output_path string no
only_selected boolean no
wkt_geometry boolean no Point layers only: write a WKT geometry column instead of X/Y columns.

generate_html_dashboard

Generate an interactive HTML situation dashboard (Leaflet/Folium map with layer toggles and popups) from one or more vector layers already in the project -- e.g. a severity-index layer plus facility points plus admin boundaries, click-to-inspect the indicator values behind a severity score. This is the highest-visibility deliverable for a non-QGIS audience (fund-allocation committees, donors) -- prefer it over a static print layout/report when the audience will interact with the map themselves. The viewer needs internet access at view time (see the result's connectivity_note for the exact wording to relay). Each layer is reprojected to WGS84 automatically. Vector layers only -- not for raster layers. Optionally pass color_field per layer (e.g. a severity score field) to choropleth-color it. IMPORTANT: always pass popup_labels for any field whose raw name isn't already plain language (e.g. abbreviated or coded field names like 'food_insec_pct', 'wash_depriv_pct') -- give each one a real human-readable label (e.g. 'Food Insecurity (IPC 3+) %', 'WASH Service Deprivation %') using your own knowledge of what the field means. Fields left unlabeled fall back to a purely mechanical Title Case of the raw name (e.g. 'food_insec_pct' -> 'Food Insec Pct'), which is not real language and should not be relied on for a field whose meaning you actually know.

Parameter Type Required Description
layers array[object] yes One or more layers to include, each rendered as its own toggleable overlay.
title string no Optional dashboard title, shown as a heading overlay on the map.
output_path string no Where to save the HTML file. Defaults to a readable, timestamped file under the project's data/20_processed/dashboards folder. Tell the user the full path.
basemap string no 'hot' (default, Humanitarian OSM Team style), 'satellite' (Esri World Imagery), or 'none' (no tiles: works offline, pair with backdrop_layer), or 'positron' / 'dark_matter' (Carto; these now need a Carto API key and may show no tiles).
backdrop_layer string no Optional name of a polygon layer in the project (e.g. an administrative boundary) drawn under the data as a tile-free backdrop. Best with basemap='none'.

generate_report

Generate a Word (.docx) report document saved on Desktop. Optionally pass source_layers to append a 'Data Sources & Provenance' section -- what tool created/modified each layer, with what parameters and source layers, and when -- pulled from tracked lineage. Gives a report's audience (often not QGIS users, e.g. a fund-allocation committee) something to check a spatial claim against instead of just asserting it.

Parameter Type Required Description
title string yes
content string yes
source_layers array[string] no Optional layer names to append a provenance/lineage section for.

generate_spatial_report

Generate a markdown report to present insights in chat. Optionally pass source_layers to append a 'Data Sources & Provenance' section -- what tool created/modified each layer, with what parameters and source layers, and when -- pulled from tracked lineage. Gives a report's audience (often not QGIS users, e.g. a fund-allocation committee) something to check a spatial claim against instead of just asserting it.

Parameter Type Required Description
title string yes
insights string yes
source_layers array[string] no Optional layer names to append a provenance/lineage section for.

generate_temporal_dashboard

Generate an animated, time-sliding HTML dashboard (Leaflet/Folium) from one or more vector layers already in the project -- e.g. control-area polygons or incident points for several armed groups/factions over a multi-year period, each with its own period/date, plus a play/pause + date slider the viewer drags or plays through to watch status/control change over time. This is the temporal, reusable-for-any-multi-period-status-dataset sibling of generate_html_dashboard -- use THIS tool (not that one) whenever the data has a time dimension a viewer should be able to scrub through (e.g. 'from 2016 to 2026'), and generate_html_dashboard for a plain, non-animated situation map. At least one layer must set start_field. Give every temporal layer a category_field (e.g. the controlling faction/group name) so features are colored by category -- without it every feature in that layer gets the same color, which defeats the point of an animated status map. A layer with no start_field is rendered as an always-visible reference layer alongside the animated ones (e.g. a fixed country outline). Point-geometry layers (e.g. incidents) render as colored circle markers, not plain icons. Beyond the single-point-in-time slider, the dashboard also gets: a separate from/to date-range control that narrows what the slider ever shows and what the play button loops through; an automatic checkbox filter panel listing every distinct value of any layer's location_field (e.g. governorate/admin1 name), letting the viewer hide specific locations regardless of date; and, when any layer sets category_field, an automatic stacked bar chart (via Chart.js, from a CDN) showing how many status/control changes started in each calendar month, broken down by category and kept in sync with the location filter and date range -- modeled on a real reference dashboard the project owner shared (a Power BI conflict-monitoring report with a map, location filters, a date range, and a synced trend chart). Each layer is reprojected to WGS84 automatically. Vector layers only. The viewer needs internet access at view time (see the result's connectivity_note -- this is now true even for a dashboard with no chart, since Chart.js is always loaded). IMPORTANT: use your own knowledge of the data's field names to pass human-readable popup_labels for any coded/abbreviated field, exactly as for generate_html_dashboard. This tool never invents data of its own -- it only animates/charts whatever start_field/end_field/category_field/location_field values are actually present on the layer(s) you point it at.

Parameter Type Required Description
layers array[object] yes One or more layers. At least one must set start_field.
title string no Optional dashboard title, shown as a heading overlay on the map.
output_path string no Where to save the HTML file. Defaults to a readable, timestamped file under the project's data/20_processed/dashboards folder. Tell the user the full path.
step_days integer no Slider step size / play-button advance, in days. Defaults to 30.
basemap string no 'hot' (default, Humanitarian OSM Team style), 'satellite' (Esri World Imagery), or 'none' (no tiles: works offline, pair with backdrop_layer), or 'positron' / 'dark_matter' (Carto; these now need a Carto API key and may show no tiles).
backdrop_layer string no Optional name of a polygon layer in the project (e.g. an administrative boundary) drawn under the data as a tile-free backdrop. Best with basemap='none'.

print_map

Export current QGIS map canvas view to a PDF document or PNG/JPG image. output_path is optional -- if omitted, saves a PNG to Desktop without prompting.

Parameter Type Required Description
output_path string no Optional file path with .pdf, .png, or .jpg extension. If omitted, saves a PNG to Desktop.

Clone this wiki locally