Fix render_shapes losing transformation after groups filtering#564
Open
Fix render_shapes losing transformation after groups filtering#564
Conversation
Move _prepare_transformation() call to before the groups filtering block so the coordinate-system transformation is captured while the element's metadata is still intact. The GeoDataFrame re-wrap that follows groups filtering strips .attrs, which would lose the transformation if read afterwards. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #564 +/- ##
=======================================
Coverage 74.06% 74.06%
=======================================
Files 10 10
Lines 2826 2826
Branches 651 651
=======================================
Hits 2093 2093
Misses 457 457
Partials 276 276
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
global#447 regression)_prepare_transformation()call in_render_shapes()to before the groups filtering block, so the coordinate-system transformation is captured while the element's.attrsmetadata is still intactGeoDataFrame()re-wrap that follows groups filtering strips.attrs, which would silently lose the transformation if read afterwardsRoot cause
In
_render_shapes, the transformation was read after groups filtering and agpd.GeoDataFrame()re-wrap that strips.attrs. With current geopandas/pandas,.attrshappen to survive boolean indexing +reset_index(), but this is documented as experimental. TheGeoDataFrame()constructor definitively strips them. Moving the read earlier makes the code robust regardless of pandas.attrspropagation behavior.