Created
February 26, 2025 17:13
-
-
Save mhweber/cb1c0481af9210cdeae30318ab1a3d9a to your computer and use it in GitHub Desktop.
sf read all layers in a geopackage or geodatabase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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