Keywords

1 Introduction

The development of mobile devices and digital map services allows us to read maps not only on paper but also on electronic display devices. This technology advancement enables us to zoom in and out of the map content for an overview and details of areas of interest and is especially important to dynamically explore the map content across multiple scales within limited screen space. In addition, annotation labels help precisely locate specific geographic positions on maps and clearly discriminate them from the names of other places. Thus, laying out such labels consistently across the map scales will provide better readability of the map content on digital devices. However, consistency in label placement leads to technically challenging problems. Figure 1 shows specific types of such unwanted behaviors in which we can see popping effects and sudden leaps by the annotation labels as the scale changes. Avoiding visual distractions in label placement across multiple scales usually requires high computational costs because we have to investigate all possible combinations of labels and their spatial placement.

Fig. 1
figure 1

Naïve inconsistent placement of labels as the scale changes from (a) to (b). All the labels that appear in (a) are expected to stay in (b) while some labels disappear (e.g., “Shimane” and “Yamaguchi”) and other labels (e.g., “Kumamoto” and “Miyazaki”) unexpectedly jump to different positions between the different map scales

One promising solution to this problem is to retain consistency in the label positions on a map irrespective of the change in the map scale. This consistent map labeling problem was formulated as active range optimization (ARO) (Been et al. 2006, 2010). The active range refers to the range of the map scale in which the corresponding label sticks to the unique position on the map domain. Thus, the consistent labeling problem can be solved by maximizing the total sum of active ranges in such a way that as many annotation labels as possible remain and as long as possible within the space spanned by the map domain and scale. To achieve this, we extend the conventional ARO approaches by introducing leader lines that connect between the point features and the annotation labels. This permits us to spare a little space between a point feature and its corresponding label, which eventually relaxes the degree of freedom in the label placement and thus is more likely to accommodate more labels within the map domain.

For maximizing the total active range, we employ a genetic-based approach to seek better placement of the annotation labels across the multiple map scales. Specifically, we optimize the order of the labels to be placed and find the best order, where we try to place the labels in a greedy fashion according to the corresponding order. This allows us to finalize the best order of the labels that maximizes the visibility of consistent label placement across the entire range of the map scale.

Our technical contribution lies in the sophistication of previous techniques for consistently placing labels across multiple scales, by introducing leader lines that connect point features and labels to take advantage of the space around the point features. This labeling design is particularly useful for visualizing areas that have heterogeneous distributions of point features in such a way that they form a set of local clusters. This is because we can place annotation labels even when they are slightly away from the corresponding point features with the help of leader lines and thus can increase the total number of labels to be placed in the map. Figure 2 gives an example of such consistent placement of labels together with leader lines. After providing several experimental results, we compare the conventional label placement without leader lines and the proposed label placement with leader lines to demonstrate the feasibility of our labeling approach. While the leader line approach lends itself to relatively narrow land areas surrounded by water, as is the case with Japan, there are many other areas where it would be of use.

Fig. 2
figure 2

Label placements (a) without leader lines (#{labels} = 22) and (b) optionally with leader lines (#{labels} = 26). We can place more labels by selectively employing leader lines to take advantage of available space within the map domain

The remainder of this paper is structured as follows. In Sect. 2, we briefly summarize the most relevant literature to this study. In Sect. 3, we present an overview of our visualization framework, including the design of the leader drawing styles for consistent dynamic label placement. In Sect. 4, we then detail an algorithm for the extended ARO, which is effectively solved by the genetic-based heuristic and greedy label placement scheme. In Sect. 5, we provide several results generated by our system to demonstrate the feasibility of our approach. Finally, in Sect. 6, we conclude the paper and propose potential future extensions.

2 Related Work

2.1 Static Map Labeling

Cartographers have investigated the conception of text discrimination, which is evaluated for noticing the difference between features in cartography and has been shown to be a key factor for map design (MacEachren 1995; Chiang et al. 2014). To improve text discrimination, labeling principles have been studied and summarized in several pioneering works (Yoeli 1972; Imhof 1975). Wolff (2009) conducted an extensive survey of techniques for automatic map labeling and thus provided specific instructions for cartographic name placement. For example, gradient-descent optimization (Hirsch 1982) and the integer programming model (Zoraster 1986) are classical static map labeling techniques that follow an empirical investigation to demonstrate the feasibility of each algorithm (Christensen et al. 1995). Afterward, a genetic algorithm was introduced to accelerate the computation time (Raidl 1998). Other map features, such as lines and areas, have also been considered to improve the readability of labels on maps (Edmondson et al. 1997; Luboschik et al. 2008), and domain-assisted label placement called boundary labeling (Bekos et al. 2007, 2015) was developed for this purpose. Appropriately drawing different leader line styles for label placement enhances map readability effectively (Lin 2010; Meng et al. 2015).

2.2 Dynamic Map Labeling

In practice, mobile devices are used for viewing maps, and thus, effective navigation, such as annotating labels within a lens, has become a popular solution (Fekete and Plaisant 1999). Fink et al. (2012) enhanced this layout by optimizing multiple design rules, such as minimizing the total leader length and distance between labels, and thus provided beautiful label placement in static and dynamic environments. A two-step labeling approach was introduced by Petzold et al. (2003), where the system computes conflicted labels in a preprocessing process and then applies the results to the user navigation. Gemsa et al. (2013) also conducted trajectory-oriented map labeling, where consistent label placement is computed that refers to moving history. These techniques were developed in a fixed scale and less consider the visual consistency of label placement during user interaction.

Schwartges et al. (2014) presented a slider model to move labels along the associated site points during scale changes, while a waiting function is employed to avoid flickering effects. As pioneering work on consistent label placement, Poon and Shin (2005) conducted another study on consistent label placement; however, in this approach, the orientation of a label is fixed. A significant extension of this approach was then proposed by Been et al. (2006, 2010) in which they relaxed the restrictions on the algorithm to place labels of various sizes. The method optimizes the active ranges of all labels by plotting rectangular pyramids in the three-dimensional (3D) space to compute the conflicts of labels at individual scales. Recently, this work was extended by Zhang et al. (2015) in which the active ranges are designed to be selectable, and the total weight of the associated ranges is maximized.

In this study, we relax the limitation of the approach proposed by Been et al. (2006, 2010) so that labels with leader lines can be employed to improve map readability. A genetic-based approach is introduced to solve the ARO problem (Raidl 1998; Wu et al. 2011), which provides an effective means for the map labeling problem, especially for optimizing fitness functions without being trapped by local extrema.

3 Design Principles for Label Placement

In this section, we provide an overview of the proposed approach with an explanation of the design principles for label placement. The primary technical challenge here is to develop scale-adaptive label placement while introducing leader lines in the ARO model. The key idea is to appropriately select a subset of visible labels at each scale to make full use of the available space around the corresponding point features. Leader lines effectively make it possible to increase such available space by connecting the labels and point features even when they are slightly away from each other.

In our approach, several design rules for placing annotation labels are introduced for this purpose. First, for each point feature, we allow an additional number of possible label positions that are a bit apart from the point feature as shown in Fig. 3b. The conventional label placement does not have leader lines as shown in Fig. 3a, which are all in touch with the point feature and commonly employed in geographical information systems (GISs). However, in this case, we often cannot find available labeling space especially in densely annotated regions where the point features are locally concentrated as a cluster because the four possible positions are more likely to be occupied first by other labels in the vicinity. In our approach, in addition to the conventional four positions (Fig. 3b top), we introduce 12 surrounding label positions (Fig. 3b, bottom) and connect the label and the feature point with a leader line if it can be placed in one of these 12 positions, where the leader line is assumed to be straight. Thus, leader lines will help us take advantage of more available space around the respective point features and still maintain the visual correspondence between the labels and the point features.

Fig. 3
figure 3

Possible label positions to a given site point. (a) The conventional four-position model (in orange) usually suffers from the lack of available space around the point feature. (b) Our new 16-position model (bottom) consists of not only the conventional four positions (top) but also 12 additional positions. For each, we use the leader lines to connect the label and the point feature

Please also note that each possible label position is indexed by the ID ranging from 1 to 16 as shown in Fig. 3b, where we employ horizontal leader lines for the positions indexed by 5, 8, 9, and 12, vertical leader lines for the positions indexed by 6, 7, 10, and 11, and diagonal leader lines for the positions indexed by 13, 14, 15, and 16. Employing horizontal and vertical leader lines for the eight new label positions out of 12 effectively helps avoid unnecessary conflicts with existing annotation labels when composing scale-aware consistent label placement. Furthermore, these IDs indicate the order of preference for the 16 label positions at each point feature, which means that the smaller ID corresponds to a better label position. Based on this design principle, our algorithm will search for the position of each label in this preference order to arrange the label as close as possible while maximally keeping it to the top right of the point feature. Of course, this search process is conducted under the assumption that all the labels are placed without mutual overlap within the map domain at the respective scales.

Nonetheless, avoiding overlapping labels at multiple map scales inevitably results in inconsistent placement of labels as shown in Fig. 1. To solve this problem, we avoid such overlapping by considering the 3D space spanned by the 2D map domain and scale, by following the conventional ARO formulation (Been et al. 2006, 2010). In cartography, the map scale s often refers to the degree of magnification of the specific map region, which also indicates that the larger cartographic scale provides a more detailed representation. However, in this paper, we employ the zooming scale r (Been et al. 2006), which is defined as the inverse of the cartographic scale s (i.e., r = 1/s), as the map scale for later convenience. This implies that the labels tend to easily collide with each other once the zooming scale becomes larger as illustrated in Fig. 4a, and thus, the leader lines provide a powerful means of alleviating such conflicts among the labels. The idea permits us to utilize available space around the individual point features and encourages us to improve the associated map readability by maximizing the number of labels placed on the map.

Fig. 4
figure 4

Active ranges in the 3D space spanned by the map domain (x, y) and the zooming scale r. (a) The cross section of the pyramidal active range volume. (b) The top face of the active range consists of the set of possible label positions and its center corresponds to the feature point. (c) Greedy placement of active ranges by referring to a specific chromosome. (d) Possible conflicts among labels and leader lines in the active range optimization

4 Consistent Label Placement with Leader Lines

In this section, we describe how we extended Been et al.’s conventional ARO approach for implementing consistent placement of map labels with their leader lines across the scale. We explain our approach in three subsections: genetic-based optimization of active ranges, occlusion-free placement of labels and leader lines, and fitness evaluation of their spatial layout.

4.1 Genetic-Based Optimization of Active Ranges

As described previously, we employ the ARO technique (Been et al. 2006, 2010) to maintain the consistency in the label placement across multiple scales. For this purpose, we introduce genetic algorithms to optimize the placement of pyramidal active range volumes in the 3D space while avoiding unwanted overlap among labels at individual scales. In our formulation, we first encode a specific sequence of label IDs as a chromosome, then try to greedily place the active range volumes in this order (see Sect. 4.2), and finally evaluate the fitness of the chromosome by referring to the resultant label placement (see Sect. 4.3).

In this optimization, we initialize a set of chromosomes by randomizing the individual sequences of label IDs and prepare it as the population of the first generation. During the optimization phase, we try to update the population with the next generation by evolving the individual chromosomes. This is usually conducted by applying the crossover and mutation operations and replacing the existing chromosomes with superior ones to finally compose a set of elite chromosomes.

4.2 Occlusion-Free Placement of Labels and Leader Lines

Now we are ready to consider how we can find the actual placement of pyramidal active ranges in the 3D space by referring to chromosomes, each of which encodes an individual order of label IDs. Note that the top face of each pyramidal active range in the 3D space contains the 16 label positions while the center of the face corresponds to the point feature, as shown in Fig. 4b. Suppose that we currently have a specific order of label IDs as a chromosome and have already finished placing the i-th label a i , as shown in Fig. 4c. In this case, we first investigate how the pyramidal active range of the next j-th label a j overlaps with the set of existing active ranges, by properly sampling the map scale. The light blue region indicates the available space for the label to be placed next. Among possible positions of the label, we select the one that has the largest active range in the map scale, which implies that we employ the active range in blue from the available 3D space. Furthermore, we also have to record the 3D space that is already occupied because this is no longer available for the labels to be placed later.

We also have to avoid unexpected overlap between the labels and leader lines when we select one of the newly introduced 12 label positions as shown in Fig. 4d. For this purpose, we approximate the shape of each leader line as a bounding box that encloses the line. For example, we employ a thin rectangle as the bounding box if the leader line is exactly horizontal or vertical. If the leader line is slanted, we insert a normal rectangle as the leader line’s bounding box in such a way that the diagonal of the rectangle coincides with the leader line. This inevitably increases the number of bounding boxes we have to maintain at each sampled map scale while effectively facilitates implementation of consistent label placement with leader lines by taking advantage of existing data structures.

4.3 Fitness Evaluation of the Label Placement

The final task is to formulate the fitness function for each chromosome, so that we can systematically improve the set of chromosomes during the genetic-based evolution. In our approach, we employ the following function

$$ \left\{ {\text{Weight}} \right\} \times \left( {M - \left\{ {\text{Label position ID}} \right\}} \right) \times \left\{ {\text{Active range}} \right\}, $$
(1)

to evaluate the fitness of an individual label. Here, {Weight} is the weight assigned to the label, {Label position ID} is the ID among the 16 label positions, and {Active range} is the size of the corresponding active range on the map scale. Moreover, we set M = 20 in Eq. (1) so that we can assign larger fitness values for the smaller label position IDs. We sum up the fitness values for all the labels to evaluate the overall label placement of each chromosome. During the chromosome evolution in the optimization, we maximize this fitness function to find a satisfactory solution for the scale-aware label placement.

5 Results

We employed a dataset that has 3, 887 point features over Japan as a demonstration example. Figure 5 shows several screenshots of label placements around Tokyo in Japan. The results were generated using our genetic-based optimization approach, where from top to bottom we zoomed in on the map by progressively reducing the zooming scale. Note that the images on the left were generated using a naïve approach, which optimized the label placement individually at the respective scales and thus could increase the number of visual labels at the cost of inconsistency in the layout of labels and leader lines across multiple scales. However, the image on the right reveals scale-aware consistent placement of labels synthesized using our approach, that successfully avoids the unexpected pop-up effects of labels and leader lines and retains their positions and drawing styles. For example, the county name “Chosei” (in green on the bottom right of the map) changes its position in the naïve inconsistent label placement (on the left of Fig. 5), while it naturally appears as the zooming scale decreases in the consistent label placement (on the right of Fig. 5). The consistent placement is much more reasonable because labels with low priority naturally disappear as we zoom out on the map. Note that here we draw the leader lines together with the corner of the corresponding label boxes by following the styles suggested in Meng et al. (2015).

Fig. 5
figure 5

Label placement around Tokyo, Japan. Left Naïve inconsistent placement. Right Scale-aware consistent placement. Different colors are assigned to the names according to their administrative levels; the prefecture, city, county, and town names are in red, orange, green, and gray, respectively

Figure 6 presents the optimal label placement around Osaka in Japan, where the left and right columns show the label placement using the conventional four label positions and the proposed 16 label positions, respectively. Here, both placements avoid unwanted popping effects and sudden leaps of the labels and successfully maintain consistency across successive scales. Nonetheless, the results in the right column clearly demonstrate that our approach maximally utilizes the space outside the boundary of Japan for accommodating more labels to be placed especially in densely annotated regions. Furthermore, our new approach allows us to avoid distracting conflicts between the labels and the leader lines while keeping the overall layout as tight as possible.

Fig. 6
figure 6

Label placement around Osaka, Japan. Left Consistent placement with four label positions. Right Consistent placement with 16 label positions. Different colors are assigned to the names according to their administrative levels; the prefecture, city, county, and town names are in red, orange, green, and gray, respectively

Figure 7 shows the comparison between the results using the conventional four label positions and the proposed 16 label positions, where we summarize the numbers of labels that can be embedded in the entire map of Japan at the respective scales. Note that the horizontal axis of this chart represents the approximate distance of each side of the map square domain, which is proportional to the power of the corresponding scale. The comparison shows that we can increase the number of labels placed on the map especially when the zooming scale is large, to optimize the use of available map space when we zoom out on the map.

Fig. 7
figure 7

Comparison between the label placement with the conventional four label positions and the new 16 label positions. The chart summarizes the number of labels that can be embedded in the entire map of Japan (the vertical axis) for the respective scales (i.e., distances of the sides of the map domain (km; the horizontal axis))

6 Conclusion and Future Work

In this paper, we presented an approach for consistently placing labels across multiple scales by introducing leader lines for the conventional active range optimization problem. The approach allows us to incorporate more annotation labels into the map domain without unwanted artifacts, such as overlapping among labels and distracting popping effects across multiple scales. The visibility of the annotation labels is maximized using genetic algorithms by optimizing the order of the labels in which they are embedded in the map domain in a greedy fashion.

Our future directions include accelerating our genetic-based computation by grouping labels into several clusters of reasonable size, as well as combining them together to form the entire label placement. Other potential extensions include investigating additional aesthetic constraints for the label placement in terms of country borders, administrative districts, ponds and rivers, as well as the layout of transportation systems.