Roman Empire Vector Map Tiles
Tags: Rdg2018, Maps

In our previous article, we wrote about the difference between raster tiles and vector tiles, http://commons.pelagios.org/2017/09/rdg-update-the-roman-empire-vector-map-project/. Now, we will be able to study the outcome. The technicalities of the process will be discussed, and the result as of now can be studied here https://klokantech.github.io/roman-empire/#3.97/45.49/6.47. The section “Display the vector tiles with style” goes over the functionalities of the map.

The input layers for the map have been extracted from the SQL-database of DARE, https://dare.ht.lu.se with a subset of the attributes, that is, places, roads, fortifications and provinces. The files can be edited in a desktop GIS application such as QGIS. Since we are publishing the data on Github, only data with an open license has been included in the project. They are all vector layers (point and line geometries) and have been converted to GeoJSON format in WGS 84 projection. They can be explored from the website of the project at Github, https://github.com/klokantech/roman-empire in the data directory and previewed on a map. Among the input files are also the icons (in SVG format) that depict places of different types, and server scripts.

The vector tile building process is set up to be automated which means that when one of the input files changes, updated vector tiles are generated to replace the old. The program behind this is called Tippecanoe and is developed by Mapbox, https://github.com/mapbox/tippecanoe. The program builds vector tilesets from collections of GeoJSON features and other input data. Each GeoJSON is first built as a MBTiles file (vector tile) and later merged together as a single file. It is, technically, a SQLite database. The current DARE base map, https://dare.ht.lu.se is also a topographic map containing a color relief and hillshade. They will be kept outside of the MBTiles file because they are built from raster data. In the final map, they will appear together with the MBTiles as separate layers. A detailed account on the specification and format of the MBTiles is outside of the scope of this article. However, it is basically a database file that can be addressed to output vector tiles given the zoom level and the x and y coordinates. This is the case in the pre-rendered raster tiles of the current DARE map as well. MBTiles needs to be hosted as a service on a web server. If you want to do this on your own, Klokantech has developed free server software for this purpose. The software is called TileServer GL, https://openmaptiles.org/docs/host/tileserver-gl/.

Composing a style

When using MBTiles, geodata and style are separate. This means that different styles can be applied to the same data to give the maps different looks at runtime. In this article, we show how this allows us to display place names in Latin, Ancient Greek and Modern names respectively. This works because the place data file store the different languages names in separate attribute fields. Maputnik is a free and open visual editor for styling MBTiles using Mapbox GL styles developed by Klokantech. Another one is Geofabrik and there are others, https://github.com/maputnik/editor. Figure 1 shows the style editor in Inspect Mode to study the raw geodata of the MBTiles file with pseudo-colors.

Figure 1: Maputnik in Inspect Mode displaying raw geodata

The plus and minus buttons in the top right corner of the interface let you zoom in and out the map. You can also use the mouse-wheel or similar devices. Upon zooming in on the map, additional details appear: it becomes too crowded to display all features at once. This map uses the same rules for display as the old raster map of DARE. At lower zoom levels important cities and legionary camps are displayed, followed by towns and forts, road stations, hillfort settlements and temples, and finally at zoom level 9 and above, villas, bridges and other types of places are displayed. The ordering of importance can of course be questioned and depends ultimately on what a particular user is interested in. The beauty of vector tiles is that this can be changed by applying a different style to the same data or use Javascript to manipulate the order.

At the bottom-left corner of the interface is a dropdown menu where the language for the place names can be selected. The options are Latin, Ancient Greek and Modern place names. Greek names are not available for all Latin place names, although it is a growing number of names. Try for yourself and see for instance how Massalia, becomes Μασσαλία and Marseille. In this case we are manipulating the loaded style directly. This effect could also have been achieved through changing the complete style. Since time-period is also part of the data, it is possible to make maps of different historical periods by changing the style of the map. Geodata itself could also be read directly from the map by calling API methods of Mapbox GL JS.