🚀 Jumpstart 2027: Custom, Secure AI Workflows to Adopt Now. Reserve your spot →

Chris Parmer

Chris Parmer

November 14, 2026

geopandas demo

Spatial data analysis in Python, with Dash and Plotly

TL;DR

  • geopandas adds geometry and a coordinate reference system (CRS) to pandas, so spatial joins, buffers, overlays and reprojection work like dataframe operations. Kelsey Jordahl started it in 2013, and a community of maintainers develops it today.
  • This demo runs five analyses on public U.S. data, each with a different geopandas operation: wind farm footprints with dissolve, clinical trial sites per state with sjoin, storm wind swaths with buffers and overlay, burned area by county, and earthquake counts on a hexagon grid.
  • Version 1.2 (September 28, 2026) adds make_grid for square and hexagon grids, GeoParquet 2.0, GeoParquet reads from https:// URLs, grid_size for set operations and rebuilt static plotting.
  • All five layers come together in Site Screener, a Dash app that screens any spot in the lower 48 states in under half a second, with the prompts to build it at the end.
Five small U.S. maps made with geopandas: wind farms sized by capacity, 89,691 cancer trial sites, 2024 hurricane-force wind swaths, 2025 wildfire acres by county and 2025 earthquakes counted in 3,879 hexagons

What is geopandas?

Most business data has a place attached. A wind developer asks what sits near a parcel, an insurer which insured properties sit inside a storm's footprint, a utility which counties its lines cross, and a clinical operations team where trial sites are compared with patients. The shapes differ (points, lines and polygons), and so do the coordinate systems, but the question is always what is near, inside or overlapping what.

geopandas answers it in pandas. It hands geometry to shapely, projections to pyproj and file reading to pyogrio, so read_file, sjoin, overlay, dissolve and to_crs are each one line on a GeoDataFrame. It's the vector side of our guide to Python packages for data; for gridded weather and satellite data, see the xarray demo. Below are five things you'd do with geopandas, each on a public dataset from a different field.

The data: six public U.S. datasets, from 353 polygons to 89,691 points

Layer

Field

Source

Geometry

Rows

Wind turbines

Energy

Points (NAD83)

77,839

Cancer trial sites

Pharma

ClinicalTrials.gov API, recruiting studies, November 14, 2026

Points (WGS84)

89,691

Hurricane tracks

Insurance

NOAA IBTrACS, 2024 U.S. landfalls

Points along tracks

5 storms

Wildfire perimeters

Utilities

NIFC WFIGS, 2025 fires of 1,000 acres or more

Polygons

353

Earthquakes

Geoscience

USGS ComCat, 2025, magnitude 1.5 and up

Points

19,033

Counties and population

All

Polygons (NAD83)

3,235

The layers arrive as zipped shapefiles, GeoJSON, CSV with longitude and latitude columns and JSON from an API. gpd.read_file opens anything GDAL can read, and gpd.points_from_xy turns coordinate columns into geometry:

turbines = gpd.GeoDataFrame(t, geometry=gpd.points_from_xy(t.xlong, t.ylat), crs="EPSG:4269")

Degrees are fine for drawing but not for measuring, so every area and distance below is measured after projecting to EPSG:5070 (Conus Albers), an equal-area projection in meters.

Six maps of the raw layers: 77,839 wind turbine points concentrated from Texas to the Dakotas, 89,691 cancer trial site points following population, five 2024 hurricane tracks across the Gulf and East, 353 wildfire polygons in the West, 19,033 earthquake points mostly in the West, Oklahoma and Texas, and 3,235 counties shaded by population

Five geopandas examples

1. Energy: turn turbines into wind farm footprints with dissolve

dissolve is a group-by for geometry. It merges each project's turbines into one shape and sums their capacity, and convex_hull draws the footprint around them.

Left, 1,818 U.S. wind farms drawn at their centers and sized by capacity, densest from Texas to the Dakotas; right, the 377 turbines of Western Spirit in New Mexico inside their convex-hull footprint
farms = turbines.to_crs(5070).dissolve(by=["p_name", "t_state"], aggfunc={"t_cap": "sum", "case_id": "count"})
farms["geometry"] = farms.convex_hull
  • The 77,839 turbines group into 1,818 farms, and the largest by capacity, Western Spirit in New Mexico, spreads 377 turbines over its footprint.

2. Pharma: count clinical trial sites per state with a spatial join

sjoin gives each point the attributes of the polygon it falls in, which turns site coordinates into trials per state, county or sales territory.

U.S. map of recruiting cancer trials per million residents by state: DC 534, South Dakota 214, North Dakota 186, Rhode Island and Nebraska 182; Mississippi and California are lowest at about 52
joined = gpd.sjoin(sites.to_crs(states.crs), states[["STUSPS", "geometry"]], predicate="within")
  • By raw count, Texas and California lead, but per resident the Dakotas, Nebraska and Rhode Island stand out, which is the view a feasibility team wants when it looks for under-served regions.

3. Insurance: estimate exposure inside a storm's wind field

Buffers turn a storm track into an area, and overlay cuts counties by that area. Together they're the core of a catastrophe exposure estimate, which insurers and utilities run on their own assets.

Map of the U.S. Gulf Coast and Florida with the hurricane-force wind swaths of Beryl, Debby, Francine, Helene and Milton in 2024, and counties inside them shaded by the estimated people inside, darkest around Tampa Bay and Houston
circles = pts.geometry.buffer(pts.r64_m, quad_segs=16) # widest 64-knot wind radius
hit = gpd.overlay(counties, gpd.GeoDataFrame(geometry=[swath], crs=5070), how="intersection")
hit["people"] = hit.POPESTIMATE2024 * hit.area / hit.county_area
  • Each county is shaded by its population times the share of its area inside the swath, a quick screening estimate that the same code would run on a portfolio of insured sites.

4. Utilities: split burned area by county with an overlay

Fire perimeters overlap and cross county lines. union_all merges them so no acre counts twice, and overlay splits the result by county.

Map of acres burned by 2025 wildfires of 1,000 acres or more in each county of the lower 48, on a log scale: most of the burned area is in the West, with the largest totals in Elko County, Nevada, Coconino County, Arizona, and San Luis Obispo County, California
fires["geometry"] = fires.make_valid(method="structure") # hand-drawn perimeters often cross themselves
burned = gpd.GeoDataFrame(geometry=[fires.union_all()], crs=5070).explode(index_parts=False)
by_county = gpd.overlay(counties.to_crs(5070), burned, how="intersection")
  • Merging overlaps and measuring in an equal-area projection brings the reported total of 4.00 million acres down to 3.92 million.

5. Geoscience: count earthquakes on a hexagon grid with make_grid

Counties and states mix huge and tiny areas, which distorts any map of counts. Equal-size hexagons don't, and geopandas 1.2 builds them in one call.

Map of the lower 48 with 50 km hexagons shaded by the number of 2025 earthquakes of magnitude 1.5 and up on a log scale; the busiest hexagon, with 2,796 earthquakes, is in the Delaware Basin of the Permian on the New Mexico and Texas border
hexes = gpd.make_grid(lower48, 50_000, grid_type="hexagon") # new in geopandas 1.2
hexes = gpd.GeoDataFrame(geometry=hexes.values, crs=5070).reset_index(names="hex")
counts = gpd.sjoin(quakes.to_crs(5070), hexes, predicate="within").groupby("hex").size()
  • The busiest hexagon is in the Permian's Delaware Basin, an oil and gas region on the New Mexico and Texas border, and the next two are at The Geysers geothermal field in California.

geopandas also reads and writes GeoParquet, PostGIS, GeoPackage and every GDAL format, makes interactive maps with explore(), and sits at the center of Python's geospatial ecosystem with shapely, pyproj, pyogrio and rasterio.

What's new in geopandas 1.2

Version 1.2 came out on September 28, 2026, 16 months after 1.1.0, with 161 commits from 41 contributors, as listed in the changelog:

  • make_grid builds square or hexagon grids over any area, as polygons, centers or corners.
  • read_parquet from https:// URLs.
  • GeoParquet 2.0 and attrs: to_parquet(schema_version="2.0.0") writes the new spec, and attrs such as a source note are saved and read back.
  • grid_size for union, difference, symmetric_difference and intersection, which snaps results to a precision grid to avoid slivers.
  • Rebuilt static plotting with dict-based category styles, better legends, CRS axis labels and basemaps with tiles=.
  • read_file_info lists a file's layers, fields and CRS without reading it.

Before you upgrade, note that 1.2 needs Python 3.11, pandas 2.2, NumPy 2.0, pyproj 3.7 and shapely 2.1, that buffer(resolution=...) is deprecated in favor of quad_segs=, and that code that reached into plot()'s matplotlib internals may need changes.

pip install -U geopandas

Testing 1.2 against 1.1

We ran the five analyses on geopandas 1.1.4 and 1.2.0 in environments that differed only in geopandas:

  • Same answers, same speed. The four analyses that run on both gave identical results, geometry included, in about the same time.
  • make_grid replaces a loop you'd otherwise write. Our own 15-line hexagon grid on 1.1.4 took 1.14 s; make_grid took 0.02 s. The grids start at different corners, so counts per cell differ between them, as they do on any two grids.
  • GeoParquet. On 1.2.0, read_parquet read a file straight from GitHub, attrs survived a round trip and version 2.0.0 files were written. 1.1.4 can't do the first three, but it reads 1.2.0's 2.0.0 files.

Demo App: Site Screener

We built a Dash app called Site Screener that puts all five datasets on one 50 km hexagon grid and screens any spot in the lower 48, and deployed it privately to Plotly Cloud.

Site Screener Atlas tab: a hexagon map of wind capacity in megawatts on a log scale, with the top 10 hexagons listed with every layer, led by a California hexagon with 2,468 MW

The Atlas tab colors the make_grid hexagons by one layer at a time and lists the top 10 with every layer side by side.

Site Screener Atlas tab colored by 2025 earthquakes, with the top hexagon in Texas near 31.6 N, 104.3 W at 2,796 earthquakes and two California hexagons at 591 and 539

Switching the layer redraws the map in place, and clicking a hexagon opens it in the Screener tab.

Site Screener Screener tab for 100 km around Houston: 270 MW of wind, 2,183 cancer trial sites in 1,549 trials, 34% of the area inside Beryl's hurricane-force winds, 5,464 acres burned, no earthquakes and 7.88 million people, screened in 386 ms

The Screener buffers a point and runs sjoin, overlay and sjoin_nearest against every layer in the callback, so a siting or feasibility question gets an answer for any radius you choose.

Site Screener for 100 km around Pecos, Texas: 153 MW of wind, one trial site, no hurricane winds or burned area, 3,671 earthquakes up to M5.4 and 0.13 million people

Around Pecos, Texas, the same screen shows a very different site, with little population and many small earthquakes.

Site Screener for 100 km around Sioux Falls, South Dakota: 2,290 MW of wind from 1,285 turbines, 321 cancer trial sites in 194 trials, and lists of the largest wind farms and the sites with the most trials

Around Sioux Falls, it lists the largest wind farms and the trial sites with the most studies.

Site Screener Versions tab: a table comparing geopandas 1.1.4 and 1.2.0 for each step, with identical results, a hexagon grid built in 1.14 s by hand and 0.02 s with make_grid, and the GeoParquet features that only 1.2 supports

The Versions tab has the 1.1 and 1.2 test results from the section above.

Running geopandas on Plotly Cloud and Dash Enterprise

What we learned deploying Site Screener applies the same way on Dash Enterprise:

  • Ship GeoParquet, already projected to the CRS you measure in. Every layer for the whole app comes to 7.5 MB and loads in a fraction of a second.
  • Precompute heavy overlays. The per-hexagon numbers take seconds, so we computed them once, and the live screen takes under 400 ms.
  • Explode before overlaying. Counties against the merged burned area as one multipolygon took 108 s, and after explode() it took 7 s with the same acres.
  • Simplify what you only draw. simplify(30) cut the burned area from 21.8 MB to 1.9 MB with almost no change in acres.

Prompts to build it yourself

The five charts:

Prompt: With geopandas 1.2 and Plotly, using public U.S. data: (1) USGS wind turbines with points_from_xy (EPSG:4269), dissolve by project and state, convex_hull footprints; (2) ClinicalTrials.gov recruiting cancer sites, sjoin with Census states, trials per million; (3) NOAA IBTrACS 2024 hurricanes buffered by the widest 64-kt radius, joined into swaths, overlay with counties for area-weighted population; (4) NIFC 2025 wildfires, make_valid, union_all, explode, overlay with counties for acres; (5) USGS 2025 earthquakes counted on make_grid 50 km hexagons. Measure everything in EPSG:5070.

The Site Screener app:

Prompt: Build a Dash app called Site Screener on the same data. Offline: a make_grid 50 km hexagon grid with wind MW, trial sites, quakes, acres burned, hurricane share and population per hexagon, all saved as GeoParquet. Tabs: Atlas (Choroplethmap by chosen layer plus a top-10 table; click to screen), Screener (lat, lon and radius; buffer and run sjoin, overlay and sjoin_nearest live; cards, a map and lists), Versions (a 1.1.4 vs 1.2.0 benchmark). Inter, light theme, Plotly purple.

FAQ

bluesly
x
instagram
youtube
medium
fcaebook

Product

© 2026
Plotly. All rights reserved.
Cookie Preferences
aicpa/soc2