Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ST_Read_Meta, don't throw in GDAL filesystem stat #227

Merged
merged 5 commits into from
Jan 10, 2024
Merged

Conversation

Maxxen
Copy link
Member

@Maxxen Maxxen commented Jan 10, 2024

This PR adds a new st_read_meta table function to read the metadata present in files readable by st_read.
The output is similar to what you would get with ogrinfo -json but some fields are still missing. (like e.g. metadata ironically). Still, this finally allows you to inspect the projection info of a GDAL dataset layer from within DuckDB.

Closes #156

Also implements a small fix in the gdal virtual filesystem layer so that a failed stat call doesn't throw but instead returns -1.

@cboettig
Copy link

@Maxxen is this available in the nightlies? I'm trying to test with:

FORCE INSTALL 'spatial' FROM 'http://nightly-extensions.duckdb.org';
LOAD 'spatial'

But I still get the error:

Error: Catalog Error: Table Function with name st_read_meta does not exist!
Did you mean "st_read"?

@Maxxen
Copy link
Member Author

Maxxen commented Feb 27, 2024

@cboettig What version are you on? Seems to work for me on v0.9.2
image

As well as on V0.10.0
image

@cboettig
Copy link

my apologies! just updated and it's working now, (v0.9.2) thanks.

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.

Provide a way to get the CRS data from st_read
2 participants