github geopandas/geopandas v0.6.0

latest releases: v1.0.1, v1.0.0, v1.0.0rc1...
5 years ago

GeoPandas 0.6.0 features a refactor of the internals based on the new pandas ExtensionArray interface, for better integration with pandas. Although this change should keep the user interface mostly stable, there are a few changes summarized below. Further, this release includes a nice set of other improvements and bug fixes.

Important note! This will be the last release to support Python 2.7 (#1031)

API changes:

  • A refactor of the internals based on the pandas ExtensionArray interface (#1000). Read more on that in this blogpost, and the main user visible changes are:
    • The .dtype of a GeoSeries is now a 'geometry' dtype (and no longer a numpy object dtype).
    • The .values of a GeoSeries now returns a custom GeometryArray, and no longer a numpy array. To get back a numpy array of Shapely scalars, you can convert explicitly using np.asarray(..).
  • The GeoSeries constructor now raises a warning when passed non-geometry data. Currently the constructor falls back to return a pandas Series, but in the future this will raise an error (#1085).
  • The missing value handling has been changed to now separate the concepts of missing geometries and empty geometries (#601, 1062). In practice this means that (see the docs for more details):
    • GeoSeries.isna now considers only missing values, and if you want to check for empty geometries, you can use GeoSeries.is_empty (GeoDataFrame.isna already only looked at missing values).
    • GeoSeries.dropna now actually drops missing values (before it didn't drop either missing or empty geometries)
    • GeoSeries.fillna only fills missing values (behaviour unchanged).
    • GeoSeries.align uses missing values instead of empty geometries by default to fill non-matching index entries.

New features and improvements:

  • Addition of a GeoSeries.affine_transform method, equivalent of Shapely's function (#1008).
  • Addition of a GeoDataFrame.rename_geometry method to easily rename the active geometry column (#1053).
  • Addition of geopandas.show_versions() function, which can be used to give an overview of the installed libraries in bug reports (#899).
  • The legend_kwds keyword of the plot() method can now also be used to specify keywords for the color bar (#1102).
  • Performance improvement in the sjoin() operation by re-using existing spatial index of the input dataframes, if available (#789).
  • Updated documentation to work with latest version of geoplot and contextily (#1044, #1088).
  • A new geopandas.options configuration, with currently a single option to control the display precision of the coordinates (options.display_precision). The default is now to show less coordinates (3 for projected and 5 for geographic coordinates), but the default can be overridden with the option.

Bug fixes:

  • Also try to use pysal instead of mapclassify if available (#1082).
  • The GeoDataFrame.astype() method now correctly returns a GeoDataFrame if the geometry column is preserved (#1009).
  • The to_crs method now uses always_xy=True to ensure correct lon/lat order handling for pyproj>=2.2.0 (#1122).
  • Fixed passing list-like colors in the plot() method in case of "multi" geometries (#1119).
  • Fixed the coloring of shapes and colorbar when passing a custom norm in the plot() method (#1091, #1089).
  • Fixed GeoDataFrame.to_file to preserve VFS file paths (e.g. when a "s3://" path is specified) (#1124).
  • Fixed failing case in geopandas.sjoin with empty geometries (#1138).

In addition, the minimum required versions of some dependencies have been increased: GeoPandas now requires pandas >=0.23.4 and matplotlib >=2.0.1 (#1002).

Acknowledgments

Thanks to everyone who contributed to this release!
A total of 20 people contributed patches to this release. People with a "+" by their names contributed a patch for the first time.

  • Alan D. Snow +
  • Aleksey Bilogur
  • Archana Alva +
  • François Leblanc
  • Geir Arne Hjelle
  • Ian Rose +
  • James Gaboardi +
  • James McBride
  • Joris Van den Bossche
  • Joshua Wilson
  • Kushal Borkar +
  • Leah Wasser
  • Martin Fleischmann
  • Mike Taves +
  • René Buffat +
  • Sergio Rey +
  • Thomas Pinder +
  • awa5114 +
  • donlo +
  • jbrockmendel +

Don't miss a new geopandas release

NewReleases is sending notifications on new releases.