# ESRI File Geodatabase (FileGDB)

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

## Requirements

- FileGDB API SDK
- OGR >= 1.9.0

## Dataset Creation Options

None.

## Layer Creation Options

- FEATURE_DATASET: When this option is set, the new layer will be created inside the named FeatureDataset folder. If the folder does not already exist, it will be created.

- GEOMETRY_NAME: Set name of geometry column in new layer. Defaults to "SHAPE".

- OID_NAME: Name of the OID column to create. Defaults to "OBJECTID".

- XORIGIN, YORIGIN, ZORIGIN, XYSCALE, ZSCALE: These parameters control the coordinate precision grid inside the file geodatabase. The dimensions of the grid are determined by the origin, and the scale. The origin defines the location of a reference grid point in space. The scale is the reciprocal of the resolution. So, to get a grid with an origin at 0 and a resolution of 0.001 on all axes, you would set all the origins to 0 and all the scales to 1000.

- XYTOLERANCE, ZTOLERANCE: These parameters control the snapping tolerance used for advanced ArcGIS features like network and topology rules. They won't effect any OGR operations, but they will by used by ArcGIS. The units of the parameters are the units of the coordinate reference system.

## Examples

- Read layer from FileGDB and load into PostGIS:

  `ogr2ogr -overwrite -skipfailures -f "PostgreSQL" PG:"host=myhost user=myuser dbname=mydb password=mypass" "C:\somefolder\BigFileGDB.gdb" "MyFeatureClass"`

- Get detailed info for FileGDB:

  `ogrinfo -al "C:\somefolder\MyGDB.gdb"`

## 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

- Blob fields have not been implemented.
- FGDB coordinate snapping will cause geometries to be altered during writing. Use the origin and scale layer creation options to control the snapping behavior.

## Links

- ESRI File Geodatabase API Page