Contribute Media
A thank you to everyone who makes this possible: Read More

GeoPandas: Geospatial Data + Pandas


GeoPandas extends the pandas data analysis library to work with geographic objects.


GeoPandas is a library built on top of pandas to extend its capabilities to allow spatial calculations. The two main datatypes are GeoSeries and GeoDataFrame, extending pandas Series and DataFrame, respectively. A GeoSeries contains a collection of geometric objects (such as Point, LineString, or Polygon) and implements nearly all Shapely operations. These include unary operations (e.g. centroid), binary operations (e.g. distance, either elementwise to another GeoSeries or to a single geometry), and cumulative operations (e.g. unary_union to combine all items to a single geometry).

A GeoDataFrame object contains a column of geometries (itself a GeoSeries) that has special meaning. GeoDataFrames can be easily created from spatial data in other formats, such as shapefiles. Rows in the GeoDataFrame represent features, and columns represent attributes. Pandas' grouping and aggregation methods are also supported.

GeoPandas objects can optionally be aware of coordinate reference systems (by adding a crs attribute) and transformed between map projections. Basic support for plotting is included with GeoPandas. Other features include geocoding, export to GeoJSON, and retrieving data from a PostGIS spatial database.

This talk will describe the main features of GeoPandas and show examples of its use.


Improve this page