An essential element in designing many geospatial systems is the choice of what programming language (or languages) to use. Most of the exciting projects we can envision will involve at least some programming to customize existing tools, or to develop completely new ones.
There is an astounding variety of programming languages that are useful for geospatial professionals today. Wikipedia lists over 600 languages, which excludes the byzantine variety of dialects of BASIC past and present.
Characterizing Programming Languages
Common Programming Languages used with GIS
There are a large number of programming languages in use today, and no clear consensus on which language is “best”. We will focus here on those most relevant to GIS, which essentially means the most popular languages today, along with a few GIS-specific languages. I will add in a few general languages that show particular promise as well.
|Rank||Business Insider - ranking based on GitHub||IEEE Survey of members (2018)||Stack Overflow Developer Survey (2019)||GoGeomatices: Top Languages in the GIS World||Full Stack Academy (9 best to learn)||Women Who Code|
Below, we provide a brief description of the programming languages that show up on two or more of the lists. The first group (in alphabetical order) are those showing up on 5 or more lists, thus the ones that are generally most popular across the range of developers. Then (also in alphabetical order) we outline key features of those showing up on fewer (but at least 2) lists. These descriptions are followed by a perspective on making application-specific choices of languages that are well suited to particular GIS (and other geospatial) development tasks.
If you see any languages you feel are relevant for GIS but missing here, or you have good examples of an effective geospatial application that leverages any of the languages, please sing out by making a comment in the Canvas General Questions Discussion Forum!
Most Popular Programming Languages
- C++ — C++ is a general-purpose programming language (derived from C), with both procedural and object-oriented features, that is often used in embedded systems. Developed in 1985, its popularity has been in general decline since about 2004 (probably due to a steep learning curve and general complexity), but there are signs of a recent resurgence. While less popular than it once was, many software applications you use every day were written in C++ or use C++ for at least part of the implementation (ArcGIS, Windows OS, Firefox, MS Office, etc., etc.), so it isn't going away anytime soon.
- C# — C# was Microsoft's answer to Java (see below), and is the flagship programming language for .NET. So, if you were starting to write a new add-on to ArcGIS, it would probably be one choice (the other is Java). VB.Net is now basically an alternative syntax for the same C# runtime.
- Java — Java is very popular for web programming in general, and is many programmers' general language of choice. It is one of the contenders for the most popular Open Source GIS languages, used in the GeoServer and JTS projects for example. Java is the most commonly taught language in universities and is arguably the current king of the hill for programming languages in general.
- Python — Python is often used as a scripting language, although many people swear by it for larger systems as well. It is currently gaining a lot of visibility as the primary scripting language for ArcGIS. It kind of functions like a new AML for ArcGIS, in that it provides a high level API to Get Things Done. This was a great choice on Esri's part, because Python makes a great "glue" language, and it is very easy to work with. It has many extensions, such as SciPython and Numerical Python. Beyond explicitly GIS applications, Python has become a key tool for those in Data Science (including Geospatial Data Science) building deep learning applications.
Other Important Programming Languages
- C — C is the granddaddy of the family. When you need top performance, you use C, it is "close to the metal." This is great if you need to code a device driver, not great if you need to create a web app. Many lively open source GIS projects are written in C. For example, the Very Awesome GDAL (Geospatial Data Abstraction Library) is written in a combination of C and C++.
- PHP — PHP is one of the best ways to whip up an interactive website and, thus, quite popular.
- R and S — R and S are scripting statistical languages with a lot of very sophisticated spatial statistics that can use some of the output from ArcGIS. Plus, on its own, there are many spatial extensions to R that support a wide range of geospatial capabilities (e.g., see: CRAN Task View: Analysis of Spatial Data, Spatial Data Science with R, and r-spatial.
- Ruby — Ruby is an older language that has become more popular recently. Ruby got major traction due to Ruby on Rails, which made it easy to set up a database-backed application. This has been extended to web maps by GeoCommons. Some other interesting neogeography sites such as OpenStreetMap and WeoGeo utilize Ruby.
- Rust — Rust is an open source language supported by developers with the Mozilla Foundation. It is conceptually related to C++, but designed to be safer in relation to security threats. The Women who Code site says Rust has “loads of promise for game engines, VR simulation engines, VR controllers”, thus as more GIS-based VR develops, Rust may become more popular in our community.
- Shell — Shell is a scripting language for use in Unix (and Linux and Mac OS) environments. It allows a user to chain Unix commands together, having the system execute them as an event. For one example of using Shell with GIS, see this guide for Shell scripting with the GRASS GIS.
- SQL — SQL is used as a database access and control language. SQL is at the heart of many GIS operations. SQL is a great example of a language that has survived for a long time. It has survived so long because it is declarative instead of procedural. That is, SQL statements tell what you want to happen, not how you want it to happen. Therefore, implementation details are hidden and can change over time. This means SQL is set to remain relevant into a world of concurrent processing, which we will discuss in this week's tech trend.
Making Application-Dependent Choices
Many GIS projects leverage more than one of the languages detailed above. This is because different tasks in GIS are better supported by some of the languages than others. While different developers have different opinions on the best match of language to task, one Task-Language list is worth a look (specific to GIS-related work) was produced in 2016 by Florin-Daniel Cioloboc (Posted on: November 16, 2016, accessed on August 8, 2019).
- GIS Scripting and applications (Python, R)
- Data processing, analysis, and modeling (Python, R)
- Geospatial databases (SQL)
- MapServers (Java, C# .NET, C++)
- GIS heavy-weight development (Java, C/C++, C#)