-
Notifications
You must be signed in to change notification settings - Fork 301
Open
Labels
featurea feature request or enhancementa feature request or enhancement
Description
Hi, I know it exists the options
for st_read
, but after testing it, seems is not to pass options as read options, or something seems to be not working.
I'm using the query
param, which usually works, but some queries need to use in GDAL -dialect sqlite
to works, I have played with options
with... c("-dialect", "sqlite")
, c("dialect", "sqlite")
, c("-dialect"="sqlite")
, c("dialect"="sqlite")
and -dialect sqlite
, but seems to now works.
Here a sample:
file_path <- "test.shp"
a <- sf::st_sf(
id = c(1, 3, 3),
geometry = sf::st_sfc(
sf::st_point(),
sf::st_point(),
sf::st_point()
)
)
sf::st_write(a, file_path, layer = "layer")
sf::st_read(
file_path,
query = 'SELECT 1 FROM (SELECT COUNT(*) count FROM "layer" GROUP BY "id") x WHERE count > 1',
options = c("-dialect", "sqlite")
)
This query will fails without using the sqlite
dialect.
Thx!
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancement