Recently, we have been on boarding some new staff at Astun (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.
你必须记住,我很老(在计算方面真的很老),所以当我刚开始的时候,如果你想在你的Unix计算机上安装软件,你可以自己从开源软件中编译或自己编写。当然,机器上提供了一些代码,毕竟你需要使用Sun的cc来编译gcc,这样你就可以编译你需要的所有其他东西。当我开始我的第一份工作时,Linux才刚刚开始可用,但我们的大部分工作都是在Sun工作站上完成的。当我在一所大学工作时(在撒切尔时代),开源代码的最大吸引力是成本(免费),但随着时间的推移,我也开始意识到能够查看源代码以了解程序如何工作的价值,这样我就可以编写类似的东西,或者解决我发现的问题。我在攻读博士学位时发现了我的第一个编译器错误,幸运的是,我可以打印出那段代码,交给支持团队,向他们展示错误的原因。
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.
当我们完成我在第一份工作中开发的程序时,我根据GNU公共许可证(GPL)发布了它。部分原因是很难确定是谁拥有它——大学(我的雇主)声称拥有我写的任何东西,或者ESRC(资助者)也声称拥有我在他们资助下写的任何东西。我可以预见,如果我们试图将其商业化,我会花时间在小办公室里与律师交谈,但这并没有吸引力。
During the next few years, James Macgill and I started writing and collecting useful bits of Java code into what became GeoTools 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.
在接下来的几年里,詹姆斯·麦克吉尔和我开始编写和收集有用的Java代码,并将其转化为GeoTools版本1。我们再次在GPL下发布代码,部分原因与之前相同,但主要是为了帮助其他人创造可重复的科学。在商用玻璃器皿问世之前,我们把计算地理学比作化学——你的实验可能无法复制某人的结果,不是因为他们的结果是错误的,而是因为你把仪器造错了。我们觉得(现在仍然是这样),如果检查某人论文的唯一方法是在Arc/Info副本上花费数千英镑(或美元),那么这就是一个问题(我们怎么知道Arc/Info中没有错误)。所以我们鼓励其他人接受我们的代码并检查它,扩展它并将其传递给其他用户,然后希望产生更好的科学。
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 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.
一路上,我们遇到了开放地理空间联盟(OGC)和网络地图试验台,这与我参与的一些公众参与规划工作非常吻合,这些工作需要在网络上绘制地图(尽管在那些日子里,我们仍然需要向公众提供计算机,以获得有用的用户数量)。我们还遇到了开放规划项目的克里斯·霍姆斯和罗伯·赫拉纳克,他们也在做这类事情。从GeoServer诞生的那些会议中,我们再次受益于对其他开源代码的访问,并再次在GPL下发布了该项目,以鼓励重用和贡献。
Overtime we pulled in code such as Seagis or built on top of other open source code such as 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.
随着时间的推移,我们引入了诸如Seagis之类的代码,或者构建在诸如JTS之类的其他开源代码之上。我们还以可插拔的方式添加了对各种新数据源的支持,允许其他人只添加所需的代码位。
Next year sees the 20th anniversary of GeoTools version 2 and the project is still progressing nicely.
明年是GeoTools第2版发布20周年,该项目仍在顺利进行。
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) 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:
我现在的很多工作是为GeoServer用户提供培训和支持(以及QGIS和其他开源地理空间项目)。其中一些“支持”时间用于维护实际上并不有趣的GeoServer和GeoTools(安全更新和其他技术债务)。在我每周的另一个工作日(当我是自由职业者时),我会帮助那些想要编写一些定制地理工具代码的人。例如,坦桑尼亚内政部资助了在坐标参考系(GEOT-6920)之间进行转换时指定要使用的转换。最后,在我的业余时间,我写了我感兴趣的代码,有很多想法来源:
- The GeoTools and GeoServer issue trackers are often fertile places to search.
- GeoTools questions 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 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).
基本上,虽然我必须听上去很有趣,才能把有限的空闲时间花在这上面。毕竟,我没有太多的空闲时间来编程,我真的很想把这些时间花在娱乐上(或者我可以做其他有趣的事情)。唯一能激励我的另一件事是一些bug(或缺少功能)令人尴尬,例如,我最近完成了Jody的工作,让GeoServer管理员可以看到在他们的版本中加载了哪些模块和扩展。每次当我在运行GeoServer课程时,我们转到这个页面时,我都必须解释为什么这个页面没有显示所有的扩展(包括我们刚刚添加的扩展),除了缺少时间(和资金)之外,真的没有其他原因,所以我就坐下来修复剩余的模块(除了社区的,你在那里仍然是一个人)。这意味着下一个GeoServer课程对我来说会更有趣(前提是我已经升级到2.20.x)。
So recently “projects” have been adding some functionality to GeoTools that I was interested in such as contouring point layers. 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. This came from a question 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. In asking for more help on this problem I’ve found that MapServer is trying to add this functionality 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 is to use Dijkstra to find the longest shortest path between nodes of index 1).
所以最近“项目”给我感兴趣的GeoTools添加了一些功能,比如绘制点图层的轮廓。我一直想知道这是怎么做到的,而GeoTools目前无法做到这一点,我有整个圣诞节假期要玩。我最近还研究了如何在简化多边形时保持多边形之间的边界拓扑正确。这来自一个关于地理信息系统的问题。stackexchange和再次被证明是一个有趣的问题,可能对许多用户有用。最新的项目是沿着多边形的中心添加一条标签线。在这个问题上寻求更多帮助时,我发现MapServer也在尝试添加这个功能(所以现在这是一场竞赛)。在写这篇博文的时候,我已经设法完成了(答案是使用Dijkstra找到索引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).
因此,我现在对JTS的工作原理有了更好的理解(不管怎样,对于某些函数),并且比以前更加尊重拓扑结构。我想接下来我可以试着看看一些不需要我阅读图表的问题。显然,下一步是用一些单元测试打包代码,将其推送到GeoTools代码库中,然后向GeoServer手册中添加一些内容,以便其他人可以使用它们。我保证有一天我会抽出时间来解决这个问题(如果你想让我紧急处理,请联系我,我可以告诉你整个过程,或者给出一个价格)。
If you would like to know more of how I (and Andrea) spend our time please come and watch our talk at FOSS4G 2021 (it’s this Wednesday at 13:00UTC).
如果你想知道更多我(和安德列)如何度过我们的时间,请过来看我们在FSO4G 4G 2021的谈话(这是在星期三13:00 UTC)。
https://blog.ianturton.com/osgeo/2021/09/26/Opensource.html
https://twitter.com/geowolf
https://twitter.com/ijturton