We at Gispo are always looking for different ways to publish and visualize spatial data. Sometimes we get projects where the best way to accomplish this is to provide an interactive map that the end user can digest in the way they please.
In this article we’ll be looking at the possibilities of Kepler, a browser-based platform for visualizing geospatial data.
What are the reasons one should use Kepler? Why should anyone be interested?
A simple use case could be that you have a spatial dataset you want to publish or just check out yourself, but have no or little prior experience on working with GIS software. If you don’t know where to start your journey with latitudes and longitudes or don’t want to set up QGIS, Kepler can offer you a very useful shortcut.
In many cases Kepler can come in handy for professionals, too. Even though the amount of other tools for creating and publishing interactive maps is vast, Kepler achieves quite a delightful balance of simplicity and features. The map creation is as straightforward as drag-and-dropping your data and letting the automations take care of most of the manual work, but, once the data is loaded, you are free to customize the map ad infinitum. This makes Kepler a great tool for quickly demonstrating and exploring datasets as well as producing polished visualizations.
Getting started with Kepler
The best way to learn is by doing, and Kepler’s demo website encourages exactly that. Once on the page, the first thing that pops at your face is the add data window. Kepler eats CSV, Json and GeoJSON as input, but you can also use pre-existing Kepler map configuration files that specify the data and its styling in json format.
For now, let’s add some data. In this post I’ll use a dataset of superb parrot sightings in New South Wales, Australia (© State Government of NSW and Department of Planning and Environment 2010). If you want to experiment yourself you can bring your own data, or use the same dataset – it’s openly available!
After adding your data, Kepler will happily provide you with the most crucial means for map-making: a few basemaps of the globe, different palettes for categorizing your data and some ready-made analysis tools that lie just behind a few clicks. Heatmaps, grids, clusters – you name it.
Temporal maps and animations
Truth be told, it’s the animations where Kepler really shines. Throw in any data with temporal values and the platform creates beautiful interactive maps that show how ships sail across the bond or how trains traverse through rail networks.
Our dataset contains a temporal aspect too: each parrot sighting has a specified date. Note that, with this particular dataset, a bit of tinkering with the data is needed to enable temporal animations: Kepler needs a column that it can recognize as time information. In our case we need to add “ 00:00” after every date in the eventdate column so that it is recognized as time, not just date information.
Once your data has a properly formatted time column, making a temporal visualization is as easy as setting a filter on the field that contains the time information.
Making your own basemap
The demo version itself should keep the casual user fiddling around for quite a while. But, of course, the boundaries can be moved even further: a logical next step to make your data visualizations even prettier is to make your own basemaps in Mapbox studio and use them in your Kepler projects.
Making a base map from scratch can be intimidating, but Mapbox studio has some helpful tools for this. For example, the map features are grouped thematically, and each group can be customized separately. This makes it easy to pick which types of features you want your base map to focus on.
When it comes to map styling, the sky’s the limit really. If you are looking for some inspiration, Mapbox has quite good documentation for this.
Once you have your new fancy style, using it is quite simple: add a new base map in the base map section and paste the URL of your style. For example, here’s the style used in this post: mapbox://styles/eemilhaa/cl484bx2m000d14pl7z1cjyse
As a side note, you can use your own custom-made maps through a WMTS as well, for example in QGIS!
Exporting your maps
Once you have your finished map, the next thing in line is usually sharing it. Luckily, with Kepler this is as easy as it gets. From the share tray select export, and then pick either html or json as the output file format. What you choose here matters a bit: json means your map gets saved as a Kepler configuration file that you can load with Kepler, while selecting html produces a stand-alone html file that you can open with a web browser to access your map. All data and styling is included in the output file regardless of filetype!
Even more use cases
In addition to the demo version that can be used in a web browser, Kepler maps can be brought to many different environments based on the use case. For example, one such case could be using Kepler as a means for producing quick explorative visualizations when doing data analysis in a Python environment.
Of course, Kepler also provides a chance for developers to dig much, much deeper. Kepler maps can be embedded into other applications, and, being an open source project, Kepler itself can be built, customized and run locally. This enables expanding its limits and interface even further to truly take control of every detail. One such example could be the Northern growth zone information service implemented by Gispo a couple of years ago.
If all this sounds very interesting, but you think you need help, or maybe some professionals to do the dirty work for you, you can send us a message!