Tricks with an ESRI File Geodatabase

Mar 19, 2026 | GDAL, QGIS

A few years back I jumped in way over my head with QGIS/Postgis. I had moved a process out of one software and into my favorite two (QGIS/PostGIS) and little did I know the final output had to be a ESRI File Geodatabase. So what did I do? I shamed them into using a geopackage. It worked well for a few years and then with almost every release of new ESRI software there was some hiccup with the Geopackage and it was causing issues.

So back in 2022 GDAL gained (and as a result QGIS) the ability to read and write an ESRI File Geodatabase. So I could finally dump my postgis to an ESRI File Geodatabase without a lot of worry. The quick and dirty on how this happens is:

ogr2ogr -f "OpenFileGDB" NRGS.gdb PG:"host=host user=rjhale dbname=henryco password=nope" "tn911.esn"

Which is basically “create an ESRi File Geodatabase called NRGS.gdb and connect to Postgis and pull out the ESN layer and stick it in NRGS.gdb”. It works well except I was still having some hiccups with ESRI processing the FGDB. Some of my columns weren’t quite lining up with the standard – mainly it was my problem and not the software.

BUT…..there’s always a but…..GDAL can append data to an existing ESRi File Geodatabase. So I can shove data into an official State Blessed ESRI File Geodatabase using the following:

ogr2ogr -f OpenFileGDB -append c:\TCSTransport\upload\TCSTransport.gdb -nln "Addresses" PG:"host=host port=5432 user='rjhale' password='nope' dbname='henryco'" -sql "select id as objectid, geom, oirid, r_segid, a_segid, seg_side, gislink, structype, strucdesc, stnum_h, stnum_l, stnum, stnumsuf, building, floor, unit_type, unit_num, predir, pretype, name, type, sufdir, postmod, address, addr_esn, label, subname, vanity, zip, zip4, esn, city, county, state, lon, lat, x_sp, y_sp, z_val, gpsdate, addrauth, source, editor, geomod, geosrce, geodate, attmod, attsrce, attdate, status, delnotes from tn911.address_points"

Everything exports as it needs to export and loads into the ESRI Package. No Problems.

If I have a one-off project that needs to load data into a ESRI File Geodatabase? Open the ESRi file Geodatabase in QGIS and copy and paste your data into the ESRI FGDB. In this case the client has a file geodatabase that has to have all the domains/subtypes/datasets and other things saved in the FGDB. QGIS handles it and saves it and keeps all that stuff intact. I can probably load it with GDAL – but I’ve not gotten that far into that for this particular project.

The point? I blend in. I’m delivering what the client needs and still enjoying my preferred software stack.

You may also like

FOSS4GNA 2026

Greetings from the Atlanta Airport at 7:10 AM. I am again flying during a time change - my body says it's 8:10 but overall - this is easier than flying in the spring when the time changes. I've already gotten lost twice and asked for directions once. So this will be...

The Aunt II: Adding Cemeteries

The Aunt II: Adding Cemeteries

In a previous post I talked about my aunt that died and we couldn't find the cemetery. Found it! Welcome to the Bethel Cemetery. I will tip my hat to the inherent creepiness of the whole thing. Who is rising second? So I want to add cemeteries to OSM. In my first...

QGIS US – September 22nd 2026 EDT

QGIS US – September 22nd 2026 EDT

It's been a while since I've done a QGIS US meeting. Part of it was burnout and part I've been busy with work and life. So we're talking projections tomorrow. Proj is a bigger project than just QGIS - but it's nice to know how that project is moving along. Meeting...