Repository: Zeroto521/my-data-toolkit

Issue:
EHN: New geoaccessor `toposimiplify`
<!--
Thanks for contributing a pull request!

Please follow these standard acronyms to start the commit message:

- ENH: enhancement
- BUG: bug fix
- DOC: documentation
- TYP: type annotations
- TST: addition or modification of tests
- MAINT: maintenance commit (refactoring, typos, etc.)
- BLD: change related to building
- REL: related to releasing
- API: an (incompatible) API change
- DEP: deprecate something, or remove a deprecated object
- DEV: development tool or utility
- REV: revert an earlier commit
- PERF: performance improvement
- BOT: always commit via a bot
- CI: related to CI or CD
- CLN: Code cleanup
-->

- [ ] closes #xxxx
- [x] whatsnew entry

simplify multi-geometries method but could keep the shared edges


Discussion:
# [Codecov](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/624?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero) Report
> Merging [#624](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/624?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero) (d8c806f) into [main](https://codecov.io/gh/Zeroto521/my-data-toolkit/commit/18643cada117347335d4de41387baf9ccd933e23?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero) (18643ca) will **increase** coverage by `0.01%`.
> The diff coverage is `100.00%`.

```diff
@@            Coverage Diff             @@
##             main     #624      +/-   ##
==========================================
+ Coverage   99.27%   99.28%   +0.01%     
==========================================
  Files         106      108       +2     
  Lines        1236     1262      +26     
  Branches      116      116              
==========================================
+ Hits         1227     1253      +26     
  Misses          3        3              
  Partials        6        6              
```


| [Impacted Files](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/624?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero) | Coverage Δ | |
|---|---|---|
| [dtoolkit/geoaccessor/geodataframe/\_\_init\_\_.py](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/624/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero#diff-ZHRvb2xraXQvZ2VvYWNjZXNzb3IvZ2VvZGF0YWZyYW1lL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | |
| [dtoolkit/geoaccessor/geodataframe/toposimplify.py](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/624/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero#diff-ZHRvb2xraXQvZ2VvYWNjZXNzb3IvZ2VvZGF0YWZyYW1lL3RvcG9zaW1wbGlmeS5weQ==) | `100.00% <100.00%> (ø)` | |
| [dtoolkit/geoaccessor/geoseries/\_\_init\_\_.py](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/624/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero#diff-ZHRvb2xraXQvZ2VvYWNjZXNzb3IvZ2Vvc2VyaWVzL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | |
| [dtoolkit/geoaccessor/geoseries/toposimplify.py](https://codecov.io/gh/Zeroto521/my-data-toolkit/pull/624/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero#diff-ZHRvb2xraXQvZ2VvYWNjZXNzb3IvZ2Vvc2VyaWVzL3RvcG9zaW1wbGlmeS5weQ==) | `100.00% <100.00%> (ø)` | |

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. [Learn more](https://about.codecov.io/product/feature/runtime-insights/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Zero)


Resolving patch:
diff --git a/dtoolkit/geoaccessor/geoseries/toposimplify.py b/dtoolkit/geoaccessor/geoseries/toposimplify.py
--- a/dtoolkit/geoaccessor/geoseries/toposimplify.py
+++ b/dtoolkit/geoaccessor/geoseries/toposimplify.py
@@ -20,7 +20,12 @@ def toposimplify(
     prevent_oversimplify: bool = True,
 ) -> gpd.GeoSeries:
     """
-    Apply :func:`topojson.Topology.toposimplify` to {klass} to keep **shared edges**.
+    Returns a {klass} containing a simplified representation of each geometry.
+    Similar to :meth:`~geopandas.GeoSeries.simplify`, but keeps shared edges.
+
+    .. image:: ../../../../_static/simplify-vs-toposimplify.png
+        :width: 80%
+        :align: center
 
     Parameters
     ----------
@@ -89,30 +94,6 @@ def toposimplify(
     13  52573973.0  ...  POLYGON ((39.20220 -4.67675, 39.60493 -4.34650...
     <BLANKLINE>
     [5 rows x 6 columns]
-
-    .. plot::
-
-        import dtoolkit.geoaccessor
-        import geopandas as gpd
-        import matplotlib.pyplot as plt
-
-
-        df = (
-            gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
-            .query('continent == "Africa"')
-        )
-
-        fig, (ax1, ax2) = plt.subplots(ncols=2, sharex=True, sharey=True)
-
-        df.simplify(1).plot(ax=ax1, alpha=0.7)
-        df.toposimplify(1).plot(ax=ax2, alpha=0.7)
-
-        ax1.set_title("simplify")
-        ax1.set_axis_off()
-        ax2.set_title("toposimplify")
-        ax2.set_axis_off()
-        fig.tight_layout()
-        plt.show()
     """
     from topojson import Topology
 


Test patch: