Skip to content
Back to skills

Geopandas Knowledge Patch

ASecurity

GeoPandas

  • 25 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 5, 2026
developmentpythongoapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill geopandas-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Geopandas Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Geopandas Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-geopandas-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-geopandas-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: geopandas-knowledge-patch
description: GeoPandas
version: "1.2.0"
license: MIT
metadata:
  author: Nevaberry
---


# GeoPandas knowledge patch

Use this skill when updating GeoPandas code or working with geometry columns,
spatial operations, geospatial I/O, and maps. Load the relevant topic reference
for detailed behavior, examples, and compatibility fixes.

| Reference | Topics |
| --- | --- |
| [Compatibility and pandas interop](references/compatibility-and-pandas.md) | Dependency minimums, removed APIs, geometry columns, constructors, pandas integration, aggregation, exploding |
| [Geometry operations](references/geometry-operations.md) | Alignment, repair, coverages, precision, unions, spatial indexing, coordinates, grids, sampling |
| [I/O and databases](references/io-and-databases.md) | File reads, CSV, Arrow, Parquet, Feather, features, PostGIS |
| [Overlays and exploration](references/overlays-and-exploration.md) | Clipping, spatial joins, overlays, static plots, interactive legends |

## Breaking changes and deprecations

### Dependency requirements

GeoPandas 1.2 requires Python 3.11, pandas 2.2, NumPy 2.0, pyproj 3.7,
and Shapely 2.1 or newer. Updated minimum tested optional versions include
Matplotlib 3.9, mapclassify 2.7, folium 0.15, and PyArrow 15.0.
See the compatibility reference for dependency requirements by release.

### Removed APIs and renamed arguments

- `GeoSeries.select` has been removed.
- Use `geom_equals_exact` in place of the removed `geom_almost_equals`.
- The `resolution` keyword to `buffer` is deprecated. Use
  `gdf.geometry.buffer(10, quad_segs=8)` to specify segments per quarter circle.
- `sample_points` has removed `seed`; pass the seed using `rng`.
- Remove assignments to `geopandas.options.use_pygeos`, which was already
  inactive and has now been removed.

### Geometry column naming and replacement

Since 1.0, `set_geometry(ser)` uses `ser.name` when set and retains the old
geometry column if the names differ. To replace the existing active column:

```python
gdf.set_geometry(ser.rename(gdf.active_geometry_name))
```

The `GeoDataFrame(..., geometry=ser)` constructor still names the column
`"geometry"`. The `drop` argument to `set_geometry` is deprecated; omit explicit
`drop=False`. To reproduce `drop=True` when switching to a different existing
geometry column:

```python
old_name = gdf.active_geometry_name
gdf = gdf.set_geometry("alternate").drop(columns=old_name).rename_geometry(old_name)
```

Selecting columns that retain a geometry-typed column but omit the active one
returns a GeoDataFrame whose active geometry is unset. Call
`subset.set_geometry("alternate")` before using `subset.geometry` or `subset.crs`.
Deleting the last geometry column with `del gdf["geometry"]` converts the frame
to a pandas `DataFrame`.

### Alignment, triangulation, and output names

Since 1.0, binary geometry methods default to `align=None`, aligning by index
and warning if indices differ. Pass `align=True` to align without the warning:
`left.intersection(right, align=True)`. Match the geometry index for per-row
Series arguments such as buffer distances to avoid a `ValueError`.

Since 1.0, `delaunay_triangles()` triangulates all input geometries together.
Use `shapely.delaunay_triangles(gdf.geometry)` to triangulate each row separately.

Since 1.0, `sjoin` uses the named right index as the corresponding output column
name. For a left spatial join that relies on `"index_right"`, check whether the
right index has a name before looking up that column.

### File options and return types

For the default Pyogrio engine, `include_fields` and `ignore_fields` are
deprecated. Select the attributes to keep with
`geopandas.read_file("roads.gpkg", columns=["road_id"])`.

Since 1.0, `to_parquet` and `to_feather` forward `version` to the underlying
Arrow writer. Select the geospatial metadata version explicitly with
`gdf.to_parquet("data.parquet", schema_version="1.0.0")`.

Since 1.0, `geopandas.read_file()` returns a pandas DataFrame for a layer with
no geometry field. Account for that return type when code expects geometry.

### Ordering and plot artists

The x-coordinate order of points in each `MultiPoint` returned by
`GeoSeries.sample_points()` is unspecified. Sort explicitly if ascending
x-coordinates are required.

The composition of Matplotlib collections produced by GeoPandas plots has
changed. Check code that edits plot artists through `ax.collections` by position.

## Geometry operations and queries

### Coverage validation and geometry repair

Use `is_valid_coverage()` on a GeoSeries or GeoDataFrame to check polygons as
a coverage, and `invalid_coverage_edges()` to locate invalidating edges.
GeoPandas 1.1 exposes repair algorithm and collapsed-component treatment through
`make_valid(method=..., keep_collapsed=...)`:

```python
gdf.geometry.make_valid(method="linework", keep_collapsed=True)
```

This selects linework repair and retains collapsed components.

### Union algorithms and precision grids

Use `method="disjoint_subset"` to process non-intersecting subsets separately.
In `dissolve`, the algorithm applies within each group:

```python
merged = gdf.geometry.union_all(method="disjoint_subset")
dissolved = gdf.dissolve("region", method="disjoint_subset")
```

Pass `grid_size` to `union`, `difference`, `symmetric_difference`, or
`intersection` to snap coordinates to a precision grid during the operation,
as in `left.intersection(right, grid_size=0.01)`.

### Boolean spatial-index results

`SpatialIndex.query` can return boolean match arrays with `output_format="dense"`
or `output_format="sparse"`. Sparse output requires SciPy.

```python
import geopandas as gpd

points = gpd.GeoSeries.from_wkt(["POINT (0 0)", "POINT (1 1)"])
matches = points.sindex.query(points, output_format="sparse")
```

### Coordinates, grids, and point sampling

Use `has_m` to detect measured geometries and `m` to read measures from points.
Extract coordinates with measures using
`gdf.geometry.get_coordinates(include_m=True)`.

`geopandas.make_grid` and `GeoSeries.make_grid` generate square or hexagonal
grids covering the input geometry.

With pointpats methods, `GeoSeries.sample_points` accepts a list-like `size`
with one count per input geometry, and `rng` fixes the random state.
`GeoSeries.sample_points()` returns an empty `MultiPoint` for zero-area polygons
such as collapsed rings, avoiding a stalled sampling call.

## Data interchange and pandas integration

### Arrow and Parquet

GeoSeries and GeoDataFrame support `to_arrow()` and `from_arrow()` for
interchange with GeoArrow extension types. A GeoDataFrame round trip is
`geopandas.GeoDataFrame.from_arrow(gdf.to_arrow())`.

Pass `to_pandas_kwargs` to `GeoDataFrame.from_arrow`, `read_parquet`, or
`read_feather` to control conversion of non-geometry Arrow columns to pandas.
`geopandas.read_parquet` also accepts it for Arrow list or struct columns.

GeoPandas can read and write files using the draft GeoParquet 2.0 specification.
`read_parquet` supports HTTP and HTTPS URLs, restores frame `attrs` written by
`to_parquet`, and honors `partitioning` when detecting columns. Use
`geopandas.read_parquet(path, partitioning=None)` to disable partition discovery.

### Series accessors and CSV geometry

Import `geopandas.accessors` to register `.geo` on pandas Series and call
GeoSeries methods on a Series holding geometries. To parse a WKT column as
geometry from CSV, import GeoPandas to register the dtype:

```python
import geopandas
import pandas as pd

frame = pd.read_csv("points.csv", dtype={"wkt": "geometry"})
```

Named aggregations in `GroupBy.agg` can target geometry columns, for example
`gdf.groupby("region").agg(first_geometry=("geometry", "first"))`.

## Maps and overlays

Use `gdf.clip(mask, sort=True)` to preserve input row order when clipping.
The overlays reference covers shared column names in identity overlays and
empty inputs with `keep_geom_type=True`.

Categorical plots accept category-to-color or category-to-style mappings.
Matplotlib legends show geometry types and styles; `ax.legend()` can create
a single legend for a layered map.

For classified continuous data, draw a colorbar with:

```python
gdf.plot(column="population", scheme="quantiles", legend=True, legend_kwds={"colorbar": True})
```

Classified plots honor `vmin` and `vmax`; colorbar extensions show where those
bounds clip values. Static plot axes show CRS units; `gdf.plot(add_labels=False)`
turns those labels off. Pass a basemap with `tiles` to `gdf.plot()`; this requires
contextily. Use `polygons.plot(scheme="greedy")` to color adjacent polygons
differently; this requires mapclassify and libpysal.

`GeoDataFrame.explore()` honors `legend_kwds["labels"]` for categorical and
boolean columns, as in
`gdf.explore(column="is_open", legend_kwds={"labels": ["Closed", "Open"]})`.

Files in this skill

  • SKILL.md6.1 KB
  • coverage.json716 B
  • references/compatibility-and-pandas.md1.3 KB
  • references/geometry-operations.md2.1 KB
  • references/io-and-databases.md943 B
  • references/overlays-and-exploration.md810 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.