filegdb data source reads a feature class (layer) from an Esri File Geodatabase, a .gdb directory, into a WherobotsDB DataFrame.
The reader parses the .gdb binary format directly on the JVM through the Hadoop FileSystem API. It needs no GDAL or Esri native libraries, and it reads local paths and object storage such as S3 the same way. Large layers are split into partitions that are read in parallel, and filters, column selections, and limits are applied while scanning so that attributes and geometries your query does not use are never decoded.
Usage
A File Geodatabase is a directory. Pass the.gdb directory as the load path and name the feature class to read with the required layer option:
- Python
- Scala
- Java
SHAPE) as a geometry column that works with every ST_* function. The geometry column carries the layer’s spatial reference as an SRID, taken from the geodatabase’s well-known ID or identified from its coordinate system WKT. See Data types for the type mapping and Spatial reference for how the SRID is resolved.
Each load() reads one feature class. To read several feature classes from the same geodatabase, call the reader once per layer.
Example: Census TIGER/Line geodatabase
The U.S. Census Bureau publishes TIGER/Line geodatabases as zipped.gdb directories. Each state has an edges geodatabase, such as tlgdb_2023_a_44_ri_edges.gdb.zip for Rhode Island, whose single feature class All_Lines holds every linear feature in the state: roads, rail, hydrography, and boundary lines. Unzip it to your storage, read the feature class, and run spatial SQL on it:
MTFCC LIKE 'S1%' predicate selects the road classes and is pushed into the scan, so the geometries of the other features are never decoded. The Census geodatabases record their coordinate system (NAD83) as WKT without a well-known ID; the reader identifies it as EPSG:4269, so ST_Transform needs only the target CRS. See Spatial reference.
Finding feature class names
If thelayer option names a feature class that does not exist, the error lists the feature classes in the geodatabase:
GDB_*) and attachment tables are not listed.
Options
Option names are case-insensitive.Data types
Raster fields are not supported: reading a feature class that contains one fails at schema inference with a clear message. Field types introduced in ArcGIS Pro 3.2 (64-bit integer, date only, time only, timestamp offset) are not supported either.
Spatial reference
The SRID of the geometry column is resolved in this order:- The
LatestWKID, then theWKID, that the geodatabase’sGDB_Itemscatalog records for the layer. - An
AUTHORITY["EPSG", ...]entry in the layer’s coordinate system WKT, in theGDB_Itemscatalog or in the shape field’s definition. - Identification of the coordinate system WKT itself against the EPSG registry. This covers geodatabases that record only Esri-style WKT with no well-known ID, such as the Census TIGER/Line files (
GCS_North_American_1983resolves to 4269), and Esri-named projected systems such asNAD_1983_UTM_Zone_19Nor State Plane zones.
ST_SetSRID or pass the source CRS to ST_Transform explicitly:
Exterior rings and holes are distinguished by their orientation, so polygons decode with the correct outer boundaries and holes. Only X and Y coordinates are decoded: Z and M values are dropped. Features with a null shape produce a null geometry, and rows deleted in the geodatabase are skipped.
Pushdown and parallelism
- Filter pushdown. Predicates on numeric, text, GUID, and Object ID fields are evaluated inside the scan, before the geometry is decoded:
=,<,<=,>,>=,IN,IS NULL,IS NOT NULL,AND,OR,NOT, and theLIKE-stylestartsWith,endsWith, andcontainson text fields. Predicates on date, blob, or geometry columns, and anything else the scan cannot evaluate, are still applied by Spark, so results are always correct. - Column pruning. Only the selected fields are decoded. Leaving the geometry column out of a query skips geometry decoding entirely, and selecting only the geometry skips every attribute.
- Limit pushdown.
LIMIT nstops the scan afternrows.
numPartitions when set, otherwise the row-index size divided by maxPartitionRows, rounded up. With the default maxPartitionRows of 500,000, a layer splits only once it has more than 500,000 row-index entries; a statewide TIGER/Line layer of 138,191 features reads in a single partition unless numPartitions is set. Row-index entries include deleted rows, so a partition can hold fewer live features than the bound. Asking for more partitions than there are row-index entries yields one partition per entry, never an empty partition, so the row-index size is the only ceiling on numPartitions. A query with a pushed LIMIT reads in a single partition regardless of these options.
Spatial predicates such as
ST_Intersects are WherobotsDB SQL functions rather than Spark data source filters, so Spark evaluates them after the scan. The geodatabase’s spatial index is not used.Limitations
- Read-only. The reader does not write File Geodatabases.
- One feature class per
load(). - The
.gdbdirectory must be unzipped. Zipped geodatabases are not read directly; pointing the reader at a.gdb.zipfails with a missing-layer error that lists no feature classes. - True curve segments (circular arcs, ellipses, Bézier curves) in polyline and polygon shapes are not supported. Reading a shape that contains them raises an error instead of silently approximating the curve. Linearize such layers first, for example with
ogr2ogr -nlt CONVERT_TO_LINEAR. Layers written by ArcGIS that merely flag curve support without containing curves, which is common, read normally. - Z and M values are dropped.
- Raster fields and the ArcGIS Pro 3.2 field types listed above are not supported.
- A coordinate system that matches no EPSG definition, such as a custom projection, produces geometries with SRID 0. See Spatial reference.
Related
- Load from File Geodatabase in the vector data loading tutorial
- STAC Reader

