GeoPandas 0.9.0 features a long list of new features, enhancements and bug fixes, see the full list below. In addition, there are many documentation improvements and a restyled and restructured website with a new logo (#1564, #1579, #1617, #1668, #1731, #1750, #1757, #1759).
New features and improvements:
geopandas.read_file function now accepts more general file-like objects (e.g. fsspec open file objects). It will now also automatically recognize zipped files (#1535).GeoDataFrame.plot() method now provides access to the pandas plotting functionality for the non-geometry columns, either using the kind keyword or the accessor method (e.g. gdf.plot(kind="bar") or gdf.plot.bar()) (#1465).from_wkt(), from_wkb(), to_wkt(), to_wkb()
methods for GeoSeries to construct a GeoSeries from geometries in WKT
or WKB representation, or to convert a GeoSeries to a pandas Seriew with
WKT or WKB values (#1710).GeoSeries.z attribute to access the z-coordinates of Point geometries (similar to the existing .x and .y attributes) (#1773).to_crs() method now handles missing values (#1618)..attrs functionality (#1658).dissolve() method now allows dissolving by no column (by=None) to create a union of all geometries (single-row GeoDataFrame) (#1568).estimate_utm_crs() method on GeoSeries/GeoDataFrame to determine the UTM CRS based on the bounds (#1646).GeoDataFrame.from_dict() now accepts geometry and crs keywords (#1619).GeoDataFrame.to_postgis() and geopandas.read_postgis() now supports both sqlalchemy engine and connection objects (#1638).GeoDataFrame.explode() method now allows exploding based on a non-geometry column, using the pandas implementation (#1720).GeoDataFrame/GeoSeries.explode() when using the PyGEOS backend (#1693).intersection(), intersects()) have a new align keyword which allows optionally not aligning on the index before performing the operation with align=False (#1668).GeoDataFrame.dissolve() method now supports all relevant keywords of groupby(), i.e. the level, sort, observed and dropna keywords (#1845).geopandas.overlay() function now accepts make_valid=False to skip the step to ensure the input geometries are valid using buffer(0) (#1802).GeoDataFrame.to_json() method gained a drop_id keyword to optionally not write the GeoDataFrame's index as the "id" field in the resulting JSON (#1637).aspect keyword in the plotting methods to optionally allow retaining the original aspect (#1512)interval keyword in the legend_kwds group of the plot() method to control the appearance of the legend labels when using a classification scheme (#1605).sindex
attribute) is now stored on the underlying array. This ensures that the
spatial index is preserved in more operations where possible, and that
multiple geometry columns of a GeoDataFrame can each have a spatial
index (#1444).has_sindex attribute on the GeoSeries/GeoDataFrame to check if a spatial index has already been initialized (#1627).geopandas.testing.assert_geoseries_equal() and assert_geodataframe_equal() testing utilities now have a normalize keyword (False by default) to normalize geometries before comparing for equality (#1826). Those functions now also give a more informative error message when failing (#1808).Deprecations and compatibility notes:
is_ring attribute currently returns True for Polygons. In the future, this will be False (#1631). In addition, start to check it for LineStrings and LinearRings (instead of always returning False).objects keyword in the intersection() method of the GeoDataFrame/GeoSeries.sindex spatial index object has been removed (#1444).Bug fixes:
plot() method raising an error with empty geometries (#1702, #1828).geopandas.overlay() to preserve geometries of the correct type which are nested within a GeometryCollection as a result of the overlay operation (#1582). In addition, a warning will now be raised if geometries of different type are dropped from the result (#1554)..crs for empty GeoDataFrames (#1560).geopandas.clip to preserve the correct geometry column name (#1566).plot() method when using legend_kwds with multiple subplots (#1583)missing_kwds keyword of the plot() method when there are no areas with missing data (#1600).plot() method to correctly align values passed to the column keyword as a pandas Series (#1670).rename_geometry() method now raises a more informative error message when a duplicate column name is used (#1602).explode() method to preserve the CRS (#1655)GeoSeries.apply() method to again accept the convert_dtype keyword to be consistent with pandas (#1636).GeoDataFrame.apply() to preserve the CRS when possible (#1848).geom in geoseries (#1753).shift() method of a GeoSeries/GeoDataFrame now preserves the CRS (#1744).GeoSeries constructor without passing data but only an index (#1798).Notes on (optional) dependencies:
descartes package is no longer required for
plotting polygons. This functionality is now included by default in
GeoPandas itself, when matplotlib is available (#1677).read_file/to_file. This means you can now force geopandas to install without fiona installed (although it is still a default requirement) (#1775).Acknowledgments
Thanks to everyone who contributed to this release!
A total of 29 people contributed patches to this release. People with a
"+" by their names contributed a patch for the first time.