GEOG 583
Geospatial System Analysis and Design

Overview of Programming Languages for GIS

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

One important means of characterizing programming language is according to their type systems, that is, the rules by which one can assign meaning to variables or objects. One fundamental divide is between static and dynamic typing. Statically typed languages such as C, C++, C#, and Java evaluate type information at compilation time, and reject code that does not seem well-formed. The advantage of this is that many errors can be caught at compile time instead of run-time, and the earlier errors are caught, the easier they are to fix. The disadvantage of static typing is that it makes the code more verbose as type information is added, and you can sometimes spend a lot of time "making the compiler happy." Dynamically typed languages such as Python, JavaScript, PHP, and Ruby, conversely, delay type checking until run-time. Therefore, you often don't have to specify the type of a variable before you use it. The advantage of dynamic typing is in ease of programming; the disadvantage is that some errors will slip through until the program is running, and these errors can be difficult to interpret.

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.

The table below represents several recent lists of languages from 2019 and 2018 (the first 3 columns are based on specific surveys of use/users, the basis of ordering for the last 3 columns was not explicit, but still represents a view by the author/authors. Only one of the lists, the one from GoGeomatics, is specific to GIS, and that one was produced by a single developer. The most important take-aways from this table are that: (1) there are many popular languages and diverse opinions on their relative merits, and (2) Python, Java, and JavaScript are in the top 5 on every list, with C++ and C# on 5 of 6 lists, PHP on 4 of 6, and C, R, Ruby, Rust, Shell, SQL, and TypeScript trailing the others with 2 lists each. For those interested in trends over time in programming language popularity (for most of the languages listed), check out the 2002-present TIOBE Programming Community Index timeline.

Common Programming Languages used with GIS

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
1 JavaScript Python JavaScript Python JavaScript Python
2 Java C++ HTML/CSS JavaScript Swift Java
3 Python Java SQL R Java JavaScript
4 PHP C# Python SQL C/C++ Rust
5 C++ R Java Java Python Kotlin
6 C# PHP Bash/Shell C/C++ PHP _
7 TypeScript JavaScript C# C# Ruby _
8 Shell Go PHP - C# -
9 C Assembly C++ - Rust -
10 Ruby Matlab TypeScript - - -

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

  1. 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.
  2. 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.
  3. 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.
  4. JavaScript — JavaScript is the current leader for Web User Interfaces. Google Maps is a heavy user of JavaScript, Esri’s ArcGIS API for JavaScript supports web map development, and the leading open source web map client (OpenLayers) also is based on JavaScript.
  5. 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

  1. 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++.
  2. PHP — PHP is one of the best ways to whip up an interactive website and, thus, quite popular.
  3. 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 DataSpatial Data Science with R, and r-spatial.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. TypeScript — TypeScript is an object-oriented programming language that is a superset of JavaScript. It has been described as “JavaScript that scales”. As with JavaScript, support exists for using TypeScript with the ArcGIS for JavaScript API and the and the Google Maps JavaScript API. There is also support for TypeScript with the Bing Maps SDK and for using Leaflet in TypeScript, among others.

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)
  • Web Mapping (JavaScript, Python)
  • Geospatial databases (SQL)
  • MapServers (Java, C# .NET, C++)
  • GIS heavy-weight development (Java, C/C++, C#)
  • Mobile development (Android, iOS, JavaScript)
  • Geospatial libraries (JavaScript, Python, Java, R, C/C++)