What's Changed
New features and improvements:
-
Static plotting in GeoPandas has been re-implemented. The new tooling shall be mostly
backwards compatible while bringing a set of enhancements:- Categorical plotting now allows dict-based mapping of categories to colors and
other styles. - Legends now reflect the geometry type and complete set of styles, not just a
color. - Plotting of continuous variables with a classification scheme can now produce
a colorbar instead of a categorical legend when usingcolorbar=Truewithin
legend_kwds. vminandvmaxkeywords are supported whenschemeis defined, not ignored.- When using categorical colormap with categorical plots, colors are now assigned
in order to optimize the contrast of the resulting map. - Colorbar size is automatically adjusted to be approximately the size of the plot.
- Colorbar now indicates extensions if the
vminand/orvmaxclip the values. - Legends are created automatically by matplotlib. This also means that you can
create a single legend from a layered map by callingax.legend()directly. - GeoPandas now labels axes using the information on units from CRS. This can be
controlled via theadd_labelskeyword. - Static plots can include a basemap defined by the
tileskeyword, exposing
contextily.add_basemapfrom within theplotmethod. Requirescontextily
package to be installed. schemekeyword can take a value"greedy"resulting in a greedy (topological)
coloring where no two adjacent polygons share a color. Requiresmapclassifyand
libpysalpackages.
The related refactoring of the plotting infrastructure has changed the internal
representation of the figure generated by GeoPandas. This can be considered a breaking
change if you rely the composition of collections, as that has changed. A number of
plotting-related bugs has been fixed along as a side effect. All changes are reflected
in an updated user guide.
(#3708, #3728, #3748, #3752, #3753, #3763, #3767, #3689). - Categorical plotting now allows dict-based mapping of categories to colors and
-
GeoParquet improvements:
-
Added
geopandas.make_gridandGeoSeries.make_gridto generate a square
or hexagonal grids covering the input geometry (#2062). -
Added
geopandas.read_file_infoto expose information about file layers, including layer
metadata (this is an alias forpyogrio.read_info) (#3759). -
Add
grid_sizeparameter tounion,difference,symmetric_difference
andintersection(#3593). -
Document how to access the feature ID (
fid) as the index when reading files
withread_fileand the pyogrio engine, usingfid_as_index=True(#3829).
Deprecations and compatibility notes:
- The
resolutionkeyword tobufferhas been deprecated to align with the convention in shapely,
quad_segsshould be used instead (#3600). - Expired deprecations: option
use_pygeoswhich had no functionality,
seedkeyword in sample_points (replaced byrng) (#3613).
Bug fixes:
- Fix
GeoSeries.sample_pointslooping without end on zero-area polygons, such as a
collapsed ring; it now returns an emptyMultiPoint, as it already did for empty
and missing geometries (#3851). - Fix
read_parquetignoring thepartitioningkeyword when auto-detecting
the columns to read, so thatpartitioning=Noneno longer raises (#3459). - Fix
GeoDataFrame.explode()raising a cryptic error when passing multiple
(non-geometry) columns; it now falls back to the pandas multi-column explode (#2753). - Fix
GeoDataFrame.from_featuresraising aValueErrorfor an empty list of
features when acrsis provided; it now returns an emptyGeoDataFramewith
ageometrycolumn (#3777). - Fix the index level of the parts created by
explode(index_parts=True)and
get_coordinates(index_parts=True)beingint32instead ofint64on 32-bit
platforms (#3865). - Various compatibility fixes for pandas 3.1 (#3802, #3831).
Community:
- GeoPandas now uses the NumFOCUS Code of Conduct.
- GeoPandas has a new software paper which can be used as canonical citation, see https://geopandas.org/en/latest/about/citing.html
Notes on dependencies:
- GeoPandas 1.2 now requires Python 3.11 or greater and pandas 2.2, numpy 2.0, pyproj 3.7, and
shapely 2.1, are now the minimum required version for these dependencies.
Furthermore, the minimum tested version for optional dependencies has been updated to
fiona 1.8.21, scipy 1.9, matplotlib 3.9, mapclassify 2.7 folium 0.15, pyarrow 15.0 and
SQLAlchemy 2.0. Older versions of these libraries may continue to work, but are no longer
considered supported (#3371, #3581).
Acknowledgments
Thanks to everyone who contributed to this release!
People with a "+" by their names contributed a patch for the first time.
- Achim Gädke +
- Adam J. Stewart
- Alina Cherkas +
- Alon +
- Ammar Yasser Abdel-Azim Ahmed +
- Barış Öztaş +
- Bas Couwenberg +
- CaptainInler +
- Christine P. Chai
- Dylan Pulver +
- Egor Sanin +
- Giacomo Caria
- Hans Then +
- James Gaboardi
- Joris Van den Bossche
- Julia Signell
- Karl Hill +
- Kavin +
- Khaled Hammami +
- KshitijAucharmal +
- Madhav-C +
- Martin Fleischmann
- Matt Richards
- Matteo Ghetta +
- Mike Taves
- Neil +
- Nicholas YS Tan
- Peter Nguyen +
- Pieter Roggemans
- Recoordinate +
- Ruth Comer +
- Sebastian Cao +
- Sergio P +
- Steve Berdy
- Vikram Kumar +
- Volodymyr Borysenko +
- Yunus AYDIN +
- bretttully
- janmanuelwinkler +
- moss-xyz
- yamayuki-hub +
New Contributors
- @HammamiKhaled made their first contribution in #3610
- @kshitijaucharmal made their first contribution in #3614
- @petern48 made their first contribution in #3619
- @alinacherkas made their first contribution in #3599
- @rcomer made their first contribution in #3636
- @sape94 made their first contribution in #3630
- @kavin160100 made their first contribution in #3674
- @hansthen made their first contribution in #3691
- @aydinnyunus made their first contribution in #3681
- @egorbn made their first contribution in #3684
- @sebastic made their first contribution in #3704
- @yamayuki-hub made their first contribution in #3716
- @AchimGaedkeLynker made their first contribution in #3722
- @vkverma9534 made their first contribution in #3719
- @ghtmtt made their first contribution in #3739
- @AmmarYasser455 made their first contribution in #3723
- @madhavcodez made their first contribution in #3784
- @CaptainInler made their first contribution in #3815
- @latent-9 made their first contribution in #3826
- @alonfaraj made their first contribution in #3834
- @nS-101 made their first contribution in #3829
- @cycsmail made their first contribution in #3813
- @barisoztas made their first contribution in #3792
- @karlhillx made their first contribution in #3811
- @dylanpulver made their first contribution in #3839
- @janmanuelwinkler made their first contribution in #2197
- @VolodymyrLinuxovich made their first contribution in #3871
Full Changelog: v1.1.0...v1.2.0