kendrick-oppong/geoskills/geospatial-ml
Claude Code and agent skill by kendrick-oppong/geoskills
- community
Checking that the SKILL.md file is still in the repository.
Use when applying machine learning to geospatial data — spatial feature engineering with geopandas/momepy/osmnx/pysal, raster/imagery feature extraction with rasterio/torchgeo, spatial cross-validation, and avoiding autocorrelation-driven data leakage.
Install
npx vskill@latest install kendrick-oppong/geoskills/geospatial-mlSKILL.md
The same SKILL.md was published earlier as kendrick-oppong/geoskills/geospatial-ml.
Geospatial Machine Learning
When to use this skill
- Building a classification/detection model over satellite imagery (e.g. land cover, mining/deforestation detection)
- Any ML task with spatially-structured features (points, polygons, raster stacks)
- Model validation looks "too good" and spatial autocorrelation is a plausible cause
Core concepts
Spatial feature engineering toolkits:
| Tool | Use for | |
|---|---|---|
geopandas | Vector data manipulation, joins, spatial predicates as a feature-engineering base layer | |
momepy | Urban morphology metrics (building/block shape descriptors) as ML features | |
osmnx | Street network graph features (connectivity, centrality) from OpenStreetMap | |
pysal | Spatial statistics: Moran's I, spatial regression, spatial weights matrices | |
rasterio / rioxarray | Raster band extraction and windowed reads for feature stacks | |
torchgeo | PyTorch datasets/models pre-built for common geospatial imagery tasks (segmentation, classification) |
The central pitfall this skill exists to prevent: spatial autocorrelation → data leakage. Nearby locations tend to have correlated feature values and labels (Tobler's First Law: "everything is related, but near things are more related"). A random train/test split scattered across a spatially continuous study area lets the model implicitly "see" test locations' neighbors during training, producing inflated validation metrics that don't hold up on genuinely new geography.
Checklist
- [ ] Spatial cross-validation used, not random k-fold — split by spatial blocks/clusters (e.g.,
scikit-learn'sGroupKFoldkeyed on a spatial cluster ID, or dedicated spatial CV tools) so train and test sets are geographically separated, not just record-separated - [ ] Buffer zone between train/test regions considered for strongly autocorrelated phenomena, so near-boundary leakage doesn't creep in even with block splitting
- [ ] Feature scaling/normalization is regionally aware if the model needs to generalize across regions with different baseline conditions (e.g., vegetation indices vary by biome — consider region-relative normalization rather than a single global scale)
- [ ] Class imbalance addressed explicitly for rare-event detection tasks (e.g., illegal mining sites are a tiny fraction of total area) — accuracy alone is a misleading metric; use precision/recall/F1 or PR-AUC appropriate to the imbalance
- [ ] Ground truth quality checked — label noise from imprecise geometry/manual annotation (e.g., an "old" mining site polygon that no longer matches current imagery) undermines both training and evaluation
- [ ] Model evaluated on genuinely held-out geography (a different region entirely, not just a spatially-blocked subset of the same region) before claiming the model generalizes beyond its training area
- [ ] Temporal leakage checked separately from spatial leakage for time-series-style geospatial tasks (e.g., don't let future imagery inform features used to predict an earlier time period)
Common pitfalls
- Random train/test split on spatially continuous data: the single most common and consequential mistake in applied geospatial ML — inflates validation performance and produces models that underperform badly on new geography in production.
- Reporting only overall accuracy on a rare-event detection task: a model that always predicts "no mining activity" can still show high accuracy if positive cases are a small fraction of the dataset — use precision/recall or PR-AUC instead.
- Normalizing features globally when the phenomenon is regionally variable: e.g., a single NDVI threshold applied across biomes with very different baseline vegetation levels.
- Treating manually-digitized labels as noise-free ground truth: label geometry precision and label date-accuracy both need explicit QA before trusting model evaluation against them.
- Testing only on held-out samples from the same spatial region as training data: doesn't demonstrate the model generalizes to a genuinely new area — a common overclaim in geospatial ML writeups.
Reference snippets
Related skills
remote-sensing-imagery-processing— producing the imagery-derived features feeding these modelsspatial-indexing-strategy— H3/grid schemes useful for defining spatial CV blocks
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/geospatial-ml/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kendrick-oppong/geoskills/geospatial-ml)