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

QGIS Fun: Chickamauga Mound

QGIS Fun: Chickamauga Mound

I've been trying to stop once a week and do something fun with QGIS. Post Heart Incident I do a lot of walking. I've been re-exploring some places I used to go in town to exercise and one is the TN River Walk. I realized the other day I needed to do some OpenStreetMap...

The Trail Map – Part 1

The Trail Map – Part 1

A few posts ago I babbled about cartography. I've never had the patience for Cartography mainly because two things usually happen...well three things: the map can't be bigger than 8x11 the map must have everything on it Make the map however you want except we will...

My So called Life as a Map Maker

My So called Life as a Map Maker

I can sum it up: It's not much of one. Way back in my younger days I was infatuated with ArcPlot (which was the plotting portion of ArcINFO). From there I moved to Arcview, ArcMap, and eventually here to QGIS. All of my work typically revolves around Data. I usually...