ChatGPT for QGIS: What It Can and Can't Do, Tested
Published
Yes, ChatGPT can write PyQGIS code for you, and for simple jobs that code often runs first time. But it can't see your project or run anything in it, so it guesses your layers and coordinate system, and when it guesses wrong the script can finish without an error and still give you the wrong map.
I tested that on 27 September 2026. I gave OpenAI's GPT-5.5 three QGIS tasks, typed the way most people type them in a chat, and ran every script it returned in QGIS 3.44 with real open data for Annecy, France. Two scripts were right on the first answer. The third ran cleanly and exported a print layout with an empty map.

What ChatGPT can do for a QGIS user
ChatGPT is a chatbot: you type in a browser tab and it answers in text. For QGIS, that text is usually PyQGIS, the Python interface to QGIS, which you paste into the Python console (Plugins > Python Console). Claude and Gemini work the same way. If you're new to the console, our PyQGIS guide shows where scripts run.
Used like that, a chatbot is good at a lot of the dull parts of QGIS work:
- Drafting a script you'll reuse, such as the same buffer or clip on fifty files.
- Explaining an error message you paste back from the console.
- Writing a QGIS expression for the field calculator or a rule-based style.
- Telling you which Processing tool does what, and which parameters it takes.
It costs nothing to try, and for a GIS user who knows some Python it's a real time saver. The catch is in how it works.
What it can't do: see or touch your project
A chatbot in a browser tab never sees QGIS. It doesn't know your layer names, your fields, your coordinate system (CRS) or what's on the map. It can't run its own code, and it can't look at the result. You're the one who pastes, runs and checks.
So every script is written blind, and the model fills the gaps with guesses. In my test it guessed well twice and badly once, and the bad guess produced no error at all.
The test: three tasks, the prompt most people write
I picked three tasks of rising difficulty and wrote down, before any run, what a correct result looks like. The data is open: the six districts of Annecy from the French government's geo API, the 86 schools of the town from the national school directory (55 primary schools, 21 collèges, 10 lycées), and a 30 m Copernicus elevation model.
Each prompt was one line, "I use QGIS 3.44. Write PyQGIS code I can paste into the QGIS Python console", followed by the task, with no description of the layers. When a script broke or the output looked wrong, I pasted back what I saw, up to three answers per task. Then I gave the same three sentences to AI Agent, the agent plugin we build, in the same project.
| Task | ChatGPT (GPT-5.5) | AI Agent inside QGIS |
|---|---|---|
| Buffer 86 schools by 300 m, merge the overlaps, save, give the area | Right on answer 1: 1,472 ha printed, 1,469 ha when I re-measured | Right on message 1: 1,472 ha, 20 s |
| Clip the elevation model to the Annecy-le-Vieux district, give min, max and mean | Right on answer 1: 419 m, 1,165 m, 575 m | Right on message 1, same values, 24 s |
| Print layout: schools by type, title, legend, scale bar, north arrow, PDF | Empty map on answer 1, map cut off on answer 2, usable on answer 3 | Right on message 1, 51 s |
Each chatbot answer took 23 to 41 seconds to arrive, and that's before pasting, running and opening the PDF. The AI Agent times include the run in QGIS.
Where it breaks: code that runs and is still wrong
The print layout is the task that shows the problem. ChatGPT's first script created the layout, styled the schools, added every item I asked for and printed "Exported layout". The PDF had a title, a legend, a north arrow and an empty map frame.
The reason is the CRS. My layers are stored in degrees (EPSG:4326), but the project draws the map in metres (EPSG:3857), which is what you get when an OpenStreetMap basemap is the first layer you add. The script took the layers' extent in degrees and handed it to a map drawn in metres, so the map zoomed to a patch of open sea off West Africa, less than a metre wide. The chatbot had no way to know the project CRS, because I never told it and it can't look. Our guide to what a CRS is explains why that mismatch is so common.
When I described the empty PDF, the second answer found the cause right away and fixed the extent. The map appeared, but its frame came out 281 mm tall on a page 210 mm high, so the south of the town fell off the page. The third answer wasn't a script at all. It was a block to paste over part of the second script, which is fine if you read Python and easy to get wrong if you don't.
Three answers in, the layout was usable but small, with the town filling about a third of the page.
The two that worked were partly luck
The buffer script was clean. It picked a metric CRS from the layer's position (UTM zone 32N), buffered, merged and saved, and its area matched mine within 0.2%.
The clip script also gave the right numbers, but look at how it found the district. It didn't know which layer holds districts or which field holds names, so it read every text field of every layer and stopped at the first value containing "Annecy-le-Vieux". In this data, 11 of the 86 school names contain "Annecy-le-Vieux" too. It picked the district only because QGIS happened to list the districts layer before the schools layer. Name the layers differently and the same script could grab a school instead of the district.
That's the pattern with a chatbot that can't see your project. The code is often sensible, but it rests on guesses, and you only find out which guess was wrong when you check the output yourself. Our earlier test in the PyQGIS guide found the same thing with a different chatbot: describe your layers, fields and CRS in the prompt, and the results got much better.
An agent inside QGIS does the checking for you
We build AI Agent, so this section is about our own plugin. It's a chat panel inside QGIS. It reads the project before it acts, runs the QGIS tools itself and looks at the result, so there's no code to paste and no project to describe.
Given the same three sentences, it got all three right on the first message. On the clip, its log shows it read the districts layer first, extracted the one polygon by name and only then clipped. On the layout, it built the map in Lambert-93, labelled the districts and checked that every item sat inside the page.

It wasn't perfect. It left a working layer ("Schools UTM 32N") in the project after the buffer task, and on the layout it drew the lycées in grey and left the right half of the page mostly empty. But it never handed me a result that looked finished and wasn't.

It sends a description of your project (layer names, fields, CRS, extent) to a service hosted in the EU, never your data files, and one click undoes a whole message. There's a free plan.
Try AI Agent free in QGIS, no card needed
When to use which
Use ChatGPT, Claude or Gemini in a browser tab when you want code you'll keep and read: a script to rerun on many files, a Processing script, an expression. Tell it your QGIS version, layer names, field names and the project CRS, and check the output on the map, not just the console.
Use an agent inside QGIS, such as AI Agent, when you want the result in your project and don't want to become the go-between who pastes, runs and describes what went wrong. That's most one-off tasks: a buffer, a clip, a join, a styled layout. Our guide to AI agents in QGIS compares the options, and QGIS MCP is the route if you already work in Claude Desktop or Cursor.
Some QGIS plugins put ChatGPT in a panel, such as QChatGPT, but it hasn't been updated since July 2023 and it needs your own OpenAI key. The QGIS AI hub lists the tools we'd look at today.
Try AI Agent free in QGIS, no card needed
How we measured this. On 27 September 2026, in QGIS 3.44.7 on macOS, with the Annecy data above (project in EPSG:3857, layers in EPSG:4326). The chatbot was OpenAI's GPT-5.5, reached through OpenAI's Codex command line with a ChatGPT account, with web search and its shell turned off and no access to QGIS. Its system prompt is Codex's, not the ChatGPT app's, so answers in the app may differ. Each script was run in the Python console exactly as returned, except the third layout answer, which I spliced into the second script as asked. A result counted as right only if a separate check script passed and the PDF looked right. One chatbot run was repeated after we fixed a setup problem in our test QGIS unrelated to the code. AI Agent 1.4.1 ran with default settings. Three tasks is a small sample.
Questions people ask
Can ChatGPT automate QGIS?
It can write the PyQGIS code, and you run it in the Python console. In our three-task test, two scripts were right first time and one ran without an error but exported an empty map. ChatGPT can't run anything in QGIS itself, so you paste, run and check. An agent plugin such as AI Agent runs the steps inside QGIS instead.
Can ChatGPT see my QGIS project?
No. It doesn't know your layer names, fields or coordinate system unless you type them in. Scripts written without that information guess, and a wrong guess can produce a wrong result with no error message. Paste your layer list, fields and project CRS into the prompt to get better code.
Is there a ChatGPT plugin for QGIS?
Yes, a few plugins connect QGIS to OpenAI's models with your own API key. QChatGPT is the most downloaded, but it hasn't been updated since July 2023. Newer agent plugins read your project and run the tools themselves. Ours, AI Agent, includes the AI model, so no API key is needed, and it has a free plan.
Why does my ChatGPT PyQGIS script run but show nothing?
The most common cause is a coordinate system mismatch: the script measured something in degrees and used it in a map drawn in metres, or the other way round. Check the project CRS in the bottom right corner of QGIS and tell the chatbot what it is. Reprojecting to a metric CRS before measuring fixes most of these.


