In this blog post, we will explore how to open and work with gdb files in QGIS and GDAL. We’ll provide step-by-step instructions for opening gdb files in QGIS and an overview of how to read and convert data from gdb files using GDAL’s OpenFileGDB and FileGDB drivers.
Want to stay ahead of the geospatial curve? Listen to our podcast!
Understanding Geodatabases
Geodatabases are a powerful way to store and manage spatial data. They can contain multiple datasets, which makes them a convenient option for organizing related information. Today, we’ll walk through the steps to add a zipped geodatabase to QGIS, ensuring you can access and utilize your data efficiently.
Steps to Add a .gdb File to QGIS
Download and Unzip the Geodatabase: First, obtain the geodatabase file you need. For example, let’s say you downloaded a zipped geodatabase file containing legislative areas.
Locate the Files: After unzipping, ensure you know where the .gdb folder is located. This folder contains the necessary data for your project. 
Open QGIS: Launch your QGIS application to begin the import process.
Access Data Source Manager: Click on the Data Source Manager button in the toolbar.
Select Directory: In the Data Source Manager window, click on the Directory tab. Choose Open File GDB as the source type.

Browse to the .gdb Folder: Click the Browse button and navigate to the unzipped .gdb folder. Select the folder and click Add.

Adding Layers: After adding the folder, you will see the layers contained within the geodatabase. Click Close to finish the process.

Importing Directly from a Zipped Geodatabase
You can also import the geodatabase directly from the zipped file. However, it’s recommended to unzip it first for better performance and accessibility.
Using the Zipped File: If you choose to import directly from the zipped file, go back to the File menu, click on Browse, and select the zipped file.

Add Layers: Click Add and then Close. The layers will still be available for use in your QGIS project.
Best Practices
While importing directly from a zipped file is possible, it’s more efficient to work with unzipped files to avoid any potential issues.
FAQ
Can I edit data in a .gdb file using QGIS?
Yes, as of QGIS 3.28 (which uses GDAL 3.6 or later), the OpenFileGDB driver gained write support, meaning you can edit and save changes to Esri File Geodatabase files directly in QGIS. On older versions of QGIS, access is read-only. If you need write access on an older installation, you can use the FileGDB driver with the Esri File Geodatabase API library, or export the data to another format first.
What should I do if I encounter issues adding the geodatabase?
Ensure that you have the latest version of QGIS and that the .gdb file is properly unzipped. If issues persist, check for file corruption.
Are there limitations to using .gdb files in QGIS?
Yes, while QGIS supports many operations, certain advanced functionalities available in Esri software may not be fully supported in QGIS.
How to Open an Esri File Geodatabase (.gdb) Using GDAL
GDAL supports the File Geodatabase format through its OpenFileGDB driver, which allows read and write access to Esri File Geodatabase files (.gdb) in GDAL 3.6 and later. To use GDAL to open a gdb file, follow these steps:
- Install GDAL: If you don’t have GDAL installed on your system, download and install it from the official website (https://gdal.org/download.html).
- Open a command prompt or terminal window: Launch the command prompt (Windows) or terminal (macOS/Linux).
- Use ogrinfo: To list the layers available in the gdb file, use the
ogrinfocommand followed by the path to the gdb folder. For example:
ogrinfo path/to/your/geodatabase.gdb
Replace path/to/your/geodatabase.gdb with the actual path to your gdb file. This command will display information about the layers in the geodatabase.
- Access specific layers: To access a specific layer within the gdb, you can use the
ogr2ogrcommand to convert the layer to another format, such as a shapefile, GeoJSON, or CSV. For example, to convert a layer named “example_layer” to a shapefile, use:
ogr2ogr -f "ESRI Shapefile" output_shapefile.shp path/to/your/geodatabase.gdb example_layer
Replace output_shapefile.shp with the desired name for the output shapefile, and path/to/your/geodatabase.gdb with the actual path to your gdb file. This command will convert the “example_layer” to a shapefile format.
Read and Write Access
When opening a gdb (geodatabase) file in QGIS or GDAL, the level of support for read and write access depends on the driver and version used.
- QGIS 3.28 and later: QGIS uses GDAL’s OpenFileGDB driver. From GDAL 3.6 onwards (shipped with QGIS 3.28+), this driver supports both read and write access to Esri File Geodatabase files. You can open, visualize, and edit .gdb data directly. On older versions of QGIS (before 3.28), access is read-only.
- GDAL OpenFileGDB driver: GDAL 3.6 and later provides full read and write access to Esri File Geodatabase files via the OpenFileGDB driver — no additional libraries are required. Older versions of GDAL (before 3.6) offered read-only access through this driver.
- GDAL FileGDB driver: An alternative driver that provides read and write access to Esri File Geodatabase files. This driver requires the proprietary Esri File Geodatabase API library to be installed and GDAL compiled with support for it. It supports a broader range of Esri-specific feature types compared to OpenFileGDB.





