= FileGDB = [[TOC]] * http://www.gdal.org/ogr/drv_filegdb.html * initial discussion on gdal-dev mailing list: read [http://osgeo-org.1803224.n2.nabble.com/gdal-dev-FileGDB-OGR-driver-test-td6237191.html here] = Build GDAL with FileGDB Support = == Download the API / SDK == * http://resources.arcgis.com/content/geodatabases/10.0/file-gdb-download (you will need an 'ESRI Global Account') * available downloads: * File Geodatabase API 1.1 version for Windows (Visual Studio 2008) * File Geodatabase API 1.1 version for Windows (Visual Studio 2010) * File Geodatabase API 1.1 version for Linux 32-bit * File Geodatabase API 1.1 version for Linux 64-bit == Compile == === Windows (Visual Studio 2008) === You will have to compile filegdb as a ''plugin'' for GDAL: 1. Compile GDAL with the FGDB section commented 2. Now edit your ''nmake.opt'' so it contains something like the following (pay attention to the FGDB_SDK path): {{{ FGDB_ENABLED = YES FGDB_PLUGIN = YES FGDB_SDK = $(GDAL_HOME)\..\FileGDB_API_VS2008_1_0Final FGDB_INC = $(FGDB_SDK)\include FGDB_LIB = $(FGDB_SDK)\lib\FileGDBAPI.lib }}} 3. Next, cd to the ''/ogr/ogrsf_frmts/filegdb'' directory 4. Execute the following: {{{ nmake /f makefile.vc plugin }}} A file named ''ogr_FileGDB.dll'' should be generated. 5. You will also need the file: ''FileGDB_API_VS2008_1_0Final/bin/FileGDBAPI.dll'' === Unix (Tested on Ubuntu 8.04 and trunk 22708) === FileGDB is supported through ./configure Assuming you've installed ''libFileGDBAPI'' library under default location, procedure of adding FileGDB support to GDAL/OGR is simple and you only need to provide GDAL/OGR ''configure'' with path to the FileGDB installation (replace /usr/local with whenever you extracted ../FileGDB_API) prefix: {{{ $ cd /path/to/gdal $ ./configure --with-fgdb=/usr/local $ make # make install }}} == Testing the driver == To test if the driver is been loaded, make sure that the path to ''ogr_FileGDB.dll'' is defined with the GDAL_DRIVER_PATH environmenet variable and ''FileGDBAPI.dll'' is found in your path, and then execute the following (look for "FileGDB" in the results): {{{ .\> ogrinfo --formats Supported Formats: -> "FileGDB" (read/write) -> "ESRI Shapefile" (read/write) -> "MapInfo File" (read/write) -> "UK .NTF" (readonly) -> "SDTS" (readonly) -> "TIGER" (read/write) -> "S57" (read/write) -> "DGN" (read/write) -> "VRT" (readonly) -> "REC" (readonly) }}} '''Note for Unix when note compiled as plugin:''' The order in supported formats (and I think order in which drivers are attempted) is slightly different. {{{ $ ogrinfo --formats Supported Formats: ... -> "PostgreSQL" (read/write) -> "PCIDSK" (read/write) -> "FileGDB" (read/write) -> "XPlane" (readonly) ... }}} Then test with a sample file (such as [http://trac.osgeo.org/gdal/raw-attachment/wiki/FileGDB/test_fgdb.gdb.zip here]): {{{ ogrinfo test_fgdb.gdb INFO: Open of `test_fgdb.gdb' using driver `FileGDB' successful. 1: basetable_2 (None) 2: basetable (None) 3: base_table1 (None) 4: test_lines (3D Multi Line String) 5: more_test_lines (3D Multi Line String) 6: test_points (3D Point) 7: test_areas (3D Multi Polygon) }}} '''Note:''' FileGDB_API 1.0 only supports a FileGDB created with ArcGIS>=10.0. If you try accessing a FileGDB created with an earlier ArcGIS version you will get the following error: {{{ ERROR 1: Error: Failed to open Geodatabase (This release of the GeoDatabase is either invalid or out of date.) }}} = Open Tickets = (May also show tickets about ArcObjects Driver which can also read FileGDB but requires an ArcObjects license) [[TicketQuery(status=new|assigned|reopened&keywords~=FileGDB&order=priority)]]