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
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|
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 are 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!
Popular Programming Languages
- Python — Python is very popular today, and is the primary scripting language in use in both ArcGIS and QGIS. Python is frequently considered to be a good "glue" language, and it is generally easy to work with. It has many extensions, such as SciPython and Numerical Python.
- 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 using the .NET SDK, you'd be working in C#.
- 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 it has held on to a significant share of projects all the same. 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.
- Java — Java remains a popular choice, although its popularity is declining by most measures year-over-year. Java is used in the GeoServer and Java Topology Suite (JTS) projects, for example.
Other Important Programming Languages
- C — C is the elder of the family. When you need top performance, you use C, as it is "close to the metal." This is great if you need to code a device driver, but not so great if you need to create a web app. Many open source GIS projects are written in C. For example, the 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, it is 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. Women who Code say 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 in a world of cloud computing, 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 varying opinions on the best match of languages to tasks, one Task-Language list worth a look (specific to GIS-related work) is produced in 2016 by Florin-Daniel Cioloboc.
- 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#)