Skip to content

Instantly share code, notes, and snippets.

@mhweber
Created February 26, 2025 17:13
Show Gist options
  • Save mhweber/cb1c0481af9210cdeae30318ab1a3d9a to your computer and use it in GitHub Desktop.
Save mhweber/cb1c0481af9210cdeae30318ab1a3d9a to your computer and use it in GitHub Desktop.
sf read all layers in a geopackage or geodatabase
names <- st_layers('location/geopackage.gpkg')$name
names <- names[grep("points",names)] # grep for something
result <- purrr::map(names,~read_sf(dsn='location/geopackage.gpkg',layer=.))
result <- bind_rows(result)
glimpse(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment