hypertidy / lazysf

Delayed Read for GDAL Vector Data Sources

Home Page:https://hypertidy.github.io/lazysf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not working well with FlatGeoBuf, but GDAL and sf does

mdsumner opened this issue · comments

doesn't complete in reasonable time

u <- "/vsicurl/https://flatgeobuf.septima.dk/population_areas.fgb"
library(lazysf)
x <- lazysf(u)

works fine:

u <- "/vsicurl/https://flatgeobuf.septima.dk/population_areas.fgb"

library(sf)
x <- read_sf(u, query = "SELECT * FROM SELECT LIMIT 1")

I don't understand why (without having looked yet), because it should literally be equivalent to writing that SQL ... maybe the table name is not escaping

it's because the boilerplate query is

sf::st_read(f, query = "SELECT * FROM \"SELECT\" AS "q01" WHERE (0 = 1)")

and that takes forever because it's not a real database

so can we fix that boilerplate?

sf::st_read(f, query = "SELECT * FROM \"SELECT\" AS \"q01\" LIMIT 0")

currently doing a hack to sub it out, but need to find out where the boilerplate is coming from