Pairwise Line Labeling of Geographic Boundaries

We present an algorithm that labels linear features with two matched toponyms describing the left and the right side of a line, respectively. Such a pairwise line labeling is a common technique used in manually produced maps (see Figure 1). The lines differentiate administrative divisions or other geographic subdivisions. The proposed method can be used on large-scale maps for labeling of areas when the scale becomes too large to label these features as areas, by placing the label inside the areal object. With pairwise line labeling, regions that lie on opposite sides of a boundary line can be identified without difficulty. The main visual advantage is that a map reader is informed about the exact nature of the line, not only its general type. This helps to easily distinguish boundaries from other linear objects and amplifies the precise graphic relation between the toponyms and the relevant map features. Another strong feature of such labeling is the consideration of two names as a unit or a single label. It means that the resulting map is free from partial designations, i.e. a label either on the left or on the right side of the object. Our approach solves two basic tasks of the automated map labeling problem, namely candidate-position generation and position evaluation for a given scale.  The quality of the name placement is evaluated by comparison to a set of established cartographic principles and guidelines for linear features. We give some results of our experiments based on real datasets. The implementation of our algorithm shows that it is simple and robust, and the resulting sample maps (see Figure 2) demonstrate its practical efficiency.

Figure 1. Example for manual usage of pairwise line labeling: provincial boundaries (bilingual) [1], zones for changing rules of engagement [2] and UTM grid zone changes [3], Source: Defense Mapping Agency (1973).

Figure 2. A sample map containing lettering of administrative boundaries together with other feature types such as roads, railways, districts, parks, etc.  Projection: spherical Mercator (EPSG:3857). Data source: © OpenStreetMap contributors (2013, data licensed under ODbL).

A set of maps involving pairwise line labeling of boundaries are available online through a web map tile service on the OpenMapSurfer web page. On this page the layers “OSM Roads” and “OSM Admin Boundaries” demonstrate the output of the algorithm on the OSM dataset for the whole globe.

The presented algorithm is implemented on top of the advanced cartographic framework called MapSurfer.NET.


Rylov, M., Reimer, A. (2015) “Pairwise Line Labeling of Geographic Boundaries: An Efficient and Practical Algorithm. ” Cartographic Perspectives, 79: pp. 5-21. DOI:10.14714/CP79.1212






Leave a Reply