A map-based application for exploring California's protected lands with an integrated LLM chatbot for natural language queries and analysis.
This application provides an interactive map interface for exploring protected areas in California, powered by STAC (SpatioTemporal Asset Catalog) for dynamic layer configuration and DuckDB for analytical queries. Users can interact with the map through natural language using the integrated AI chatbot.
- Map Visualization: MapLibre GL JS renders vector tiles (PMTiles) and raster tiles (COG via TiTiler) directly from S3
- Dynamic Configuration: Layers are configured at runtime by fetching STAC catalog metadata
- AI Chatbot: LLM-powered interface using Model Context Protocol (MCP) tools for map control and data analysis
- MCP Data Server: DuckDB-powered analytical backend that queries H3-indexed Parquet datasets
- STAC Catalog: Metadata-driven layer discovery and configuration
User Input → Chatbot (chat.js) → MCP Tools → MapController → MapLibre GL JS
↓
MCP Data Server (DuckDB queries on H3 Parquet)
↓
STAC Catalog (layer metadata)
Layers are configured in app/layers-input.json. This file specifies which STAC collections to load:
{
"catalog": "https://s3-west.nrp-nautilus.io/public-data/stac/catalog.json",
"layers": [
{
"collection_id": "cpad-2025b",
"asset_id": "cpad-units-pmtiles",
"layer_key": "cpad",
"display_name": "California Protected Areas"
}
]
}On startup, the application:
- Fetches STAC collections
- Extracts layer properties from
table:columns - Generates tool definitions for the LLM
- Registers layers with the map
See scripts/README.md for configuration details.
- Python 3.11+ (for local HTTP server)
- Access to MCP data server (for analytical queries)
# Serve the app directory
python -m http.server 8000 --directory appOpen http://localhost:8000 in your browser.
app/
├── config-loader.js # Runtime STAC metadata fetching
├── layer-registry.js # Layer metadata management
├── map.js # Map initialization & MapController
├── chat.js # LLM chatbot integration
├── mcp-tools.js # MCP tool definitions
├── system-prompt.md # LLM system prompt
└── layers-input.json # Layer configuration
scripts/
├── README.md # Configuration guide
└── layers-input-example.json
k8s/
└── README.md # Deployment guide
The application is deployed on Kubernetes. Changes are not automatically deployed.
# Trigger rollout after pushing changes
kubectl rollout restart deployment/ca-protected-lands -n boettiger-labSee k8s/README.md for detailed deployment instructions.
- CPAD: CAL FIRE / GreenInfo Network
- STAC Catalog:
https://s3-west.nrp-nautilus.io/public-data/stac/catalog.json - Storage: S3-compatible object storage hosted at
s3-west.nrp-nautilus.io