2

Can someone tell me how to get QGIS 2.8 in Ubuntu to see the ESRI File GDB API?

I am trying to install the ESRI File GDB API (https://github.com/Esri/file-geodatabase-api/tree/master/FileGDB_API_1.5) but i seem to be unable to do so. I know that QGIS has the open fileGDB, but that won't let me edit. I am not finding a lot of instructions out there besides the readme provided by the API

I followed the instructions in the API to make the samples, but these result in errors such as:

../../lib/libFileGDBAPI.so: undefined reference to `GetFileAttributes(wchar_t const*)'
../../lib/libFileGDBAPI.so: undefined reference to `IID_IGeometry2'
../../lib/libFileGDBAPI.so: undefined reference to `FindNextFile(void*, _WIN32_FIND_DATA*)'

I am running Ubuntu 16.04.4 on a virtual box vm. The GDAL version for this machine is 1.11.3, released 2015/09/16. My system buildout is as follows:

    QGIS version    2.8.6-Wien  QGIS code revision  exported
    Compiled against Qt 4.8.7   Running against Qt  4.8.7
    Compiled against GDAL/OGR   1.11.3  Running against GDAL/OGR    1.11.3
    Compiled against GEOS   3.5.0-CAPI-1.9.0    Running against GEOS    3.5.0-CAPI-1.9.0 r4084
    PostgreSQL Client Version   9.5.13  SpatiaLite Version  4.3.0a
    QWT Version 6.1.2   PROJ.4 Version  492
    QScintilla2 Version 2.9.1
2

According to https://github.com/Esri/file-geodatabase-api you need the gcc51 version to compile with Ubuntu 16.04 (which comes with gcc 5.3.1)

Download the file from https://github.com/Esri/file-geodatabase-api/blob/master/FileGDB_API_1.5.1/FileGDB_API_1_5_1-64gcc51.tar.gz to a subfolder src under your home folder and unpack it.

Following the steps described in http://wiki.wildsong.biz/index.php/Building_GDAL_on_Linux#ESRI_file_geodatabases I can successfully extract and compile the API:

cd src/FileGDB_API-64gcc51
export LD_LIBRARY_PATH=`pwd`/lib
cd samples
make
sudo cp ../lib/* /usr/local/lib
sudo ldconfig

GDAL has to be rebuild from source afterwards, as described in the same blogpost. It is recommended to compile the same GDAL version you have from your paket manager, because otherwise you have to compile QGIS as well afterwards.

So download https://github.com/OSGeo/gdal/archive/v1.11.3.tar.gz to the src folder and unpack it.

cd src/gdal-1.11.3/gdal
./configure --with-python \
--with-geos --with-geotiff --with-jpeg --with-png --with-expat --with-libkml --with-xerces-c \
--with-fgdb=$HOME/src/FileGDB_API-64gcc51 \
--with-openjpeg --with-pg \
--with-curl --with-spatialite \
make
sudo make install

The workflow above does not overwrite the GDAL version you got from the package manager. If you remove the packaged version, QGIS will be removed too (as a dependency issue). So the cleanest way after compiling successfully is to copy everything from /usr/local/ to /usr/ with root permission.

After you have done that, run ogrinfo --formats|sort to find FileGDB (read/write).

Now QGIS is able to load and edit the data in src/FileGDB_API-64gcc51/samples/data/.

See also How to force QGIS to use GDAL version? (from one of the QGIS devs)

0

I have a fresh install of Linux Mint and the FGDB comes out of the box with the QGIS installation found here:

Installing latest QGIS version on Ubuntu?

I would think that your QGIS install is the issue, vs. having to install the FGDB drivers manually afterwards.

  • It is a matter of the GDAL version rather than QGIS. Ubuntugis should be the key to it. Using ogrinfo --formats, Ubuntugis-unstable has OpenFileGDB (rov) which is different from the official ESRI FGDB API which would be listed as FileGDB (rw+) included in OSGEO4W, but not QGIS standalone windows builds. – AndreJ Aug 12 '18 at 6:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.