generate_map
Render a print-ready map sheet from a QGIS project shape, including title, legend, north arrow, scale bar, grid, notes, and clipped layers, exporting to PDF, PNG, JPG, or TIF.
Instructions
Render one map sheet (PDF/PNG/JPG/TIF chosen by extension) over the project shape.
Includes title, legend, north arrow, scale bar, coordinate grid and notes. Clipped layers are saved to a GeoPackage next to the output. In QGIS the sheet is added to the Layout Manager (and opened when open_layout is true) so it can be edited there; headless, a .qgz project is saved next to it.
Args: output_path: Where to write the map, e.g. "C:/salidas/mapa_general.pdf". layers: Layer types to include (all added layers when omitted). page_size: A4, A3, A2, LETTER, LEGAL or TABLOID. extent: "project" zooms to the project shape, "layers" to all layers. margin_percent: Space around the project shape, in % of its size. sources: Data sources credited in the notes box. basemap: Background under the layers: "satelite" (Esri World Imagery), "google" (Google Satellite) or "osm" (OpenStreetMap). Needs internet; credited in the notes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dpi | No | ||
| grid | No | ||
| title | No | ||
| extent | No | project | |
| labels | No | ||
| layers | No | ||
| basemap | No | ||
| sources | No | ||
| subtitle | No | ||
| page_size | No | A4 | |
| open_layout | No | ||
| orientation | No | landscape | |
| output_path | Yes | ||
| margin_percent | No |