duckdb / duckdb/duckdb-spatial

Specify format to ST_READ when feeding data via stdin?

Open
#117 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
708
Forks
96
Avg merge
1d 21h
Merged PRs (30d)
5

Description

Can `ST_READ` be given a file format or can that only be inferred from a filename? I was hoping something like the following would work but I'm getting ```ERROR 4: `/dev/stdin' not recognized as a supported file format.```

```bash
$ unzip -p test.zip land.gpkg \
| ~/duckdb_spatial/build/release/duckdb \
-unsigned \
-json \
-c "SELECT * EXCLUDE(geom),
ST_AsHEXWKB(
ST_GeomFromWkb(geom))::TEXT AS geom,
printf('%x', h3_latlng_to_cell(
ST_Y(ST_CENTROID(ST_GeomFromWkb(geom))),
ST_X(ST_CENTROID(ST_GeomFromWkb(geom))),
7)::bigint) as h3_7,
printf('%x', h3_latlng_to_cell(
ST_Y(ST_CENTROID(ST_GeomFromWkb(geom))),
ST_X(ST_CENTROID(ST_GeomFromWkb(geom))),
8)::bigint) as h3_8,
printf('%x', h3_latlng_to_cell(
ST_Y(ST_CENTROID(ST_GeomFromWkb(geom))),
ST_X(ST_CENTROID(ST_GeomFromWkb(geom))),
9)::bigint) as h3_9
FROM st_read('/dev/stdin')" \
| jq -S .
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.