duckdb_spatial icon indicating copy to clipboard operation
duckdb_spatial copied to clipboard

ST_read with file_search_path

Open ericemc3 opened this issue 1 year ago • 5 comments

Starting from:

FROM st_read('c:/apps/datasets/IDFM-gtfs.zip', layer = 'routes')

It would be great and consistent that this could work:

SET file_search_path = 'c:/apps/datasets' ;
FROM st_read('IDFM-gtfs.zip', layer = 'routes') ;

ericemc3 avatar Jun 21 '24 11:06 ericemc3

👍 any update for this issue?

zephyring avatar Oct 10 '24 18:10 zephyring

Hi, 👍 any update or explanation for this issue?

ericemc3 avatar Jun 05 '25 04:06 ericemc3

(Sorry, I misunderstood the problem. Deleted my comment)

It seems this is difficult to fix. file_search_path is handled in LocalFileSystem::FetchFileWithoutGlob or LocalFileSystem::Glob. So, it might be possible to use this,

https://github.com/duckdb/duckdb/blob/4775cca62dc694519dd78d36f9881568dbe04430/src/common/local_file_system.cpp#L1353-L1371

however..., IIUC, ST_Read can take may other types of data source than a local filesystem, so these cannot be blindly applied to the input.

https://github.com/duckdb/duckdb-spatial/blob/f0bfd0d4a10cbd74250c91211fd04913d25064fc/src/spatial/modules/gdal/gdal_module.cpp#L572-L574

yutannihilation avatar Jun 05 '25 12:06 yutannihilation

FWIW I just migrated to use read_xlsx() as of duckdb1.2

zephyring avatar Jun 05 '25 16:06 zephyring

FWIW I just migrated to use read_xlsx() as of duckdb1.2

This isn't about Excel, but rather GTFS or GIS formats in general, for which st_read is essential...

ericemc3 avatar Jun 05 '25 19:06 ericemc3