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

ST_Read crashes duckdb on Windows (but not Linux!) when reading from GeoJSON API #289

Closed
daviewales opened this issue Mar 22, 2024 · 4 comments

Comments

@daviewales
Copy link

To reproduce, run the following:

load httpfs;
load spatial;
SELECT * FROM ST_Read('https://services5.arcgis.com/OvOcYIrJnM97ABBA/ArcGIS/rest/services/Primary_Health_Network_2023/FeatureServer/0/query?where=PHN_CODE=%27PHN108%27&outFields=*&returnGeometry=true&f=geojson');

Expected:

┌────────────┬──────────────────────┬──────────┬─────────────────┬───┬──────────────────────┬──────────────────┬──────────────────┬──────────────────────┐
│ OBJECTID_1 │       PHN_NAME       │ PHN_CODE │    STE_NAME     │ … │       WEBSITE        │   Shape__Area    │  Shape__Length   │         geom         │
│   int32    │       varchar        │ varchar  │     varchar     │   │       varchar        │      double      │      double      │       geometry       │
├────────────┼──────────────────────┼──────────┼─────────────────┼───┼──────────────────────┼──────────────────┼──────────────────┼──────────────────────┤
│          1 │ Hunter New England…  │ PHN108   │ New South Wales │ … │ https://thephn.com…  │ 12.5523589729341 │ 38.0504026046165 │ MULTIPOLYGON (((15…  │
├────────────┴──────────────────────┴──────────┴─────────────────┴───┴──────────────────────┴──────────────────┴──────────────────┴──────────────────────┤
│ 1 rows                                                                                                                            15 columns (8 shown) │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Actual:

DuckDB crashes with no output.

Note that the above works perfectly in my WSL Linux version of duckdb.

Version Info:

OS: Windows 11
DuckDB version: v0.10.0 20b1486d11
spatial extension version: latest using FORCE INSTALL spatial FROM 'http://nightly-extensions.duckdb.org'; (Also broken with regular INSTALL spatial;)
httpfs extension version: current release (whatever you get with INSTALL httpfs;)

@cxcandid
Copy link

cxcandid commented Apr 17, 2024

Another option would be to use GDAL '/vsicurl/' to load remote data.

load spatial;
SELECT * FROM ST_Read('/vsicurl/https://services5.arcgis.com/OvOcYIrJnM97ABBA/ArcGIS/rest/services/Primary_Health_Network_2023/FeatureServer/0/query?where=PHN_CODE=%27PHN108%27&outFields=*&returnGeometry=true&f=geojson');

I had a similar problem yesterday, when I tried to fetch data from OSM Nominatim:

install spatial;
load spatial;
COPY (SELECT ST_Transform(geom,'EPSG:4326','EPSG:31287',true) as geom from ST_Read('/vsicurl/https://nominatim.openstreetmap.org/[email protected]&q=Austria&format=geojson&polygon_geojson=1&featureType=country&polygon_threshold=0.01')) to 'd:/austria.dxf' with (Format GDAL, Driver 'DXF');

@carlopi
Copy link
Contributor

carlopi commented Sep 16, 2024

Hi @daviewales, can I ask whether this still reproduces ?
Possibly via a FORCE INSTALL httpfs?

Thanks a lot

@daviewales
Copy link
Author

Thanks, this no longer crashes!

@carlopi
Copy link
Contributor

carlopi commented Sep 18, 2024

I think this was connected to duckdb/duckdb#13848, but should now be fixed.

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

No branches or pull requests

3 participants