agentleFS
TerraLabAITerraLabAI/geoai-skills/skills/cartography/SKILL.md

cartography

Skill0 starsChanged 33 days agoMITView on GitHub

Makes a map end to end, from purpose and audience to a checked export. Covers the frame CRS, data preparation, QGIS symbology through PyQGIS (graduated with natural breaks, quantiles or equal interval, categorized, rule-based, color ramps, opacity, blending, layer order, hillshade under a DEM), labels, print layouts (map, legend, scale bar, north arrow, credits, PDF and PNG export with DPI), web maps with MapLibre GL JS or Leaflet (vector tiles, PMTiles, attribution), and recipes for flood or hazard maps and land cover maps. Use when someone asks to make a map of something, style or symbolize a layer, build a choropleth or thematic map, add labels, set up a QGIS print layout, export a map to PDF or PNG, or publish a web map with MapLibre or Leaflet.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do the steps in order. Each step has a check.

    line 22
  2. Distinctive:

    Purpose and audience: Ask, or state as an assumption: what the map must show, for whom (report, poster, slide, web), the output size, and …

    line 24
  3. Distinctive:

    Labels: Only the labels the purpose needs, with a buffer or halo, at least 7 pt in print.

    line 30
  4. Distinctive:

    When the data cannot support the requested map (wrong year, missing field, resolution too coarse), say so instead of mapping something else.

    line 84

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cartography

A map is done when the exported file has been opened and checked, not when the export call returned.

When to use

  • "Make a map of X", "style this layer", "choropleth of Y", "add labels", "print layout", "export to PDF", "web map".
  • Requests arrive in any language; the workflow below does not depend on the wording.

Workflow: make a map of X

Do the steps in order. Each step has a check; do not move on until it passes.

  1. Purpose and audience. Ask, or state as an assumption: what the map must show, for whom (report, poster, slide, web), the output size, and the date of the data. Check: one sentence like "Population density by commune, Gironde, 2021, A4 PDF for a council report".
  2. Inspect inputs. For each layer: geometry type, feature count, fields and types, CRS, extent, NoData for rasters. Check: the field to map exists and is numeric (or categorical) as expected; nulls are counted.
  3. Frame CRS. A projected CRS for the area (national grid, UTM zone), an equal-area CRS (EPSG:3035 for Europe) for choropleths over large regions. EPSG:3857 only for web tiles. Check: layers line up; the scale bar unit is meters.
  4. Prepare data. Normalize counts into rates (per km², per 1,000 people, percent) before a choropleth; clip to the area; dissolve if needed. Check: one value cross-checked by hand (for example area or density of one polygon).
  5. Symbology. Pick the renderer from the data type (table below). Look at the value histogram before choosing a classification. Check: printed class breaks make sense and no class is empty.
  6. Layer order and context. Points over lines over polygons over rasters; hillshade at 40 to 60 percent opacity or multiply blending under a colored DEM; basemap last and muted. Check: nothing important is hidden.
  7. Labels. Only the labels the purpose needs, with a buffer or halo, at least 7 pt in print. Check: no label cut at the frame edge.
  8. Layout or web map. Print: title, map, legend with units and class method, scale bar, north arrow when relevant, credits, CRS, date. Web: attribution control on. Check: legend names are readable, not layer_final_v2.
  9. Export. DPI from the target (96 to 150 screen, 300 print). Check: the export function reported success.
  10. Look at the result. Open the PNG or PDF itself. Check text size, legend matches the map, credits present, nothing cut. Run the checklist in references/print-layout.md.

Return the code that was run so the user can rerun it.

Choosing the renderer

DataRenderer (PyQGIS)Notes
Rate or continuous value per areaQgsGraduatedSymbolRenderersequential ramp; diverging only around a real midpoint
Categories (land use, type)QgsCategorizedSymbolRendererqualitative palette, at most about 8 to 10 classes
Conditions (status = 'closed' AND year > 2020)QgsRuleBasedRendererone rule per legend entry, an ELSE rule for the rest
Counts per areagraduated or proportional point symbolsnever a choropleth of raw counts
Continuous raster (DEM, NDVI)QgsSingleBandPseudoColorRendererset min and max from statistics, not defaults
ReliefQgsHillshadeRenderer under the colored DEMazimuth 315, altitude 45
ClassificationQGIS classUseMisleads when
Natural breaksQgsClassificationJenksclustered data, one mapcomparing maps
QuantilesQgsClassificationQuantileranking, even color useskewed data
Equal intervalQgsClassificationEqualIntervalevenly spread data, comparable mapsskewed data
Manual breaksset ranges by handknown thresholdsbreaks chosen to push a message

Code for each renderer, labels, blending and hillshade: references/symbology-pyqgis.md.

Script: choropleth to PNG and PDF

scripts/choropleth_layout.py styles one numeric field (graduated, chosen method and ramp), adds optional labels, builds an A4 layout (title, map, legend, scale bar, north arrow, credits with CRS) and exports PNG and PDF. It prints feature count, CRS and class breaks.

# Python shipped with QGIS, no GUI needed
python3 scripts/choropleth_layout.py communes.gpkg density map_density \
  --title "Population density, 2021" --credit "Source: INSEE 2021" \
  --method quantile --classes 5 --ramp Viridis --dpi 300 --label-field name

On macOS the QGIS Python is /Applications/QGIS.app/Contents/MacOS/python3.12 with PYTHONHOME=/Applications/QGIS.app/Contents/Frameworks and QT_QPA_PLATFORM=offscreen. Inside the QGIS Python console, reuse the body of main() without the QgsApplication lines.

References

  • references/symbology-pyqgis.md: renderers, ramps, opacity, blending, layer order, hillshade, labels.
  • references/print-layout.md: layout items, export settings, atlas.
  • references/web-maps.md: MapLibre GL JS and Leaflet minimal pages, PMTiles, attribution.
  • references/recipes.md: flood or hazard map, land cover map.

Core checks

  • The map answers the purpose sentence from step 1.
  • Choropleths show rates, not counts.
  • Class method and units are written in the legend.
  • Credits for every data source (for example © OpenStreetMap contributors, Contains modified Copernicus Sentinel data 2024).
  • The exported file was opened and looked at.
  • When the data cannot support the requested map (wrong year, missing field, resolution too coarse), say so instead of mapping something else.

Going further

AI Edit for QGIS restyles a map export with AI: https://terra-lab.ai/ai-edit?utm_source=skills&utm_medium=geoai-skills&utm_campaign=cartography

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.