ESRI File Geodatabase (FileGDB)

The FileGDB driver provides read and write access to File Geodatabases (.gdb directories) created by ArcGIS 10 and above.

Note : starting with OGR 1.11, the OpenFileGDB driver driver exists as an alternative built-in i.e. not depending on a third-party library) read-only driver.

Requirements

Bulk feature loading (OGR >= 1.9.2)

The FGDB_BULK_LOAD configuration option can be set to YES to speed-up feature insertion (or sometimes solve problems when inserting a lot of features (see http://trac.osgeo.org/gdal/ticket/4420). The effect of this configuration option is to cause a write lock to be taken and a temporary disabling of the indexes. Those are restored when the datasource is closed or when a read operation is done.

Starting with GDAL 2.0, bulk load is enabled by default for newly created layers (unless otherwise specified).

SQL support (OGR >= 1.10)

Starting with OGR 1.10, SQL statements are run through the SQL engine of the FileGDB SDK API. This holds for non-SELECT statements. However, due to partial/inaccurate support for SELECT statements in current FileGDB SDK API versions (v1.2), SELECT statements will be run by default by the OGR SQL engine. This can be changed by specifying the -dialect FileGDB option to ogrinfo or ogr2ogr.

Special SQL requests

"GetLayerDefinition a_layer_name" and "GetLayerMetadata a_layer_name" can be used as special SQL requests to get respectively the definition and metadata of a FileGDB table as XML content.

Transaction support (OGR >= 2.0)

The FileGDB driver implements transactions at the database level, through an emulation (as per RFC 54), since the FileGDB SDK itself does not offer it. This works by backing up the current state of a geodatabase when StartTransaction(force=TRUE) is called. If the transaction is committed, the backup copy is destroyed. If the transaction is rolled back, the backup copy is restored. So this might be costly when operating on huge geodatabases.

Starting with GDAL 2.1, on Linux/Unix, instead of a full backup copy only layers that are modified are backed up.

Note that this emulation has an unspecified behaviour in case of concurrent updates (with different connections in the same or another process).

CreateFeature() support

The FileGDB SDK API does not allow to create a feature with a FID specified by the user. Starting with GDAL 2.1, the FileGDB driver implements a special FID remapping technique to enable the user to create features at the FID of their choice.

Dataset Creation Options

None.

Layer Creation Options

Examples

Building Notes

Read the GDAL Windows Building example for Plugins. You will find a similar section in nmake.opt for FileGDB. After you are done, go to the $gdal_source_root\ogr\ogrsf_frmts\filegdb folder and execute:

nmake /f makefile.vc plugin nmake /f makefile.vc plugin-install

Known Issues

Links