Skip to content

CRS /schema error on read for geospatial data #375

Closed

Description

@knaaptime

What happens?

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.

To Reproduce

import duckdb
df = duckdb.read_parquet("s3://spatial-ucr/census/administrative/counties.parquet")
df.df()

this works fine on 1.4.4 and gives a table like this

Image

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

(happening on all architectures)

OS:

osx

DuckDB Package Version:

1.5

Python Version:

3.14

Full Name:

eli knaap

Affiliation:

uci

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration to reproduce the issue?

  • Yes, I have

Activity

  1. changed the title [-]CRS /schema error on read[/-] [+]CRS /schema error on read for geospatial data[/+] on Mar 11, 2026
  2. evertlammerts commented on Mar 19, 2026

    @evertlammerts
    Member

    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:

    import duckdb
    
    # Use ST_AsWKT to get Well-Known Text
    df = duckdb.sql("""
        SELECT *, ST_AsWKT(geometry) as geometry_wkt
        FROM read_parquet('s3://spatial-ucr/census/administrative/counties.parquet')
    """).df()
    
    # Or cast to VARCHAR
    df = duckdb.sql("""
        SELECT geometry::VARCHAR as geometry
        FROM read_parquet('s3://spatial-ucr/census/administrative/counties.parquet')
    """).df()
  3. knaaptime commented on Mar 19, 2026

    @knaaptime
    Author

    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?

    also, thanks for the workaround!

  4. evertlammerts commented on Mar 20, 2026

    @evertlammerts
    Member

    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?

    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:

    import duckdb
    from shapely import from_wkb
    conn = duckdb.connect()
    
    # Using a dataframe
    df = 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 types
    res = 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions