The TN 911 Project – The Garage.

Oct 27, 2025 | 911, postgis, QGIS

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 large amount of happiness in SQL and GDAL as of late and PyQGIS….but the PyQGIS blog post is another post for another time.

So here’s an update for the TN911 project. I had mentioned in a previous post I was working on another 911 database job and from that I’ve been learning how to be pickier with error checking the 911 data. I was doing a small amount of checks but nothing serious. I grabbed a backup of one client’s data and have been picking my way through it and looking at “what can be wrong”;

  • The Pre-Direction could be wrong – that’s the part of the address that’s North/South/etc – so something like “North Main Street”. What if someone fat fingered it and made it “North East Main Street”. The person doing the addressing usually knows if something is off. I give them a list of predirs used in the database.
  • Does the house address match the street address – in other words “North Main Street” on the point matches “North Main Street” on the line. I give you a list of things that can be wrong with that.

There’s multiple combinations of things you can check. So one day I started making a list and I ended up at something like 30 checks on the data. I’m still about 3 or 4 away from being done. Well – I think I’d be done.

My first thought was to make a schema called garage and shove all the tabular data checks into that. Of course the user could ignore that schema exists. I could run this as a Geoprocessing model and return the results BUT that remains on the user to run the checks.

Anyway – One check I was quite proud of was this one:

You have these Polygons called Emergency Service Networks. Each one has a Unique Identifier. Each road is designated as being in an ESN and it gets so far to even be the “right or left” side of the road. In this case ESN 126 has a road that isn’t broken crossing over the red line into ESN 121.

I’ve often wondered how I could easily check this with SQL. I could do some weird Clip/Union/Intersect thing in qgis and pick it out but I just want a list. Spatial SQL to the rescue. Intersect and compare values and I have a list.

I have a road that isn’t broken at the ESN. Is it the end of the world? No. Does it make for some awesome Data Gymnastics? Yes. Not bad for a script that takes 1 second to run. So for now I’m opting for the schema approach for now. There garage schema exists and it will give you tables to fix your data.

That’s turned into my “fun” thing to do now. Dig around and answer questions with SQL. It’s my Wordle. It’s my Sudoku puzzle for not being bored. Plus it does remind me a little of the “gold old days” of writing scripts in Arc Macro Language and just having fun with it.

You may also like

Training, Websites, and Life

Training, Websites, and Life

So back last year I started something and have just finished one small part of it: https://training.northrivergeographic.com The Intro to QGIS class has a new home and that new home has a lot of room for a lot of different things. Something like 12 years ago (or more...

Solitude of the Traveling Pants

I said last year I was going to cut back on conferences and forgot about that in the lead up to January. So far this year there's been three conferences I've attended. I've got another 2 plus one speaking engagement and then I'm done for a bit. Of course that leaves...

I edited ArcPy Code

I edited ArcPy Code

It made me sad. I'm working on a project involving 911 data and it's made me do quite a bit of thinking. The short story on this is it's not in Tennessee. I'm taking data in it's raw form and shoving it into that state's NG911 format. So I have about half of it...