polygonize: document that column_name is also used for geojson output#3309
Open
brendancol wants to merge 2 commits into
Open
polygonize: document that column_name is also used for geojson output#3309brendancol wants to merge 2 commits into
brendancol wants to merge 2 commits into
Conversation
…#3306) The column_name docstring claimed it was only used for the geopandas and spatialpandas return types, but _to_geojson uses it as the property key on every feature. Correct the docstring and pin the geojson property naming with a test.
brendancol
commented
Jun 12, 2026
brendancol
left a comment
Contributor
Author
There was a problem hiding this comment.
Review of the docstring fix and test.
Blockers: none.
Suggestions: none. The new wording matches what _to_geojson actually does (property key per feature), and the test pins both the key and the values so the docs can't silently drift again.
Nits:
- The Returns section's geojson bullet ("dict representing a GeoJSON FeatureCollection") could also name
column_nameas the property key, but the parameter doc now covers it, so this is optional.
Checked: _to_geopandas / _to_spatialpandas / _to_geojson call sites all consume column_name; "awkward" and "numpy" do not, consistent with the new wording. Test values [0, 1, 4] match the existing test_polygonize_geojson expectations for the same fixture.
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.
Closes #3306
column_namedocstring said the parameter was only used whenreturn_typeis "geopandas" or "spatialpandas". The geojson path uses it too:_to_geojsonwrites it as the property key on every feature. The docstring now says so.test_polygonize_geojson_column_nameto pin the geojson property naming, so the docs and the behavior can't drift apart again.Docs-only change to the function body; no backend code touched (numpy / cupy / dask+numpy / dask+cupy all share the same return_type dispatch).
Test plan:
pytest xrspatial/tests/test_polygonize.py -k "geojson or invalid_return_type"(11 passed)Found by the api-consistency sweep against the polygonize module.