Bas Couwenberg pushed to branch master at Debian GIS Project / python-geopandas
Commits: fa536cfb by Bas Couwenberg at 2024-01-05T06:30:08+01:00 New upstream version 0.14.2 - - - - - 85021f47 by Bas Couwenberg at 2024-01-05T06:30:30+01:00 Update upstream source from tag 'upstream/0.14.2' Update to upstream version '0.14.2' with Debian dir 940c98a230a2e17032fcbba1c859b1b9a9a0b6cf - - - - - fa11c4e4 by Bas Couwenberg at 2024-01-05T06:31:39+01:00 New upstream release. - - - - - 2f22a819 by Bas Couwenberg at 2024-01-05T06:32:46+01:00 Set distribution to unstable. - - - - - 6 changed files: - CHANGELOG.md - debian/changelog - geopandas/_version.py - geopandas/explore.py - geopandas/tests/test_explore.py - geopandas/tools/overlay.py Changes: ===================================== CHANGELOG.md ===================================== @@ -1,5 +1,11 @@ # Changelog +## Version 0.14.2 (Jan 4, 2024) + +- Fix regression in `overlay` where using `buffer(0)` instead of `make_valid` internally + produced invalid results (#3074). +- Fix `explore()` method when the active geometry contains missing and empty geometries (#3094). + ## Version 0.14.1 (Nov 11, 2023) - The Parquet and Feather IO functions now support the latest 1.0.0 version ===================================== debian/changelog ===================================== @@ -1,3 +1,10 @@ +python-geopandas (0.14.2-1) unstable; urgency=medium + + * Team upload. + * New upstream release. + + -- Bas Couwenberg <[email protected]> Fri, 05 Jan 2024 06:32:36 +0100 + python-geopandas (0.14.1-1) unstable; urgency=medium * Team upload. ===================================== geopandas/_version.py ===================================== @@ -25,9 +25,9 @@ def get_keywords() -> Dict[str, str]: # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). - git_refnames = " (tag: v0.14.1, 0.14.x)" - git_full = "9a9f0974db087ce303b94bfbeabc8ea136be0914" - git_date = "2023-11-11 10:29:16 +0100" + git_refnames = " (tag: v0.14.2, 0.14.x)" + git_full = "fb079bf07adb889a720532d871798d75c90f50b5" + git_date = "2024-01-04 22:30:04 +0100" keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} return keywords ===================================== geopandas/explore.py ===================================== @@ -618,7 +618,9 @@ def _explore( tooltip = None popup = None # escape the curly braces {{}} for jinja2 templates - feature_collection = gdf.__geo_interface__ + feature_collection = gdf[ + ~(gdf.geometry.isna() | gdf.geometry.is_empty) # drop missing or empty geoms + ].__geo_interface__ for feature in feature_collection["features"]: for k in feature["properties"]: # escape the curly braces in values ===================================== geopandas/tests/test_explore.py ===================================== @@ -2,6 +2,7 @@ import geopandas as gpd import numpy as np import pandas as pd import pytest +import shapely from packaging.version import Version folium = pytest.importorskip("folium") @@ -940,3 +941,17 @@ class TestExplore: "zoom_control": False, } ) + + def test_none_geometry(self): + # None and empty geoms are dropped prior plotting + df = self.nybb.copy() + df.loc[0, df.geometry.name] = None + m = df.explore() + self._fetch_map_string(m) + + def test_empty_geometry(self): + # None and empty geoms are dropped prior plotting + df = self.nybb.copy() + df.loc[0, df.geometry.name] = shapely.Point() + m = df.explore() + self._fetch_map_string(m) ===================================== geopandas/tools/overlay.py ===================================== @@ -4,7 +4,6 @@ from functools import reduce import numpy as np import pandas as pd -from geopandas import _compat as compat from geopandas import GeoDataFrame, GeoSeries from geopandas.array import _check_crs, _crs_mismatch_warn @@ -94,10 +93,8 @@ def _overlay_difference(df1, df2): new_g.append(new) differences = GeoSeries(new_g, index=df1.index, crs=df1.crs) poly_ix = differences.geom_type.isin(["Polygon", "MultiPolygon"]) - if compat.USE_PYGEOS: - differences.loc[poly_ix] = differences[poly_ix].make_valid() - else: - differences.loc[poly_ix] = differences[poly_ix].buffer(0) + differences.loc[poly_ix] = differences[poly_ix].make_valid() + geom_diff = differences[~differences.is_empty].copy() dfdiff = df1[~differences.is_empty].copy() dfdiff[dfdiff._geometry_column_name] = geom_diff View it on GitLab: https://salsa.debian.org/debian-gis-team/python-geopandas/-/compare/4247f126aa19f1e3bb647728b98b7f45b1443eca...2f22a8199af9747fdc327bdac18007114caf93ff -- View it on GitLab: https://salsa.debian.org/debian-gis-team/python-geopandas/-/compare/4247f126aa19f1e3bb647728b98b7f45b1443eca...2f22a8199af9747fdc327bdac18007114caf93ff You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ Pkg-grass-devel mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-grass-devel
