Automated summary
Parses a GWR (Land Surface Temperature) GeoJSON result set and generates a Leaflet map with choropleth styling, rich popups and a legend.
Strengths
- States the expected GWR property schema explicitly (lst_predicted, local_r2, residual, coefficients), removing schema ambiguity.
- Ships a data-driven blue → yellow → red LST colour scale with labelled breakpoints and a legend control.
- Provides a full JavaScript reference implementation: style function, popups, hover highlighting and legend.
- Handles loading from either a local file or the Flask /api/data endpoint.
Limitations
- Map centre, zoom and LST thresholds are tuned to Ho Chi Minh City and must be changed for other regions.
- Assumes Polygon geometries and exact property names; no support for points, lines or renamed fields.
- Does not compute the GWR regression itself — it only visualises an existing output.
Use it to quickly turn a GWR/LST prediction GeoJSON into an interactive Leaflet map for analysis or presentation.
Avoid it if you need to run a GWR, support geometries other than polygons, or build the map with a library other than Leaflet.
Security analysis
SafeThe file is pure documentation plus a Leaflet/GeoJSON reference implementation. It contains no shell commands, no destructive operations, no credential handling, no obfuscated or encoded payloads, and instructs nothing to be exfiltrated. The only meaningful concerns are ordinary web-app ones: HTML-unescaped property interpolation into popups and outbound calls to a public tile server for map imagery, both expected for this kind of GIS front-end.
- •Popup HTML is built with unescaped template interpolation of GeoJSON properties (${p.district}, ${p.lst_predicted}, etc.) bound via bindPopup — stored-XSS risk if the source data is untrusted
- •Runtime fetches external OpenStreetMap tiles from {s}.tile.openstreetmap.org and a relative /api/data endpoint; normal for a Leaflet app but worth noting for offline/privacy contexts
Examples
Build the Leaflet map for hcmc_gwr_output.geojson: colour districts by lst_predicted on a blue→yellow→red scale, add a legend with labelled breakpoints, and bind popups showing local_r2, residual and all three GWR coefficients.Change the LST breakpoints to 31/33/35/37 °C instead of the defaults, keep the getColor helper data-driven, and update the legend so it matches the new ramp.Switch the map to fetch GWR features from the Flask /api/data endpoint instead of a local file, and keep the same popup template and mouseover/mouseout highlight behaviour.name: webgis-agent description: > Parses GeoJSON (including Geographically Weighted Regression outputs) and configures Leaflet map layers with choropleth styling and interactive popups. Specialised for spatial analysis results such as Land Surface Temperature (LST) variations across Ho Chi Minh City.
WebGIS Agent Skill
This skill provides instructions and examples for parsing GeoJSON data — including GWR (Geographically Weighted Regression) outputs — and visualising it on an interactive Leaflet map with:
- Choropleth polygon fills coloured by Predicted LST (blue → red).
- Interactive popups showing all GWR fields per feature.
GWR Data Schema
When the Data_Agent passes a GWR GeoJSON payload, each feature's
properties object is expected to contain the following fields:
| Field | Description | Unit |
|---|---|---|
| district | District / zone label | string |
| lst_predicted | Predicted Land Surface Temperature | °C |
| local_r2 | Local goodness-of-fit (0–1) | dimensionless |
| residual | Observed minus predicted LST | °C |
| coeff_ndvi | Local GWR coefficient for NDVI | — |
| coeff_impervious | Local GWR coefficient for impervious surface | — |
| coeff_water_dist | Local GWR coefficient for distance to water | — |
Note: When you swap in your real GWR output file, make sure it contains these exact property names, or update the popup template below accordingly.
Instructions
Follow these steps when building the WebGIS application for GWR / LST data:
1. Parse and Validate GWR GeoJSON
- Load the GeoJSON file (e.g.,
hcmc_gwr_output.geojson) from disk or via the Flask/api/dataendpoint. - Confirm the
FeatureCollectionhasfeatureswithPolygongeometries. - Extract the full range of
lst_predictedvalues across all features to compute the colour scale domain (min → max) for the choropleth.
2. Build the LST Colour Scale
- Use a blue → yellow → red sequential gradient to encode LST intensity:
- Cool (< 32 °C) →
#313695 - Moderate (≈ 35 °C) →
#ffffbf - Hot (> 38 °C) →
#a50026
- Cool (< 32 °C) →
- Implement a
getColor(lst)helper function using breakpoints derived from the actual data range so the scale is always data-driven.
3. Initialise the Leaflet Map
- Centre the map on Ho Chi Minh City:
[10.76, 106.69], zoom10. - Add an OpenStreetMap base tile layer for geographic context.
4. Add GWR Choropleth Layer
- Use
L.geoJSON()with two options:style: SetfillColorusinggetColor(feature.properties.lst_predicted),fillOpacity: 0.75,weight: 1.5,color: '#fff'.onEachFeature: Bind a rich popup and add hover highlight events (mouseover/mouseoutto lighten/darken the fill).
5. Popup Content Template
Each popup must display all GWR fields in a structured card:
<div class="gwr-popup">
<h3>{district}</h3>
<table>
<tr><td>🌡️ Predicted LST</td><td><b>{lst_predicted} °C</b></td></tr>
<tr><td>📊 Local R²</td><td>{local_r2}</td></tr>
<tr><td>📐 Residual</td><td>{residual} °C</td></tr>
<tr><td>🌿 Coeff NDVI</td><td>{coeff_ndvi}</td></tr>
<tr><td>🏗️ Coeff Impervious</td><td>{coeff_impervious}</td></tr>
<tr><td>💧 Coeff Water Dist.</td><td>{coeff_water_dist}</td></tr>
</table>
</div>
6. Add a Legend
- Render a fixed-position
L.controllegend showing the LST colour ramp with labelled breakpoints so users can interpret the choropleth without hovering.
Full Reference Implementation
// ── Colour scale (blue → yellow → red, data-driven) ──────────────
function getColor(lst) {
return lst > 38 ? '#a50026' :
lst > 36.5 ? '#d73027' :
lst > 35 ? '#f46d43' :
lst > 33.5 ? '#fdae61' :
lst > 32 ? '#ffffbf' :
lst > 30.5 ? '#abd9e9' :
'#313695';
}
// ── Map initialisation (Ho Chi Minh City) ─────────────────────────
const map = L.map('map').setView([10.76, 106.69], 10);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// ── GWR GeoJSON layer ─────────────────────────────────────────────
fetch('/api/data')
.then(r => r.json())
.then(data => {
L.geoJSON(data, {
style: feature => ({
fillColor: getColor(feature.properties.lst_predicted),
fillOpacity: 0.75,
color: '#ffffff',
weight: 1.5
}),
onEachFeature: (feature, layer) => {
const p = feature.properties;
layer.bindPopup(`
<div class="gwr-popup">
<h3>${p.district}</h3>
<table>
<tr><td>🌡️ Predicted LST</td><td><b>${p.lst_predicted} °C</b></td></tr>
<tr><td>📊 Local R²</td><td>${p.local_r2}</td></tr>
<tr><td>📐 Residual</td><td>${p.residual} °C</td></tr>
<tr><td>🌿 Coeff NDVI</td><td>${p.coeff_ndvi}</td></tr>
<tr><td>🏗️ Coeff Impervious</td><td>${p.coeff_impervious}</td></tr>
<tr><td>💧 Coeff Water Dist.</td><td>${p.coeff_water_dist}</td></tr>
</table>
</div>
`);
// Hover highlight
layer.on('mouseover', () => layer.setStyle({ fillOpacity: 0.95, weight: 2.5 }));
layer.on('mouseout', () => layer.setStyle({ fillOpacity: 0.75, weight: 1.5 }));
}
}).addTo(map);
})
.catch(err => console.error('Error fetching GWR data:', err));
// ── Legend control ────────────────────────────────────────────────
const legend = L.control({ position: 'bottomright' });
legend.onAdd = function () {
const div = L.DomUtil.create('div', 'legend');
const grades = [29, 30.5, 32, 33.5, 35, 36.5, 38];
div.innerHTML = '<h4>LST (°C)</h4>';
grades.forEach((g, i) => {
div.innerHTML +=
`<i style="background:${getColor(g + 0.1)}"></i>` +
`${g}${grades[i + 1] ? '–' + grades[i + 1] : '+'}<br>`;
});
return div;
};
legend.addTo(map);
Legend CSS (add to <style>)
.legend { background: white; padding: 10px 14px; border-radius: 6px;
line-height: 1.8; font-size: 13px; box-shadow: 0 1px 5px rgba(0,0,0,.3); }
.legend h4 { margin: 0 0 6px; font-size: 14px; }
.legend i { width: 16px; height: 16px; display: inline-block;
margin-right: 6px; border-radius: 2px; vertical-align: middle; }
.gwr-popup h3 { margin: 0 0 6px; font-size: 14px; color: #333; }
.gwr-popup table { border-collapse: collapse; font-size: 12px; }
.gwr-popup td { padding: 2px 6px; }
.gwr-popup td:first-child { color: #555; }
.gwr-popup td:last-child { font-weight: 500; color: #111; }
Swapping in Your Real GWR File
When your real GWR output is ready, update the DATA_FILE path in
multi_agent.py (inside DataAgent.execute):
# Change this line in DataAgent.execute():
DATA_FILE = r"C:\path\to\your\real_gwr_output.geojson"
The rest of the pipeline requires no further changes as long as the property names match the schema above.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/webgis-agent-for-gwr-mrx3xy77/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/webgis-agent-for-gwr-mrx3xy77' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/webgis-agent-for-gwr-mrx3xy77/download' --output '.skill-downloads/webgis-agent-for-gwr-mrx3xy77/SKILL.md.part' && mv '.skill-downloads/webgis-agent-for-gwr-mrx3xy77/SKILL.md.part' '.skill-downloads/webgis-agent-for-gwr-mrx3xy77/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/webgis-agent-for-gwr-mrx3xy77/SKILL.md' && test -s '.skill-downloads/webgis-agent-for-gwr-mrx3xy77/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/webgis-agent' && cp -R '.skill-downloads/webgis-agent-for-gwr-mrx3xy77' '.claude/skills/webgis-agent'Cursor
test -f '.skill-downloads/webgis-agent-for-gwr-mrx3xy77/SKILL.md' && test -s '.skill-downloads/webgis-agent-for-gwr-mrx3xy77/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/webgis-agent' && cp -R '.skill-downloads/webgis-agent-for-gwr-mrx3xy77' '.cursor/skills/webgis-agent'Codex
test -f '.skill-downloads/webgis-agent-for-gwr-mrx3xy77/SKILL.md' && test -s '.skill-downloads/webgis-agent-for-gwr-mrx3xy77/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/webgis-agent' && cp -R '.skill-downloads/webgis-agent-for-gwr-mrx3xy77' '.agents/skills/webgis-agent'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/webgis-agent-for-gwr-mrx3xy77'openskills read 'webgis-agent-for-gwr-mrx3xy77'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/webgis-agent-for-gwr-mrx3xy77/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
Create Interactive Maps with kepler.gl
Data & AI
Create interactive map visualizations and export standalone HTML using the keplergl Python package. Use to plot geospatial data from DataFrames, GeoJSON, or CSV.
Agent-Driven Parameter Optimization
Data & AI
Guide for optimizing configurable systems with a measurable objective, using bounded trials and evidence-based recommendations.
ICP Visitor Outreach
Data & AI
Identify signed-up users matching the ideal customer profile but stalled, and draft personalized outreach to re-engage them.