add geometrycolumn kwarg to write#134
Open
asinghvi17 wants to merge 6 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
asinghvi17
added a commit
to evetion/GeoDataFrames.jl
that referenced
this pull request
Jun 25, 2026
Shapefile.jl JuliaGeo/Shapefile.jl#134 will accept the `:geometrycolumn` kwarg so this adds support for that, it also accepts `crs` already.
The geometrycolumn kwarg defaulted to first(GI.geometrycolumns(obj)), which was evaluated for every write call. For non-table inputs (missing, single geometries, features, iterators) GI.geometrycolumns can return nothing on older GeoInterface versions, so first(nothing) threw MethodError: no method matching iterate(::Nothing) — breaking CI on Julia 1.9 and lts at the very first round-trip test. Default to nothing and resolve the geometry column lazily inside the table branch, guarding GI.geometrycolumns against a nothing return. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Covers the warning + auto-detection branch when an explicit geometrycolumn isn't present in the table. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When a table has multiple geometry columns and none is specified, the writer warned and used the first but only deleted that one — leaking the other geometry column(s) into the DBF (written as stringified geometries). Drop every detected geometry column instead, matching pre-kwarg behavior. Adds a test covering the multiple-geometry-column branch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rafaqz
approved these changes
Jun 26, 2026
evetion
pushed a commit
to evetion/GeoDataFrames.jl
that referenced
this pull request
Jun 26, 2026
* Simplify GeoParquet write function In JuliaGeo/GeoParquet.jl@2e52f16 I removed the requirement to have the `geocolumns` positional arg, so this removes that and leans on GeoParquet's natural kwargs. * Add maxlog to the FlatGeobuf writer warning * Globals should be const and capitalized * Forward looking change from Shapefile.jl Shapefile.jl JuliaGeo/Shapefile.jl#134 will accept the `:geometrycolumn` kwarg so this adds support for that, it also accepts `crs` already.
A shapefile stores one geometry per record. When a table has multiple geometry columns and the caller didn't specify one, error and ask them to pass `geometrycolumn` rather than silently picking the first and discarding the rest. All detected geometry columns are now dropped from the feature table regardless of how the geometry column was chosen, so a secondary geometry column never leaks into the .dbf. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
could use tests if anyone has five minutes
fixes #132