read_gdb: Read layers from a file geodatabase (.gdb)

View source: R/read_geo.R

read_gdbR Documentation

Read layers from a file geodatabase (.gdb)

Description

Read layers from a file geodatabase (.gdb)

Usage

read_gdb(path, layer = NULL, quiet = TRUE, ...)

Arguments

path

Path to a .gdb directory (the folder whose name ends in .gdb).

layer

If NULL (default), every layer reported by sf::st_layers() is read. If a character string, only that layer is read; it must exist in the geodatabase.

quiet

Passed to sf::read_sf().

...

Additional arguments passed to sf::read_sf().

Value

A tibble with columns fpath (path or GDAL dsn used for the layer), file_type (tools::file_ext()), layer_name, geometry_type, nrows_aka_features, ncols_aka_fields, crs_name (from st_layers()$crs when available), and data (list-column of sf::sf objects). Layers are not row-bound; differing CRS are preserved per row.

Examples


gdb <- system.file("extdata", "misc_example.gdb", package = "misc")
if (nzchar(gdb) && dir.exists(gdb)) {
  read_gdb(gdb)
  read_gdb(gdb, layer = "OGRGeoJSON")
}


misc documentation built on April 8, 2026, 9:10 a.m.