A University of Arizona · BIO5 Institute
PH&AI Summer School · 2nd Edition
Day 2 · AI Fluency Track · 10:30 AM

Geospatial
Analysis,
AI-Powered.

Tyson Swetnam, PhD
Associate Professor · BIO5 Institute
Grand Challenges Research Building
Tucson, AZ · June 9, 2026
APH&AI · AI Fluency
02 / Where We Are
Day 2 · Tuesday, June 9

Data & Digital Health — and where geospatial fits in.

09:00
AI in Patient Care & Digital Health Cohorts
All Tracks · Slepian
10:30 · YOU ARE HERE
Geospatial Analysis, AI-Powered
AI Fluency · Swetnam · 90 min lab
13:00
AI Maker Space — Data Projects
All Tracks · Florez-Arango
15:30
Fireside Chat — Gaps in AI & Health Training
All Tracks · Leal Neto & Weinstein
APH&AI · AI Fluency
03 / Outcome
In 90 Minutes

A scrolling Leaflet story-map of the 1850 London cholera outbreak.

Served locally at http://localhost:51234. By minute 60 you should see the Broad Street pump and the death-density choropleth on screen.

  • 01
    Open data in, interactive map out — no GIS desktop required.
  • 02
    An agent did the typing. You did the directing.
  • 03
    A workflow you can re-aim at any public health dataset.
[ screenshot ]
snow_storymap.html
broad-street pump + choropleth
APH&AI · AI Fluency
Part 01 · Foundations
Part 01

Foundations.

The vocabulary, the surfaces, and the loop — so we share a language before we share a keyboard.

APH&AI · AI Fluency
05 / Landscape
The 2026 Picture

The frontier moved from chat windows to agents with hands.

2022 — 2024

Chat.

You type, it replies. The model sees only your message. Useful, but you copy-paste everything.

2024 — 2025

Tools.

The model gains a code interpreter, file uploads, web search. Still a single turn, single surface.

2025 — 2026

Agents.

The model reads your filesystem, runs commands, edits code, opens a browser — and reports back.

Today's lab assumes the third column. If you are still living in the first, the gap is mostly muscle memory — not capability.

APH&AI · AI Fluency
06 / Vocabulary
Vibe Coding

Vibe
Coding.

You describe the feel of what you want — the shape, the behavior, the audience — and let the agent produce, run, and refine the code.

Coined by Andrej Karpathy, 2025. Useful for prototypes, demos, internal tools, and any disposable code where shipping fast beats writing it yourself.

What it is good for

First drafts. UI iteration. Throwaway scripts. "Can we visualize this?" moments. Today's storymap.

What it is NOT

A substitute for code review on anything that handles PHI, runs in production, or makes clinical decisions.

APH&AI · AI Fluency
07 / Vocabulary
Agentic Engineering

Agentic
Engineering.

The discipline of building software through an agent: setting up context files, naming reusable skills, version-controlling prompts, and treating the model as a teammate with a job description.

Context
AGENTS.md / CLAUDE.md — stack, conventions, guardrails.
Skills
Skills.md — named, reusable playbooks the agent can invoke.
Memory
Memory.md — persistent project facts that survive sessions.
Logs
prompts/NNN_*.md — every prompt versioned alongside the code.
APH&AI · AI Fluency
08 / Tooling
Pick One From Each Row

Three surfaces, the same agent underneath.

Surface Best For Examples
Desktop LLM apps Chat + artifacts Claude Desktop · ChatGPT (Codex) · Perplexity Comet
CLI agents Filesystem access Claude Code · Codex CLI · Gemini CLI
AI-native IDEs In-editor flow VS Code (+ Copilot) · Cursor · Antigravity (Google)

The prompts in today's lab are platform-neutral. Use whichever surface you already know — the workflow transfers.

APH&AI · AI Fluency
Part 02 · AI for Geospatial Work
Part 02

AI, meet
the GIS stack.

Where agents already plug in — and where you, the analyst, still have to do the thinking.

APH&AI · AI Fluency
10 / Map of the Map-Maker's Toolkit
A Layered View

Four layers an agent can write code against today.

Layer 01 · Scripting

Python & OSGeo CLI.

geopandas, rasterio, shapely · gdal, ogr2ogr, pyproj. The agent writes, runs, and debugs in your shell.

Layer 02 · Desktop GIS

ArcGIS & QGIS.

Reachable through Model Context Protocol servers (QGISMCP) — the agent drives the GUI for layer styling, processing, atlases.

Layer 03 · Cloud

Google Earth Engine.

Petabyte-scale satellite catalog, JS & Python APIs. Agents are excellent at boilerplate ingestion and reducer chains.

Layer 04 · Web

Leaflet & MapLibre GL.

Plain HTML / CSS / JS. The fastest path from "I have a GeoJSON" to "share this link." Today's deliverable.

APH&AI · AI Fluency
11 / Layer 01 · Scripting
Layer 01 · Scripting

Python and OSGeo, written by the agent.

The CLI tools the geo community has used for thirty years are now the agent's preferred plumbing. They are well-documented, deterministic, and easy to verify.

Your job shifts from man gdalwarp to specifying inputs, outputs, and expected CRS.

# Prompt: reproject every shapefile in data/raw/
# to EPSG:4326 and save as GeoJSON in data/clean/.

for f in data/raw/*.shp; do
  name=$(basename "$f" .shp)
  ogr2ogr \
    -f "GeoJSON" \
    -t_srs EPSG:4326 \
    data/clean/"$name".geojson \
    "$f"
done

# Verify with one line of geopandas:
python -c \
  "import geopandas as gpd;
print(gpd.read_file('data/clean/cases.geojson').crs)"
APH&AI · AI Fluency
12 / Layer 02 · Desktop GIS
Layer 02 · Desktop GIS

Your QGIS canvas, on the other end of an MCP server.

Model Context Protocol is the standard plug for "tool" servers — and the geo community already shipped one for QGIS.

QGISMCP
Add layers, style, run Processing toolbox, export atlas pages.
ArcGIS Pro
AI assistants via the ArcGIS Python Notebook + arcpy.
Esri Maps SDK
Agent-friendly REST endpoints for hosted feature services.
[ screenshot ]
QGIS canvas + Claude side-panel
driving layer styling
APH&AI · AI Fluency
13 / Layer 03 · Cloud
Layer 03 · Cloud

Earth Engine, scripted on tap.

The petabyte-scale public satellite catalog. The agent is excellent at generating boilerplate: collection filters, cloud masks, reducers, exports.

What you still own: choosing the right collection, defining the temporal window, sanity-checking the output against ground truth.

# Prompt: monthly NDVI for Pima County,
# 2024, Sentinel-2 Surface Reflectance.

import ee
ee.Initialize()

aoi = ee.FeatureCollection(
    "TIGER/2018/Counties") \
  .filter(ee.Filter.eq(
      "NAME", "Pima"))

s2 = (ee.ImageCollection("COPERNICUS/S2_SR")
        .filterBounds(aoi)
        .filterDate("2024-01-01",
                    "2025-01-01")
        .map(ndvi))
APH&AI · AI Fluency
14 / Layer 04 · Web
Layer 04 · Web Mapping

From .geojson to a shareable link, in one prompt.

Leaflet

The pragmatic default.

Tile-based, tiny API, every public health JS map you've seen in the wild. Today's lab uses it.

~42 KB · works everywhere

MapLibre GL

The vector successor.

Open fork of Mapbox GL. WebGL-rendered vector tiles, smooth interaction, full styling spec. Reach for it when Leaflet hits a wall.

vector tiles · 3D terrain · MIT

Both are plain HTML / CSS / JS. No bundler, no framework — which means the agent's output is a single file you can read, edit, and host on any static server.

APH&AI · AI Fluency
Part 03 · The Lab
Part 03

The lab.

Four steps. Ninety minutes. One scrolling map of a 175-year-old outbreak — built end-to-end by directing an agent.

APH&AI · AI Fluency
16 / Why This Dataset
Why This Dataset

John Snow, Broad Street, 1854.

The founding dataset of modern epidemiology. Geocoded cholera deaths, pump locations, and the spatial argument that broke the miasma theory.

Small enough to load in a browser. Famous enough that every public health professional in this room has seen the map — but probably never built one themselves.

geodacenter.github.io/data-and-lab/data/snow.zip

[ image ]
John Snow's original
1854 cholera map

Public domain · Wellcome Collection

APH&AI · AI Fluency
17 / Workflow
The Loop

Four steps. Each one a single, copy-able prompt.

Step 0

Context.

Drop in the three .md files that tell the agent how this workspace operates.

Step 1

Scaffold.

Folder tree, dataset download, unzip, sort GeoJSONs into map/.

Step 2

Build.

A scrolling Leaflet storymap, choropleth on deaths, served on a local port.

Step 3 — 4

Iterate.

Critique. Approve. Then a one-shot reveal: the same workflow, compressed to one prompt.

We will walk steps 0 — 3 together. Step 4 is yours to try in a fresh chat.

APH&AI · AI Fluency
18 / Step 0
Step 00 — Set up context

Three markdown files. Same content. Whichever filename your agent expects.

CLAUDE.md / AGENTS.md

Workspace rules.

Stack (Python 3.10, Leaflet, no bundlers). Conventions (code/, data/, map/). Guardrails (confirm destructive actions, never fabricate sample data).

Skills.md

Reusable playbooks.

/scaffold, /fetch-snow, /storymap, /critique — named macros the agent can invoke.

Memory.md

Project facts.

Field names (deaths, deathdens). Labels on polygons, not points. PI's stylistic preferences.

This is the moment you stop treating the agent as a chatbot and start treating it as a teammate with a contract.

APH&AI · AI Fluency
19 / Step 1
Step 01 — Scaffold & fetch

Folder tree, dataset, sort. One prompt.

TASK
1. Create folders:
   data/, map/, code/, prompts/
2. Download
   geodacenter.github.io/data-and-lab
     /data/snow.zip
   into data/
3. Unzip in place, delete the .zip
4. Move every *.geojson from the
   unzipped folder into map/.
   Ignore __MACOSX, non-geojson.
5. Save script as code/setup.py.
   Confirm each step.
What to watch

The agent should announce each step and stop on the first failure. If it silently "succeeds" with no files in map/, your Filesystem MCP isn't running.

If the download fails

Grab the zip via your browser, drop it into data/, and re-run from step 3.

APH&AI · AI Fluency
20 / Step 2
Step 02 — Build the storymap

The centerpiece prompt. Layout, data styling, serve.

TASK
Create map/snow_storymap.html using Leaflet
(HTML/CSS/JS).

Layout:
  - Scrolly story-map
  - Layers appear on scroll, fade past
  - Short caption per layer

Data styling:
  - Choropleth on 'deaths', 'deathdens'
  - Labels on polygons only (NOT points)

Serve:
  - python -m http.server 51234
[ screenshot ]
Expected output
scrolly map at :51234
If a field is missing

If deathdens isn't in the GeoJSON, ask the agent to compute it from deaths divided by polygon area.

APH&AI · AI Fluency
21 / Step 3
Step 03 — Iterate aesthetics

Critique. Approve. Apply. Time-box: 10 minutes.

TASK
Open map/snow_storymap.html.
Critique colors, fonts, and scroll feel.
Propose up to 3 improvements.
Wait for my approval, then apply
them in place.
Wait
The agent should pause after proposing. If it edits immediately, your guardrails aren't being read.
Approve
Pick the changes you want. Reject the rest. Be specific.
Apply
"In place" means the same file path. No new variant files unless you ask.

This is the most cuttable step if we're running short. The point is just to feel the iteration loop once.

APH&AI · AI Fluency
22 / Step 4
Step 04 — One-shot reveal

Now the same workflow, in a single prompt, in a fresh chat.

We just walked four steps. The pedagogical point of step 4 is to paste it all as one prompt and watch the agent execute end-to-end.

Yes, the prompt has typos. The numbering jumps. "Chloropleth" is misspelled. Both are preserved on purpose — modern agents handle messy real-world prompts surprisingly well.

Compare this output to the artifact you built across Steps 1–3. Where did the agent do better with all-at-once context? Where did it cut corners?

The compressed prompt

"Build a scrolling story telling map… using Leaflet, HTML, CSS, and JavaScript…

• layers appear on scroll
• chloropleth on 'deaths' and
  'deathdens'
• death count labels on polygons,
  not points"

APH&AI · AI Fluency
23 / Guardrails
In Public Health Work, Especially

Three failure modes worth memorizing.

01 · Fabrication

Made-up data.

Agents will invent plausible-looking sample data when a real fetch fails. Your guardrail: never fabricate — surface failures and stop.

02 · Silent success

"It worked" — but didn't.

The script ran. No files appeared. Check the Filesystem MCP is actually connected, and ask the agent to ls map/ after every step.

03 · PHI in prompts

What goes in the chat.

Treat the prompt window like a public Slack channel. Strip identifiers before pasting. Use synthetic or geocoded-out datasets for development.

APH&AI · AI Fluency
24 / Optional Homework
Take It Further

Four directions, pick whichever interests you.

Sharpen your prompts

Writing Prompts · Vibe Coding.

Two deeper reads on the iterate-with-an-agent loop you just used in Step 3.

Bring documents in

Text Mining · RAG.

Replace the cut PDF-summary step. Extend the storymap with retrieval over the cholera primary sources.

Automate the workflow

Claude Code Workflow · Agentic AI.

Prompt logging, session automation, the agent loop framed end-to-end.

Ship & extend

QGISMCP · GitHub Pages.

Rebuild the layers in QGIS via MCP. Deploy the map as a public static site.

APH&AI · AI Fluency
25 / Resources
Bookmarks

Everything from today, in one place.

This Lab
tyson-swetnam.github.io/intro-gpt/tutorials/publichealth/gis/
Full Workshop
tyson-swetnam.github.io/intro-gpt/
Dataset
geodacenter.github.io/data-and-lab/data/snow.zip
QGIS MCP
github.com/jjsantos01/qgis_mcp
PH&AI 2026
ph-ai.me
APH&AI · AI Fluency
End · Q&A
Now, the Maker Space

Questions?

Bring your storymap to the 1:00 PM AI Maker Space. We'll re-aim the workflow at a dataset of your choosing.

Tyson Swetnam, PhD
tswetnam@arizona.edu · @tswetnam
BIO5 Institute
University of Arizona