Over the past several years my work has been focusing more and more on web GIS applications and I have chosen to use open source technologies rather than commercial applications for several reasons.
Why I moved to open source
- Cost is an obvious factor. When dealing with multi-user enterprise level databases that form the backbone of most web GIS systems commercial software costs can quickly reach many 10’s of thousands of dollars and that is enough to fund a lot of time learning to do it with open source technology.
- In my experience, most web GIS applications are sufficiently complex that the “non-programming” promise of commercial software simply doesn’t work. Even if you find a package that will work in the beginning it rarely takes long before the client and colleagues starts asking for features that aren’t readily available, and you end up having to write code anyhow. And “non-programming” solutions have a steep learning curve too. One that is often poorly documented, constantly changing, and limited in its usefulness.
- I like programming and I would prefer to spend my time figuring out how to do something on my own rather than spend time searching for something that someone else has already done. Figuring it out on my own is challenging and provides opportunity to learn. Searching for canned solutions and having to adapt to someone else’s solution is frustrating and rarely fruitful.
- I like having complete control over my applications and programming gives me the flexibility to build an application exactly as I see fit. The results are almost always better than hacking together other people’s applications.
- I can make my applications available to my clients, and securely restrict access from anyone without the proper credentials without requiring them to pay large amounts of money for the privilege of seeing their own data.
5 reasons to use QGIS with open source web GIS projects
Although I own commercial software, I have found myself using QGIS more and more frequently as I have moved deeper into open -source web GIS. It has lots of features not available out of the box in ArcGIS that are incredibly useful for anyone involved in web GIS.
- QGIS has an extension called QGIS2Web that allows you to author a map in QGIS with labels, pop-ups, scale dependencies, etc and export it as a web map using either Leaflet or OpenLayers. It also packages up the data in the map as GeoJSON files and the entire package can be uploaded to a website and viewed over the internet. See how This is the equivalent of authoring a map in ArcGIS and publishing it to ArcGIS on-line except that you can modify the code as you see fit, you can password protect it using standard methods without requiring users to have an ArcGIS online license to view it, and you can host it on your own web-site so you have complete control of the data. The downside is that you are only serving static data that can’t be edited remotely, but I bet someone is working on the ability to do that by packaging the data into a SpatiaLite or GeoPackage database, which could potentially provide database services for smaller open-source web GIS projecrt It would also be possible to write a python script to update the GeoJSON data files as necessary with the most current data so at least the data stays relatively current, which is not much different than the concept of “publishing” your data to ArcGIS Online.
- The ability to read and write GeoJSON files natively is ridiculously easy in QGIS. Any data format that QGIS can read, which is essentially everything, can be converted to GeoJSON and re-projected to WGS84 simply by right-clicking the layer in the layer control. See how This is important because almost all web mapping API’s can read and display data in the GeoJSON format. Even if you will eventually be getting your data from a database, it will likely be coming in the form of GeoJSON so you can start writing your client-side code with GeoJSON files and seamlessly switch to a database when you are ready. In my opinion, QGIS is worth downloading, even for the most diehard ESRI fans, just for its ability to read and write so many data formats, including GPX. No more need for DNR Garmin.
- QGIS also reads, writes, and edits PostGIS data natively. In fact, QGIS was originally developed for the purpose of viewing and editing PostGIS data. PostGIS is a spatial extension to the open-source PostgreSQL database. PostgreSQL is a multi-user, enterprise level database and the combination is the equivalent of SQL Server and ArcSDE in the ESRI ecosystem. Except the database is free and easy to set up and anyone can download QGIS and edit that data without spending $7000 for an ArcEditor (or whatever they call it these days) license. This makes it very useful as the backend of an open source web GIS project. PostGIS can also be accessed from mobile or desktop web GIS applications so remote users can access data through a web GIS app, while in-house users have the full power of QGIS and everyone has full editing access to the same data in real-time. Its relatively trivial to get a PostGIS instance running on a web hosting site for only a few dollars per month with no subscription or user fees. The combination provides almost unlimited possibilities for web GIS applications.
- QGIS can also read and write SpatiaLite and GeoPackage data natively. Both of these are spatial extensions to SQLite, which is a file based multi-user database. SpatiaLite is the equivalent of a file geodatabase but it can handle multiple simultaneous editors, provided they are not trying to write at the same time. It is also a single file, which makes it easier to move around. SpatiaLite is accessed through SQL commands and can handle lightweight database duties for smaller open source web GIS projects without the complexity of installing PostGIS on your web server. SpatiaLite locks the database temporarily while data is being written, but usually ony for a few ms, unlike a file geodatabase which locks the entire dataset until the first person who access it closes their program, which makes it impossible to use with multiple editors. It has been estimated conservatively that SQLite can handle over 100k write operations per day as the backend to a web GIS application. GeoPackage allows storing both vector and raster data in a SQLite database and was designed to package up a set of data in a single file that can be moved to a mobile device for off-line access.
- QGIS has an extension called QTiles that allows you to author a map in QGIS and export it as raster tiles that can be included in an off-line application to provide custom background maps on a mobile device that don’t require internet connectivity or use costly data. The map tiles can be stored in a variety of formats but the mbtiles format, also based on the SQLite database, is handy in that it is a single file and can easily be ported to a mobile device.I should mention that there is a QGIS Server product available. I’ve never used it and I don’t know much about it. I have not been able to find much documentation about it either. From the little I have been able to uncover, it seems to be the ecosystem equivalent of ArcGIS Server in that it allows you to set up your data as WMS or WFS services so that they can be consumed by desktop or web GIS clients. There is another open-source product called GeoServer that seems to fill a similar role. All the work I have done has been for a smaller group of users and I’ve always used direct SQL calls to a PostGIS database when I need to serve dynamic data, rather than web services. But if you need that capability it does exist in the open-source world. Perhaps one of the readers can provide more information on this.
Comparison with ArcGIS
ESRI has their own ecosystem for web GIS through ArcGIS for Server and.or ArcGIS Online. As such they do not seem to put much effort into developing tools helpful for those pursuing an open source web GIS strategy. Nor would one expect them to be. They have put an enormous amount of money into both products. If you are happy with what they offer, so be it. But if you are an ESRI user who is looking into open-source web GIS you should be aware of some of its limitations to help you plan your strategy.
I will admit that I have not updated my ArcGIS license past 10.3 for a number of reasons so it is possible that newer versions of ArcGIS have some of the features that I have turned to QGIS for. If I am wrong, please let me know, however, a quick google search doesn’t indicate that this is the case, and I really wouldn’t expect it to be. ESRI is not in the habit of freely providing features that it can charge money for (I don’t blame them, they are a business). I know that ArcGIS can read and write GeoJSON files through the Data Interoperability extension but it will cost you.
To my knowledge, ArcGIS can also read PostGIS data but cannot edit it. ESRI also supports their own spatial database extension on the PostgreSQL database but I assume that you still need an ArcEditor (or whatever they call it these days) license to edit.
ArcGIS also has limited support for SpatiaLite and GeoPackage. It can connect to either one so I assume data can be displayed, however, I do not believe it can create a new database and I do not know if it can be edited. Regardless, support seems to be a grudging afterthought rather than a core part of the ArcGIS software. You will have to dig deep to figure out how to do it on your own.
As far as I can tell, ArcGIS has no support whatsoever for .mbtiles. They do have their own directory based format for tiled map data but I believe that you need ArcGIS Server to write them and I am unaware of any offline support for them from any open source software.
I am not anti-ESRI. They are a fine company and they have done a lot for GIS and I know that they do support many non-profit causes. I simply can’t afford their software and can’t compete as a small business if I have their overhead. It’s personal preference but I also don’t like being forced to live in their ecosystem when I know there are other options that don’t limit me or force me to rely on the black box approach to data hosting.
If you find yourself in the same boat, I encourage you to explore the tools that QGIS provides for open source web mapping. I think that you will be pleasantly surprised with what you can accomplish.
If you want to learn more about web GIS please join the Open Source Web GIS group on LinkedIn.
Mild sales pitch if you want to learn more
I also have two courses available on Udemy. One is an Introduction to web programming for GIS Applications, which provides a broad overview of the client and server-side technologies involved in 13.5 hours of content. The second, also with 13.5 hours of content, is a more focused look at client side programming with Leaflet and Turf.js. Both are available for 80% off ($20 each) to readers of this blog with the links above.
I am currently working on a third course focusing on considerations for mobile applications which should be available mid September. After that I plan on developing a 4th course on server side programming with PostGIS and a 5th on mobile data collection applications. Keep your eyes on this blog or on my YouTube channel for announcements of course releases.