How does contributing to open source work (for me)?
Tags: osgeo
Published: 2021-09-27 07:39:41

---
title: How does contributing to open source work (for me)?
published: true
date: 2021-09-26 00:00:00 UTC
tags: osgeo
canonical_url: https://blog.ianturton.com/osgeo/2021/09/26/Opensource.html
---

Recently, we have been on boarding some new staff at [Astun](https://www.astuntechnology.com/) (where I work) and one of the questions that seems to keep coming up is “how does open source work?” So I’ve been giving a bit more thought to how and why I contribute to open source projects than I usually do, and whether open source is sustainable in this way.

## Some history

You have to remember that I’m old (really old in computing terms) such that when I started out if you wanted software on your Unix computer you compiled it yourself from open sources or wrote it yourself. There was of course some provided code on the machine after all you needed to use Sun’s `cc` to compile `gcc` so you could compile everything else you needed. Linux was just starting to be available when I started my first job but most of our work was done on Sun workstations. As I was working at a university (during the Thatcher years) the big draw of open source code was the cost (free) but over time I also came to appreciate the value of being able to look at the source code to see how a program worked so I could either write something similar or fix the problem I had found. I found my first compiler bug while I was working on my PhD and fortunately could print out that piece of code to take to the support team to show them why it was wrong.

When we completed the program I was developing in that first job I released it under the GNU Public Licence (GPL). Partly because it was too hard to work out who owned it - the university (my employer) who claimed to own anything I wrote or the ESRC (the funder) who also claimed to own anything I wrote when funded by them. I could foresee spending time in small offices talking to lawyers if we tried to commercialise it, and that didn’t appeal.

During the next few years, James Macgill and I started writing and collecting useful bits of Java code into what became [GeoTools](https://geotools.org) version 1. Again we gave the code away under the GPL, partly for the same reasons as before but mostly so we could help other people produce repeatable science. We likened computational geography to (say) chemistry before commercial glass ware became available - your experiment might fail to replicate someone’s results not because their results were wrong but because you had built the apparatus wrong. We felt (and still do) that if the only way to check someone’s paper was to drop thousands of pounds (or dollars) on a copy of Arc/Info then that was a problem (and how could we know there were no bugs in Arc/Info). So we encouraged others to take our code and check it, extend it and pass it on to other users, in then hope that better science would be produced.

Along the way we came across the Open Geospatial Consortium (OGC) and the web map test bed which fitted nicely with some work I was involved in on the public participation in planning which needed maps on the web (though in those days we still had to take computers out to the public to get useful numbers of users). We also met Chris Holmes and Rob Hranac of the Open Planning Project who were also working on this sort of thing. From those meetings [GeoServer](https://geoserver.org) was born, again we all benefited from access to other open source code and again released the project under the GPL to encourage reuse and contributions.

Overtime we pulled in code such as [Seagis](https://web.archive.org/web/20120123115547/http://www.geotoolkit.org:80/history.html) or built on top of other open source code such as [JTS](https://projects.eclipse.org/projects/locationtech.jts). We also added support for a variety of new data sources in a plugable way that allowed others to add just the bits of code they needed.

Next year sees the 20th anniversary of GeoTools version 2 and the project is still progressing nicely.

## Contributing

A lot of my job is now providing training and support to users of GeoServer (along with QGIS and other open source geospatial projects). Some of that “support” time is used to maintain the bits of GeoServer and GeoTools that are not actually fun (security updates and other technical debt). In my other working day of the week (when I freelance) I help out people who would like some custom GeoTools code written. For example, the ability to specify which transform you’d like to use when converting to and from a coordinate reference system ([GEOT-6920](https://osgeo-org.atlassian.net/browse/GEOT-6920)) was funded by the Tanzanian Ministry of Home Affairs. And finally in my spare time I write code that interests me, there are many sources of ideas:

- The [GeoTools](https://osgeo-org.atlassian.net/jira/software/c/projects/GEOT/issues) and [GeoServer](https://osgeo-org.atlassian.net/jira/software/c/projects/GEOS/issues) issue trackers are often fertile places to search.
- [GeoTools questions](https://gis.stackexchange.com/questions/tagged/geotools) on gis.stackexchange.com are always likely too.
- Other questions I see around on twitter.

Basically though something has to sound interesting for me to spend my limited free time on it. After all I don’t have a lot of free time to program and I really want to spend that time having fun (or I could be doing something else that is fun instead). The only other thing that motivates me is that some bug (or lack of feature) is embarrassing, for example I recently finished off [Jody’s work that allows GeoServer administrators see which modules and extensions are loaded](https://osgeo-org.atlassian.net/browse/GEOS-10067) in their version. Every time we went to this page when I was running a GeoServer course I would have to explain why this page didn’t actually show _all_ the extensions (including the one we had just added) and there was really no go reason other than lack of time (and funding) so I just sat down and fixed the remaining modules (except the community ones, you are still on your own there). This means that the next GeoServer course will be slightly more fun for me to do (provided I’ve updated to 2.20.x).

So recently “projects” have been adding some functionality to GeoTools that I was interested in such as [contouring point layers](https://blog.ianturton.com/geotools/2020/12/24/contours.html). I had always wondered how it was done, and GeoTools currently couldn’t do it and I had the whole of the christmas holiday to play. I’ve also recently had a look at how to maintain [topologically correct borders between polygons when simplifying them](https://blog.ianturton.com/geotools/2021/08/23/Topological-Adventures.html). This came from a [question](https://gis.stackexchange.com/q/407860/79) on gis.stackexchange and again turned out to be an interesting problem that is probably useful for many users. The latest project is looking at adding a [label line along the centre of a polygon](https://blog.ianturton.com/geotools/2021/08/23/Skeletons.html). In asking for more help on this problem I’ve found that [MapServer is trying to add this functionality](https://github.com/MapServer/MapServer/pull/5854) too (so now it’s a race). In the time this blog post has been languishing part written I’ve managed to finish this up (the [answer](https://gis.stackexchange.com/a/411926/79) is to use Dijkstra to find the longest shortest path between nodes of index 1).

So, I now have a much better handle on how JTS works (for some functions anyway) and more respect for topology than I used to. I think that next I might try to look at some problems that don’t require me to read up on graphs. The obvious next step is to package up the code with some unit tests, push it in the GeoTools code base and then add something to the GeoServer manual so that other people can use them. I promise I will get around to that some time (if you would like me to do it urgently then please get it touch and I can talk you through the process or give up a price).

If you would like to know more of how I (and Andrea) spend our time please come and watch [our talk at FOSS4G 2021](https://2021-foss4g.venueless.events/schedule/talks/VCGQZX) (it’s this Wednesday at 13:00UTC).