Per
Liedman

Rationalizing GIS Nerd Tools

tl;dr; I rewrote GIS Nerd Tools with Leaflet and a bunch of cool npm modules in three or four hours. It still does sort of the same thing, but the code looks reasonable and there’s some chance of adding new features to it.

Lots of WKT

GIS Nerd Tools is not so much tools as a quick way to debug geo data. In my work I see a lot of WKT and GeoJSON in logs, mails, files, et.c. where I have no quick way of actually visualizing it. Typically, when I have to work with it, there’s also something wrong with it, possibly in a support ticket or bug report from a customer. In my experience, there’s too much work involved getting the data to show on a map.

I guess one would use QGIS for tasks like this, but it becomes a bit heavy handed. QGIS can do just about anything, which also means you will have to twiddle a large amount of knobs and buttons to get it do what you want. Making it worse, you need a plugin to be able to just paste WKT into a text field, and don’t even try if your data happens to have the coordinate axises swapped (which happens to me all the time - I haven’t figured out how other people solve that, or if it just never happens).

Another alternative that has come up lately is geojson.io, which is a super great tool. Combined with a command line and tools like wellknown and reproject, it can be pretty awesome. However, it clearly isn’t designed for ginormous and very complex geometries, which I encounter quite often - I believe the syntax highlighting and/or syntax checks start to take minutes of time (which is fine, I realize the tool wasn’t designed with this use case in mind).

My go-to solution for these situations has been a pretty ridiculous tool I wrote during parental leave almost exactly three years ago, called GIS Nerd Tools. It isn’t so much a collection of tools as a very slimmed down tool to solve exactly the problem outlined above. It has worked fairly well given that it’s a hack I threw together in my free time, and it has also seen some pretty surprising amount of use among my colleagues.

Four years is a lot of time in software terms, as well as when being a parent. This is how old the old GIS Nerd Tools-code has become:

Arvid

This of course means the code is horrible. Anything I wrote more than a year ago is usually horrible. GIS Nerd Tools was especially horrible since I knew very little about writing maintainable Javascript at the time.

Yesterday I found some energy, and rewrote the whole thing from scratch. Good thing, since:

There’s a ton of things I would like to improve and fix, but now it’s at least sort of possible.

If you feel interested in helping out making this simple tool better, GIS Nerd Tools’ code is hosted on GitHub.


Comments or feedback to this post?

I'm @liedman on Twitter or send an e-mail to per@liedman.net.