Agent skill

GeoPandas Spatial Analysis

by davila7 in davila7/claude-code-templates

Handles vector geospatial data in Python with GeoPandas: reading shapefiles, GeoJSON and GeoPackage, reprojecting, spatial joins, overlays, clipping and maps.

MITAuto-check passedData & Analytics

Install GeoPandas Spatial Analysis

skills CLI
$ npx skills add davila7/claude-code-templates --skill geopandas -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davila7/claude-code-templates geopandas --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/scientific/geopandas .claude/skills/geopandas && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
geopandas
GitHub stars
33k
Used in
10 other repos
Token cost
~1.8k tokens
SKILL.md length
320 words
Files
7 (incl. references)
Skills in repo
479
Repo updated
First seen
Licence
MIT

At a glance

Handles vector geospatial data in Python with GeoPandas: reading shapefiles, GeoJSON and GeoPackage, reprojecting, spatial joins, overlays, clipping and maps.

  • Works in 6 steps: Use spatial indexing: GeoPandas creates… → Filter during read: Use bbox, mask, or… → Use Arrow for I/O: Add use_arrow=True… → …
  • Reprojecting a dataset to another coordinate reference system
  • SKILL.md covers Installation, Quick Start, Core Concepts and Common Operations, plus 4 more sections
  • Calls uv

What it does

GeoPandas extends pandas with geometry types, so the agent can treat spatial data as a table with a geometry column. The skill covers the two data structures, GeoSeries and GeoDataFrame, and reading and writing Shapefile, GeoJSON, GeoPackage, PostGIS and Parquet, including bounding-box filtering when a file is read.

It tells the agent to check and manage the coordinate reference system before any spatial operation, then walks through buffering, simplifying, centroids, convex hulls, spatial joins, overlays, dissolving and clipping. Maps come from the built-in plot call for choropleths or from folium for interactive output. Six reference files hold the detail for these areas, and installation is a single `uv pip install geopandas`.

When your agent uses it

  • Reprojecting a dataset to another coordinate reference system
  • Joining points to polygons with a spatial join
  • Clipping or dissolving boundaries before calculating areas
  • Converting between shapefile, GeoJSON and GeoPackage formats

Example prompts

  • “Reproject counties.shp to a metric CRS and calculate each county's area.”
  • “Spatial-join the stores.geojson points to the neighborhoods polygons and count stores per neighborhood.”
  • “Make a choropleth of population by district from districts.gpkg and save it as a PNG.”

Requirements

  • Python with `geopandas`
  • `folium` for interactive maps (optional)

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Use spatial indexing: GeoPandas creates spatial indexes automatically for most operations
  2. Filter during read: Use bbox, mask, or where parameters to load only needed data
  3. Use Arrow for I/O: Add use_arrow=True for 2-4x faster reading/writing
  4. Simplify geometries: Use .simplify() to reduce complexity when precision isn't critical
  5. Batch operations: Vectorized operations are much faster than iterating rows
  6. Use appropriate CRS: Projected CRS for area/distance, geographic for visualization

What it can do on your machine

Read from SKILL.md and the folder at commit 79182c5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

GeoPandas Spatial Analysis loads about 1.8k tokens when it runs, and up to ~7.9k if it reads all its reference files. Until then it costs about 169 tokens; SKILL.md has 320 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~169
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from davila7/claude-code-templates at commit 79182c5, republished under its MIT licence (© davila7). 320 words, ~1,762 tokens.

Download SKILL.mdSave it as .claude/skills/geopandas/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
geopandas
description
Python library for working with geospatial vector data including shapefiles, GeoJSON, and GeoPackage files. Use when working with geographic data for spatial analysis, geometric operations, coordinate transformations, spatial joins, overlay operations, choropleth mapping, or any task involving reading/writing/analyzing vector geographic data. Supports PostGIS databases, interactive maps, and integration with matplotlib/folium/cartopy. Use for tasks like buffer analysis, spatial joins between datasets, dissolving boundaries, clipping data, calculating areas/distances, reprojecting coordinate systems, creating maps, or converting between spatial file formats.

GeoPandas

GeoPandas extends pandas to enable spatial operations on geometric types. It combines the capabilities of pandas and shapely for geospatial data analysis.

Installation

bash
uv pip install geopandas
Optional Dependencies
bash
# For interactive maps
uv pip install folium

# For classification schemes in mapping
uv pip install mapclassify

# For faster I/O operations (2-4x speedup)
uv pip install pyarrow

# For PostGIS database support
uv pip install psycopg2
uv pip install geoalchemy2

# For basemaps
uv pip install contextily

# For cartographic projections
uv pip install cartopy

Quick Start

python
import geopandas as gpd

# Read spatial data
gdf = gpd.read_file("data.geojson")

# Basic exploration
print(gdf.head())
print(gdf.crs)
print(gdf.geometry.geom_type)

# Simple plot
gdf.plot()

# Reproject to different CRS
gdf_projected = gdf.to_crs("EPSG:3857")

# Calculate area (use projected CRS for accuracy)
gdf_projected['area'] = gdf_projected.geometry.area

# Save to file
gdf.to_file("output.gpkg")

Core Concepts

Data Structures
  • GeoSeries: Vector of geometries with spatial operations
  • GeoDataFrame: Tabular data structure with geometry column

See data-structures.md for details.

Reading and Writing Data

GeoPandas reads/writes multiple formats: Shapefile, GeoJSON, GeoPackage, PostGIS, Parquet.

python
# Read with filtering
gdf = gpd.read_file("data.gpkg", bbox=(xmin, ymin, xmax, ymax))

# Write with Arrow acceleration
gdf.to_file("output.gpkg", use_arrow=True)

See data-io.md for comprehensive I/O operations.

Coordinate Reference Systems

Always check and manage CRS for accurate spatial operations:

python
# Check CRS
print(gdf.crs)

# Reproject (transforms coordinates)
gdf_projected = gdf.to_crs("EPSG:3857")

# Set CRS (only when metadata missing)
gdf = gdf.set_crs("EPSG:4326")

See crs-management.md for CRS operations.

Common Operations

Geometric Operations

Buffer, simplify, centroid, convex hull, affine transformations:

python
# Buffer by 10 units
buffered = gdf.geometry.buffer(10)

# Simplify with tolerance
simplified = gdf.geometry.simplify(tolerance=5, preserve_topology=True)

# Get centroids
centroids = gdf.geometry.centroid

See geometric-operations.md for all operations.

Spatial Analysis

Spatial joins, overlay operations, dissolve:

python
# Spatial join (intersects)
joined = gpd.sjoin(gdf1, gdf2, predicate='intersects')

# Nearest neighbor join
nearest = gpd.sjoin_nearest(gdf1, gdf2, max_distance=1000)

# Overlay intersection
intersection = gpd.overlay(gdf1, gdf2, how='intersection')

# Dissolve by attribute
dissolved = gdf.dissolve(by='region', aggfunc='sum')

See spatial-analysis.md for analysis operations.

Visualization

Create static and interactive maps:

python
# Choropleth map
gdf.plot(column='population', cmap='YlOrRd', legend=True)

# Interactive map
gdf.explore(column='population', legend=True).save('map.html')

# Multi-layer map
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
gdf1.plot(ax=ax, color='blue')
gdf2.plot(ax=ax, color='red')

See visualization.md for mapping techniques.

Detailed Documentation

Common Workflows

Load, Transform, Analyze, Export
python
# 1. Load data
gdf = gpd.read_file("data.shp")

# 2. Check and transform CRS
print(gdf.crs)
gdf = gdf.to_crs("EPSG:3857")

# 3. Perform analysis
gdf['area'] = gdf.geometry.area
buffered = gdf.copy()
buffered['geometry'] = gdf.geometry.buffer(100)

# 4. Export results
gdf.to_file("results.gpkg", layer='original')
buffered.to_file("results.gpkg", layer='buffered')
Spatial Join and Aggregate
python
# Join points to polygons
points_in_polygons = gpd.sjoin(points_gdf, polygons_gdf, predicate='within')

# Aggregate by polygon
aggregated = points_in_polygons.groupby('index_right').agg({
    'value': 'sum',
    'count': 'size'
})

# Merge back to polygons
result = polygons_gdf.merge(aggregated, left_index=True, right_index=True)
Multi-Source Data Integration
python
# Read from different sources
roads = gpd.read_file("roads.shp")
buildings = gpd.read_file("buildings.geojson")
parcels = gpd.read_postgis("SELECT * FROM parcels", con=engine, geom_col='geom')

# Ensure matching CRS
buildings = buildings.to_crs(roads.crs)
parcels = parcels.to_crs(roads.crs)

# Perform spatial operations
buildings_near_roads = buildings[buildings.geometry.distance(roads.union_all()) < 50]

Performance Tips

  1. Use spatial indexing: GeoPandas creates spatial indexes automatically for most operations
  2. Filter during read: Use bbox, mask, or where parameters to load only needed data
  3. Use Arrow for I/O: Add use_arrow=True for 2-4x faster reading/writing
  4. Simplify geometries: Use .simplify() to reduce complexity when precision isn't critical
  5. Batch operations: Vectorized operations are much faster than iterating rows
  6. Use appropriate CRS: Projected CRS for area/distance, geographic for visualization

Best Practices

  1. Always check CRS before spatial operations
  2. Use projected CRS for area and distance calculations
  3. Match CRS before spatial joins or overlays
  4. Validate geometries with .is_valid before operations
  5. Use .copy() when modifying geometry columns to avoid side effects
  6. Preserve topology when simplifying for analysis
  7. Use GeoPackage format for modern workflows (better than Shapefile)
  8. Set max_distance in sjoin_nearest for better performance

© davila7, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in cli-tool/components/skills/scientific/geopandas of davila7/claude-code-templates.

  • SKILL.md
  • references/crs-management.md
  • references/data-io.md
  • references/data-structures.md
  • references/geometric-operations.md
  • references/spatial-analysis.md
  • references/visualization.md

Open the folder on GitHubat commit 79182c5

Used in 10 other repositories

We found 12 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 10 other GitHub owners. This page covers the copy in davila7/claude-code-templates, which our catalogue first saw on October 7, 2026.

Compare with similar skills

GeoPandas Spatial Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

GeoPandas Spatial Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
GeoPandas Spatial Analysis this skilldavila7/claude-code-templates33k10 repos~1.8kAutomated safety check: PassMIT
Python Executorcortega26/chile-hub1132 repos~1.5kAutomated safety check: PassMIT
Analytics Data AnalysisMindrally/skills271—~1.6kAutomated safety check: PassApache-2.0
Pandas ProJeffallan/claude-skills12k1 repos~1.5kAutomated safety check: PassMIT
Statistical Data Analysislingzhi227/agent-research-skills390—~886Automated safety check: PassNone
Release Evidence WorkflowAli-Marandi/ClimateDataAnalyzer107—~1.6kAutomated safety check: PassMIT

Similar skills

  • Python Executor

    cortega26/chile-hub

    Execute Python code in a safe sandboxed environment via [inference.sh](https://inference.sh).

    113 GitHub starsUsed in 2 repos~1.5k tokens
    Data & AnalyticsAuto-check passed
  • Analytics Data Analysis

    Mindrally/skills

    Best practices for analytics, data analysis, and visualization using Python, pandas, matplotlib, seaborn, and Jupyter notebooks.

    271 GitHub stars~1.6k tokensUpdated 2 days ago
    Data & AnalyticsAuto-check passed
  • Pandas Pro

    Jeffallan/claude-skills

    Handles pandas DataFrame work: cleaning, merging, groupby aggregation, pivots, time-series resampling and memory tuning, with checks on dtypes, shapes and nulls.

    12k GitHub starsUsed in 1 repo~1.5k tokens
    Data & AnalyticsAuto-check passed
  • Statistical Data Analysis

    lingzhi227/agent-research-skills

    Writes statistical analysis code for experimental data, runs it through a four-round review, and reports effect sizes, p-values and confidence intervals.

    390 GitHub stars~886 tokensUpdated 7 mo ago
    Data & AnalyticsAuto-check passed
  • Release Evidence Workflow

    Ali-Marandi/ClimateDataAnalyzer

    Build an auditable release-evidence workflow for a desktop or packaged application.

    107 GitHub stars~1.6k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed
  • Runs exploratory data analysis on tabular data after you confirm each column's measurement level, then writes CSV tables and a narrative summary.

    108 GitHub stars~1.1k tokensUpdated 17 days ago
    Data & AnalyticsAuto-check passed

More from davila7/claude-code-templates

All 479 skills in this repo
  • Perplexity Web Search

    davila7/claude-code-templates

    Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.

    33k GitHub starsUsed in 11 repos~3.5k tokens
    Auto-check: notes
  • Neuropixels Data Analysis

    davila7/claude-code-templates

    Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.

    33k GitHub starsUsed in 9 repos~2.8k tokens
    Auto-check passed
  • Scientific Venue Templates

    davila7/claude-code-templates

    Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.

    33k GitHub starsUsed in 9 repos~5.1k tokens
    Auto-check: notes
  • Brand Voice Content Creator

    davila7/claude-code-templates

    Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.

    33k GitHub starsUsed in 3 repos~1.9k tokens
    Auto-check passed
  • CAPA Officer

    davila7/claude-code-templates

    Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.

    33k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Fda Consultant Specialist

    davila7/claude-code-templates

    Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.

    33k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed

Questions about GeoPandas Spatial Analysis

What does GeoPandas Spatial Analysis do?

Handles vector geospatial data in Python with GeoPandas: reading shapefiles, GeoJSON and GeoPackage, reprojecting, spatial joins, overlays, clipping and maps. GeoPandas extends pandas with geometry types, so the agent can treat spatial data as a table with a geometry column. The skill covers the two data structures, GeoSeries and GeoDataFrame, and reading and writing Shapefile, GeoJSON, GeoPackage, PostGIS and Parquet, including bounding-box filtering when a file is read.

When should I use GeoPandas Spatial Analysis?

GeoPandas Spatial Analysis fits situations like: reprojecting a dataset to another coordinate reference system; joining points to polygons with a spatial join; clipping or dissolving boundaries before calculating areas; converting between shapefile, GeoJSON and GeoPackage formats.

How do I install GeoPandas Spatial Analysis in Claude Code?

Run `npx skills add davila7/claude-code-templates --skill geopandas -a claude-code`. Or copy the skill folder (cli-tool/components/skills/scientific/geopandas in davila7/claude-code-templates) into .claude/skills/geopandas in your project. Claude Code loads it when a task matches its description.

How do I install GeoPandas Spatial Analysis in Codex?

Run `npx skills add davila7/claude-code-templates --skill geopandas -a codex`. Or copy the skill folder (cli-tool/components/skills/scientific/geopandas in davila7/claude-code-templates) into .agents/skills/geopandas in your project. Codex loads it when a task matches its description.

Can I use GeoPandas Spatial Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davila7/claude-code-templates --skill geopandas -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/geopandas, .gemini/skills/geopandas, .github/skills/geopandas and .opencode/skills/geopandas in your project.

What does GeoPandas Spatial Analysis need to run?

Going by SKILL.md and its folder, GeoPandas Spatial Analysis needs the command-line tools its instructions call (uv). Our summary lists: Python with `geopandas`; `folium` for interactive maps (optional).

Does GeoPandas Spatial Analysis access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is GeoPandas Spatial Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does GeoPandas Spatial Analysis use?

GeoPandas Spatial Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does GeoPandas Spatial Analysis use?

About 1.8k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.1k tokens, read only when the agent opens those files.

What are the alternatives to GeoPandas Spatial Analysis?

Skills that share tags, products or a category with GeoPandas Spatial Analysis: Python Executor (cortega26/chile-hub, 113 stars), Analytics Data Analysis (Mindrally/skills, 271 stars), Pandas Pro (Jeffallan/claude-skills, 12k stars) and Statistical Data Analysis (lingzhi227/agent-research-skills, 390 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains GeoPandas Spatial Analysis?

davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,552 GitHub stars. The repository holds 479 skills in this directory. The repository was last updated on October 11, 2026.

Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.