You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CRS /schema error on read for geospatial data #375
Hi, thanks for all your work on this. I think the recent 1.5 release induced a bug related to how CRS attributes in the schema are stored or read, which prevents reading geospatial data from parquet files.
this works fine on 1.4.4 and gives a table like this
but using duckdb version 1.5 gives
NotImplementedException: Not implemented Error: Unsupported type "GEOMETRY('{"$schema":"https://proj.org/schemas/v0.7/projjson.schema.json","type":"GeographicCRS","name":"WGS 84","datum":{"type":"GeodeticReferenceFrame","name":"World Geodetic System 1984","ellipsoid":{"name":"WGS 84","semi_major_axis":6378137,"inverse_flattening":298.257223563}},"coordinate_system":{"subtype":"ellipsoidal","axis":[{"name":"Geodetic latitude","abbreviation":"Lat","direction":"north","unit":"degree"},{"name":"Geodetic longitude","abbreviation":"Lon","direction":"east","unit":"degree"}]},"scope":"unknown","area":"World","bbox":{"south_latitude":-90,"west_longitude":-180,"north_latitude":90,"east_longitude":180},"id":{"authority":"EPSG","code":4326}}')" for DuckDB -> NumPy conversion
Thanks for reporting. This is a known regression caused by the new CRS support added to GEOMETRY types in DuckDB 1.5 (duckdb/duckdb#20143). The Python client's type conversion doesn't have a handler for GEOMETRY types, so they fall through to an "Unsupported type" error.
A workaround while we work on adding support for these types in Python is to convert the geometry column to text or WKB before fetching:
importduckdb# Use ST_AsWKT to get Well-Known Textdf=duckdb.sql(""" SELECT *, ST_AsWKT(geometry) as geometry_wkt FROM read_parquet('s3://spatial-ucr/census/administrative/counties.parquet')""").df()
# Or cast to VARCHARdf=duckdb.sql(""" SELECT geometry::VARCHAR as geometry FROM read_parquet('s3://spatial-ucr/census/administrative/counties.parquet')""").df()
cool, thanks for the update! (I forgot about the spatial repo, otherwise would've opened over there). Should I go ahead and close in favor of duckdb/duckdb-spatial#766?
cool, thanks for the update! (I forgot about the spatial repo, otherwise would've opened over there). Should I go ahead and close in favor of duckdb/duckdb-spatial#766?
I've also added basic support for the GEOMETRY type back into the v1.5-variegata branch, so that you can do at least things like:
importduckdbfromshapelyimportfrom_wkbconn=duckdb.connect()
# Using a dataframedf=conn.sql("select 'POINT(0 1)'::GEOMETRY as geom;").df()
wkb_data=bytes(df['geom'].iloc[0])
shape=from_wkb(wkb_data)
print(shape.wkt)
# Or just plain python typesres=conn.execute("SELECT 'POINT(0 2)'::GEOMETRY as geom;").fetchall()
shape2=from_wkb(res[0][0])
print(shape2.wkt)
POINT (0 1)
POINT (0 2)
This will be available in 1.5.1, which is scheduled for next week.
Activity
[-]CRS /schema error on read[/-][+]CRS /schema error on read for geospatial data[/+]evertlammerts commentedon Mar 19, 2026
Thanks for reporting. This is a known regression caused by the new CRS support added to GEOMETRY types in DuckDB 1.5 (duckdb/duckdb#20143). The Python client's type conversion doesn't have a handler for GEOMETRY types, so they fall through to an "Unsupported type" error.
This is a duplicate of duckdb/duckdb-spatial#766. BTW: the verbose type string you're seeing (the full PROJJSON blob) is also discussed in duckdb/duckdb-spatial#765.
A workaround while we work on adding support for these types in Python is to convert the geometry column to text or WKB before fetching:
knaaptime commentedon Mar 19, 2026
cool, thanks for the update! (I forgot about the
spatialrepo, otherwise would've opened over there). Should I go ahead and close in favor of duckdb/duckdb-spatial#766?also, thanks for the workaround!
evertlammerts commentedon Mar 20, 2026
Yes, let's track this in duckdb/duckdb-spatial#766.
I've also added basic support for the GEOMETRY type back into the v1.5-variegata branch, so that you can do at least things like:
This will be available in 1.5.1, which is scheduled for next week.