Skip to content

add geometrycolumn kwarg to write#134

Open
asinghvi17 wants to merge 6 commits into
mainfrom
as/geometrycolumn
Open

add geometrycolumn kwarg to write#134
asinghvi17 wants to merge 6 commits into
mainfrom
as/geometrycolumn

Conversation

@asinghvi17

@asinghvi17 asinghvi17 commented Apr 24, 2025

Copy link
Copy Markdown
Member

could use tests if anyone has five minutes

fixes #132

asinghvi17 and others added 2 commits April 23, 2025 23:02
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.
asinghvi17 and others added 3 commits June 25, 2026 16:00
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>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

geometrycolumn kwarg to write

2 participants