ibis-project / ibis

the portable Python dataframe library
https://ibis-project.org
Apache License 2.0
5.33k stars 599 forks source link

feat(geospatial): accept geopandas GDFs in `memtable` #10485

Closed gforsyth closed 1 week ago

gforsyth commented 1 week ago

Description of changes

Passing a geopandas.GeoDataFrame directly to memtable will yield a bunch of errors because our various to_arrow and other proxy methods don't know how to handle the bundled geo data.

As an intermediate bit of functionality until things like geoarrow are more widely supported, this PR adds an extra dispatch to the memtable constructor to cast geometry columns to WKB, which allows most backends to ingest the resulting data with the geo columns as binary, which can then be cast to geometry columns in backends that support that.

Issues closed

Resolves #10453

cpcloud commented 1 week ago

Definitely feels like a thing that should have explicit support in duckdb/duckdb_geospatial

cpcloud commented 1 week ago

Thanks @gforsyth!