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

support st_read() in open_dataset() #15

Merged
merged 5 commits into from
Nov 23, 2023
Merged

support st_read() in open_dataset() #15

merged 5 commits into from
Nov 23, 2023

Conversation

cboettig
Copy link
Owner

@cboettig cboettig commented Nov 22, 2023

url <- 
 paste0("https://github.com/cboettig/duckdbfs/raw/25744032021cc2b9bbc560f95b77b3eb088c9abb/inst/extdata/",
 "world.gpkg")

# read from a geopackage file over https:
countries <-  paste0("/vsicurl/", url) |> open_dataset(format="sf")

# perform spatial ops outside of R / outside of RAM
library(sf)
melbourne <- st_point(c(144.9633, -37.814)) |> st_as_text()
countries |> 
  filter(st_contains(geom, ST_GeomFromText({melbourne})))  

# and read in:
sf_obj <- countries |> filter(continent == "Africa") |> to_sf() 

@cboettig cboettig marked this pull request as ready for review November 23, 2023 05:17
@cboettig cboettig merged commit 1a593ea into main Nov 23, 2023
6 checks passed
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

Successfully merging this pull request may close these issues.

1 participant