Fixing a problem

May 21, 2024 | 911, GDAL

Yesterday was wild.

Flash back to 6 years ago and I transferred a ESRI Process over to QGIS/PostGIS and it happened to be a 911 addressing database. As I was walking out the door, the client said “So how do we deliver the data to the state” and through a bunch of conversations we ended up producing a geopackage. The ESRI Enterprise system consumed it. Life was good. Mostly.

Occasionally the Quality Check process would change on the receiving end and there was a problem. I switch back and forth from “ESRI can’t read this consistently” to “Geopackage isn’t quite working like I need”. Regardless of what I think, I need to fix it. The latest break happened last week.

There was a lot of emailing back and forth and exchanging of error logs. I have two counties running an open source setup. We’re in the minority. This has to be smooth so I can point and go “See it’s Open Source and it’s smooth and it works”.

The QAQC group sent us an empty ESRI File Geodatabase. From that I discovered a few issues with my postgresql setup I had missed. I also fell back to GDAL.

ogr2ogr -progress -append -f OpenFileGDB tn911.gdb -nln "Addresses" PG:"host=localhost port=5432 user='snoop' password='hahaha' dbname='henderson'" -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"

In English:

  • Open the ESRI File Geodatabase TN911.gdb, specifically the Addresses Feature Class
  • Connect to Postgresql
  • Use SQL to grab what I need from Postgresql
  • I keep all the aliases and everything else in the File GDB that may be affecting pass/fail.

Easy….Mostly.

I had this long conversation at a conference with a student and her worry was “WHAT DO I LEARN? Python? R?” The only thing that has held consistent for me has been data centric skills. As of right now in my career that means having a good handle on GDAL. It’s an underappreciated skill set because all this other stuff you’re going to learn hinges on GDAL. I fixed a process at two client locations with one tool. I also took data from a database and shoved it into a proprietary dataset. With any hope we get another 5 years out of this process.

Anyway – Learn some GDAL.

You may also like

Tricks with an ESRI File Geodatabase

Tricks with an ESRI File Geodatabase

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...

The TN 911 Project – The Garage.

The TN 911 Project – The Garage.

I've been trying to write more as I get into this "New Life" thing since January. I'm not a developer. There was a time I did give it a go and it wasn't my thing. I can write small programs that scratch an itch but they aren't for mass consumption. I have found a...

Update on the TN 911 Database

After not saying much up here for the last month - here's an update on the TN 911 Database. To catch you up if you don't know - Tn has a NG911 setup and generally 97% of everyone is running ESRI Arc Something to input data. A few years ago I moved one county over to...