Simon Willison handed ChatGPT Work his home address and asked for 5K and 10K running loops. Twenty-seven minutes later, GPT-6 Astra (Max) came back with an interactive map, a GPX file, and GeoJSON, all built from OpenStreetMap data. Willison documented the whole thing, including the part where the system lost its own code.
That second part matters as much as the first. Here’s the full walkthrough, plus the trap to avoid.
Quick Start
What you’ll learn:
- How to get an agentic ChatGPT session to build custom running routes from open map data
- How to inspect what it did
- How to protect yourself from losing that work to context compaction
What you need:
- ChatGPT Work with GPT-6 Astra (Willison used the Max tier)
- Your home address
- A GPX-compatible watch or app if you want to actually run the route
Step 1: Write the prompt
Willison’s exact prompt was short:
“I live at <my address>. Figure out 5K and 10K running routes from me that loop from my house. Use OSM data.”
Why it works: three constraints, no hand-holding. The distance targets give the model a hard spec. “Loop from my house” rules out out-and-back routes. “Use OSM data” points it at a specific, free, well-documented source instead of letting it guess or hallucinate street names.
Step 2: Let it run
The job took 27 minutes. That’s normal for this kind of agentic task, since the model has to geocode, download road data, and compute loops that hit the target distance.
What you get back, according to Willison: an embedded visualization inside the ChatGPT UI, plus downloadable GPX and GeoJSON files. The GPX goes straight onto a Garmin or into Strava. The GeoJSON is for anything else you want to build.
Step 3: Ask how it did it
Willison asked the model to explain its method. The reply: “I used Nominatim to locate the address and Overpass to download local OpenStreetMap roads and trails, then calculated the loops locally.”
Translation for non-mappers. Nominatim turns an address into coordinates. Overpass is the query API for pulling raw OpenStreetMap features (roads, paths, trails) for a bounding box. The loop math happened in Python on the sandbox.
Why bother asking: you want to know the route came from real road data, not a plausible-looking line drawn through someone’s backyard.
Step 4: Ask for the code immediately (this is the warning)
Willison waited too long to request the Python the model ran. By the time he asked, ChatGPT couldn’t produce it. The thread had been compacted, meaning the older context was summarized away and the actual code went with it.
He calls the lack of visibility “an anti-feature,” and he’s right. His proposed fix: any LLM system that compacts should keep the pre-compaction text and expose it through tool calls so the agent can retrieve it later.
Practical rule until that happens: the moment a long agentic task finishes, ask for the code and save it yourself. Don’t admire the output first.
Step 5: Understand the map rendering
The embedded map came from ChatGPT’s visualize skill. The model wrote a file called /workspace/el-granada-5k-share.html and embedded it in the UI.
The structure, per Willison’s copy of the HTML:
- A container div with the route name (“El Granada harbor loop”) and distance (5.1 km)
- Scoped CSS using
var(--foreground)andvar(--background)so it matches the ChatGPT theme - A
<script type="application/json">block holding the full LineString geometry for the route and base map - D3 v7.9.0 loaded from cdn.jsdelivr.net to draw it
This is a clean pattern: data and rendering in one self-contained file, no external API calls at view time.
Step 6: Know the CDN allow-list
If you ask ChatGPT to build visualizations, it can only load scripts from a fixed set of origins: cdnjs.cloudflare.com, esm.sh, cdn.jsdelivr.net, unpkg.com, fonts.googleapis.com, fonts.gstatic.com, and fonts.bunny.net. Anything else gets blocked and, as Willison notes, fails silently. Blank map, no error. Now you know why.
Next steps
- Run the same prompt with extra constraints: “avoid major roads,” “prefer trails,” “finish at a coffee shop.”
- Ask for the Overpass query and Python up front, then rerun it locally. Once you have the code, you own the pipeline and compaction can’t touch it.
- Feed the GeoJSON into your own D3 or Leaflet page and skip the ChatGPT UI entirely.
The bigger takeaway: agentic tools are getting good enough to do 30 minutes of real GIS work from one sentence. The transparency layer hasn’t caught up. Willison’s full post has the complete HTML if you want to study the rendering pattern.