Codefry has been a long-time user of COTS (commercial off-the-shelf) GIS software, utilizing such stacks as Esri ArcGIS or Google Earth Enterprise in our custom visualization applications. However, as spatial data and mapping have become more common, we realized a developing need for less costly implementations of maps and spatial databases. Over the past several months, I’ve investigated open source alternatives to enterprise GIS solutions using an AWS (Amazon Web Service) instance of Ubuntu 14.04 running on Amazon’s free tier. This is an excellent option for those wishing to easily explore application development without needing to stand up your own development server.
One of the first necessary components of an Enterprise GIS is a database. Most geographic data I’ve encountered has been tabular, so I decided to avoid unstructured NOSQL databases such as mongodb and stick with a traditional RDMS (relational database management system). PostGIS is a well-supported open source spatial database built on the popular Postgresql platform. It is packaged with a variety of native spatial operations and supports multiple geographic types (raster, vector-polygon, vector-point, etc.). It also follows the Open Geospatial Consortium’s (OGC) Simple Features for SQL Specification. See this link for a complete list of features.
Many options exist for a GIS application server, from a more customizable node.js implementation to many different prepackaged options such as mapnik, mapserver, geoserver and dozens of others available on the popular open source online community GitHub. I decided to investigate Geoserver’s functionality based on several appealing factors:
- Intuitive administrative GUI
- Integration with OpenLayers, a popular JavaScript mapping library
- Open Geospatial Consortium (OGC) Compliant Services such as WFS, WMS, and WFS-T
- Newer formats such as geojson supported
- Simple REST based services
- Native support for PostgreSQL
I’m sure other great application servers exist, and because this is an exploratory project and therefore has no specific requirements, the choice is somewhat arbitrary. But after working with it, I’m happy to find out how easy geoserver is to pick up and understand.
Several GIS applications for creating and manipulating data are available and widely used in the open-source community. QGIS is one of the more popular utilities due to its extensibility, GUI interface, and out-of-the-box integration with other GIS tools such as GDAL (geospatial data abstraction library), the de-facto command-line utility for working with vector and raster geospatial data. Using a combination of QGIS and Python, I created a text file of all landing facilities registered with the Federal Aviation Administration and then imported the data into a PostGIS table. A second Python script downloads a fresh copy of the data from the FAA’s public-facing website and overwrites the data in the PostGIS table – this script can be configured to run on a reoccurring basis so the data never becomes outdated.
The last step involves deciding upon which of the several client-side mapping applications to use. I wanted a lightweight javascript library to visualize my landing facilities. Three seem to be the most popular: OpenLayers, Leaflet, and Mapbox (originally called Wax). Mapbox is derived from Leaflet, but I chose OpenLayers for its comprehensive examples and easy integration with WFS (Web Feature Service), which is the service on which I planned to publish my landing facility data.
To put it all together, all I needed to do was register my Postgresql database with Geoserver, and expose the landing facilities table as a layer. This enabled basic REST endpoints for my data, on which I was able to build a quick web page using OpenLayers JavaScript API. I used Stamen Design’s “Watercolor” basemap and created some quick labeling to display airport IDs when the map scale is small enough. The dataset is close to 20,000 records, so for performance purposes, users cannot zoom out past the regional level lest the map tries to draw thousands of individual points. Alternatively, I could use a WMS layer to just generate an image to overlay on the basemap, but I prefer individual features because it gives a developer more granular control. Maps can be built quickly using all free, open-source tools, and the underlying technology provides a framework on which more complicated geovisuzations are easily developed.