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

Relative paths behave differently with spatial extension than with others #308

Open
jaanli opened this issue Apr 21, 2024 · 2 comments
Open

Comments

@jaanli
Copy link

jaanli commented Apr 21, 2024

Example:

GDB data:

wget https://s-media.nyc.gov/agencies/dcp/assets/files/zip/data-tools/bytes/nyc_mappluto_24v1_fgdb.zip -O /tmp/nyc_mappluto_24v1_fgdb.zip
unzip -o /tmp/nyc_mappluto_24v1_fgdb.zip -d ~/data/nyc_mappluto_24v1_fgdb

DuckDB usage:

SELECT * FROM ST_READ('/Users/me/data/nyc_mappluto_24v1_fgdb/MapPLUTO24v1.gdb')

The above works, but with read_csv and others, relative paths are accepted. (Was getting uninformative errors when using SELECT * FROM ST_READ('~/data/nyc_mappluto_24v1_fgdb/MapPLUTO24v1.gdb') as I am more used to DuckDB vs spatial duckdb syntax)

Thank you for an awesome extension!! It's leading to this: https://jaanli.github.io/new-york-real-estate/

@Maxxen
Copy link
Member

Maxxen commented Apr 22, 2024

Hi! Thanks for reporting this issue.
I can't reproduce this on macOS, are you sure the relative path is correct? What OS are you on?

@jaanli
Copy link
Author

jaanli commented Apr 22, 2024

Weird!! Might be on my end then.

I'm on MacOS indeed, latest version.

I installed the latest duckdb via homebrew, and ran:

D INSTALL spatial;
D LOAD spatial;
D SELECT * FROM ST_READ('~/data/nyc_mappluto_24v1_fgdb/MapPLUTO24v1.gdb');
IO Error: GDAL Error (4): `~/data/nyc_mappluto_24v1_fgdb/MapPLUTO24v1.gdb' not recognized as a supported file format.
D SELECT * FROM ST_READ('/Users/me/data/nyc_mappluto_24v1_fgdb/MapPLUTO24v1.gdb')
  ;
100% ▕████████████████████████████████████████████████████████████▏
┌─────────┬───────┬───┬────────────┬─────────────────┬──────────────────────┐
│ Borough │ Block │ … │ Shape_Leng │   Shape_Area    │        Shape         │
│ varchar │ int32 │   │   double   │     double      │       geometry       │
├─────────┼───────┼───┼────────────┼─────────────────┼──────────────────────┤

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

No branches or pull requests

2 participants