Registry / data / geopandas

geopandas

JSON →
library1.1.4pypypi✓ verified 26d ago

GeoPandas extends the popular Python data analysis library pandas by adding support for geographic data. It introduces GeoSeries and GeoDataFrame types, which are subclasses of pandas.Series and pandas.DataFrame, respectively, allowing for the manipulation and analysis of geometric objects. GeoPandas is currently at version 1.1.3, with frequent patch releases addressing compatibility and bug fixes, and major releases periodically introducing significant changes and dependency updates.

pip install geopandas
INSTALL
IMPORT
SIG · GEOPANDAS
G
geopandas
datapythonv1.1.4
Install
9.8s avg
Import
1106ms
Disk
306MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 9.8s · import 1.106s · 307MB
306MB installed
● package 306MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GeoDataFrame
from geopandas import GeoDataFrame
GeoSeries
from geopandas import GeoSeries
read_file
import geopandas as gpd gdf = gpd.read_file(...)

This quickstart demonstrates how to load a built-in geospatial dataset using `geodatasets` and `gpd.read_file()`, inspect its basic properties (like the first few rows and Coordinate Reference System), and create a simple static map using the `.plot()` method.

import geopandas as gpd import geodatasets import matplotlib.pyplot as plt # Load a sample dataset (New York City boroughs) path = geodatasets.get_path('ny.bb') nybb = gpd.read_file(path) print("GeoDataFrame Head:") print(nybb.head()) print("\nCoordinate Reference System (CRS):") print(nybb.crs) # Plot the GeoDataFrame fig, ax = plt.subplots(1, 1, figsize=(10, 10)) nybb.plot(ax=ax, color='lightgray', edgecolor='black') ax.set_title('New York City Boroughs') plt.show()
Debug
Known issues
breakingGeoPandas 1.0 dropped support for Shapely < 2 and PyGEOS. It strictly requires Shapely >= 2. The `rtree` package for spatial indexing was also removed. If your project relied on older Shapely versions or PyGEOS, you must upgrade Shapely to version 2.0 or newer.
fix
Ensure `shapely>=2.0` is installed. Review and update code that explicitly used PyGEOS or `rtree` for spatial indexing.
affects: >=1.0.0
breakingThe default I/O engine for reading and writing files (`gpd.read_file`, `gdf.to_file`) changed from Fiona to Pyogrio in GeoPandas 1.0. While `pyogrio` is now installed by default, ensure compatibility if you had specific configurations or relied on Fiona's unique behaviors.
fix
No direct code changes are usually needed, but be aware of potential subtle differences in behavior or performance. If explicit Fiona usage is desired, ensure it's installed and potentially specify `engine='fiona'` where applicable.
affects: >=1.0.0
breakingThe `geopandas.datasets` module (e.g., `geopandas.datasets.get_path('naturalearth_lowres')`) has been removed in GeoPandas 1.0. Sample datasets are now available through the `geodatasets` library.
fix
Install `geodatasets` (`pip install geodatasets`) and update imports and calls from `geopandas.datasets.get_path` to `geodatasets.get_path`.
affects: >=1.0.0
deprecatedManually setting the Coordinate Reference System (CRS) via direct assignment (e.g., `gdf.crs = 'EPSG:4326'`) is deprecated. This method can lead to unexpected behavior or data corruption.
fix
Use the `GeoDataFrame.set_crs()` method (e.g., `gdf = gdf.set_crs('EPSG:4326')`) for setting the CRS. For re-projecting, use `GeoDataFrame.to_crs()`.
affects: >=1.0.0
gotchaInstalling GeoPandas with `pip` can be challenging on some systems due to its dependencies on low-level C libraries like GEOS, GDAL, and PROJ. Missing or incorrectly compiled C libraries often lead to installation failures or import errors.
fix
The recommended installation method is using the `conda` package manager (e.g., `conda install -c conda-forge geopandas`), which provides pre-built binaries for these complex dependencies across different platforms. Using isolated virtual environments is also crucial.
affects: All versions
gotchaSpatial join operations (`gpd.sjoin()`) and spatial indexing (`sindex`) can fail with `RTreeError: Coordinates must not have minimums more than maximums` or similar errors if geometries are invalid (e.g., self-intersections, empty geometries) or if DataFrame indices are not clean and sequential.
fix
Validate geometries using `gdf.geometry.is_valid` and consider running `gdf.geometry.buffer(0)` or `gdf.geometry.make_valid()` to fix invalid geometries. Ensure DataFrame indices are reset with `df.reset_index(drop=True)` before performing spatial joins.
affects: All versions
breakingGeoPandas 1.1 requires Python 3.10 or greater, and updated minimum versions for core dependencies: pandas 2.0, numpy 1.24, and pyproj 3.5.
fix
Upgrade your Python environment to 3.10+ and ensure all listed core dependencies meet or exceed their minimum required versions.
affects: >=1.1.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'geopandas'
The 'geopandas' library is not installed in your active Python environment. This is a fundamental installation issue.
fix
Install geopandas using pip or conda. The recommended method, especially for complex dependencies, is via conda-forge: `conda install -c conda-forge geopandas` or `pip install geopandas`.
ImportError: DLL load failed: The specified module could not be found.
This error, often seen on Windows, indicates that core C/C++ libraries (like GDAL, GEOS, PROJ) that GeoPandas' dependencies (fiona, pyogrio, shapely, pyproj) rely on, are either not installed, are incompatible, or their DLLs are not discoverable by Python, commonly due to conflicts from mixing `pip` and `conda` installations or specific Python versions (e.g., Python 3.7 and `os.add_dll_directory`).
fix
Create a new, clean conda environment and install all geospatial packages from the `conda-forge` channel to ensure compatibility: `conda create -n geo_env -c conda-forge python=3.9 geopandas` (replace 3.9 with your desired Python version). If using pip, ensure all binary dependencies (shapely, fiona, pyproj, pyogrio) are installed from pre-compiled wheels if available for your system and Python version.
AttributeError: 'DataFrame' object has no attribute 'to_file'
This occurs when an object that was expected to be a `geopandas.GeoDataFrame` has been implicitly or explicitly converted into a regular `pandas.DataFrame`, thereby losing its geospatial attributes and methods, including `to_file()` or other geometry operations.
fix
Verify the type of your object using `type(my_object)`. Ensure that operations return a GeoDataFrame, or explicitly convert a DataFrame back to a GeoDataFrame by assigning a `geometry` column and setting the active geometry: `gdf = gpd.GeoDataFrame(df, geometry='my_geometry_column', crs='EPSG:4326')`.
UserWarning: Geometry is in a geographic CRS. Results from 'sjoin_nearest' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.
Spatial operations that rely on distance calculations (like `sjoin_nearest`) yield inaccurate results when performed on data in a geographic Coordinate Reference System (CRS) because distances are measured in degrees, not linear units (e.g., meters or feet). GeoPandas operations assume a planar coordinate system.
fix
Reproject your GeoDataFrame(s) to an appropriate projected CRS (e.g., a UTM zone, or a local projection) that uses linear units before performing distance-based spatial analyses: `gdf_projected = gdf.to_crs('EPSG:XXXX')` (where 'XXXX' is the EPSG code for a suitable projected CRS).
Upgrade
Version history
1.1.4latest on PyPI · released Jun 26, 2026
Audit
Dependencies
pandasrequiredCore data structures and analysis.
shapelyrequiredManipulation and analysis of planar geometric objects (required >= 2.0).
pyogriorequiredDefault high-performance vector I/O library (interface to GDAL).
pyprojrequiredCartographic projections and coordinate transformations (interface to PROJ).
packagingrequiredUtilities for version handling.
matplotliboptionalFor plotting and visualization.
fionaoptionalAlternative vector I/O library (interface to GDAL).
geodatasetsoptionalProvides sample datasets for examples.
Agent activity
7 hits · last 30 days
node
6
Resources
geopandas — pip install geopandas · libregistry