Dynamic maps that allow continuous map rotations, e.g., on mobile devices, encounter new issues unseen in static map labeling before. We study the following dynamic map labeling problem: The input is a static, labeled map, i.e., a set P of points in the plane with attached nonoverlapping horizontal rectangular labels. The goal is to find a consistent labeling of P under rotation that maximizes the number of visible labels for all rotation angles such that the labels remain horizontal while the map is rotated. A labeling is consistent if a single active interval of angles is selected for each label such that labels neither intersect each other nor occlude points in P at any rotation angle. We first introduce a general model for labeling rotating maps and derive basic geometric properties of consistent solutions. We show NP completeness of the active interval maximization problem even for unitsquare labels. We then present a constant-factor approximation for this problem based on line stabbing, and refine it further into an efficient polynomial-time approximation scheme (EPTAS). Finally, we extend the EPTAS to the more general setting of rectangular labels of bounded size and aspect ratio.


1 Introduction

Dynamic maps, in which the user can navigate continuously through space, are becoming increasingly important in scientific and commercial GIS applications as well as in personal mapping applications. In particular GPS-equipped mobile devices offer various new possibilities for interactive, location-aware maps. A common principle in dynamic maps is that users can pan, rotate, and zoom the map view. Despite the popularity of several commercial and free applications, relatively little attention has been paid to provably good labeling algorithms for dynamic maps.


Been et al. [2] identified a set of consistency desiderata for dynamic map labeling. Labels should neither "jump" (suddenly change position or size) nor "pop" (appear and disappear more than once) during monotonous map navigation; moreover, the labeling should be a function of the selected map viewport and not depend on the user's navigation history. Previous work on the topic has focused solely on supporting zooming and/or panning of the map [2,3,11],whereas consistent labeling under map rotations has not been considered prior to this paper.


Most maps come with a natural orientation (usually the northern direction facing upward), but applications such as car or pedestrian navigation often rotate the map view dynamically to be always forward facing [5]. Still, the labels must remain horizontally aligned for best readability regardless of the actual rotation angle of the map. A basic requirement in static and dynamic label placement is that labels are pairwise disjoint, i.e., in general not all labels can be placed simultaneously. For labeling point features, it is further required that each label, usually modeled as a rectangle, touches the labeled point on its boundary. It is often not allowed that labels occlude the input point of another label. Figure 1 shows an example of a map that is rotated and labeled. The objective in map labeling is usually to place as many labels as possible. Translating this into the context of rotating maps means that, integrated over one full rotation from 0 to 2π, we want to maximize the number of visible labels. The consistency requirements of Been et al. [2] can immediately be applied for rotating maps.


Our Results. Initially, we define a model for rotating maps and show some basic properties of the different types of conflicts that may arise during rotation. Next, we prove that consistently labeling rotating maps is NP-complete, for the maximization of the total number of visible labels in one full rotation and NP hard for the maximization of the visibility range of the least visible label. Finally, we present a new 1/4-approximation algorithm and an efficient polynomial-time approximation scheme (EPTAS) for unit-height rectangles. A PTAS is called efficient if its running time is O(f(ε)·poly(n)). Both algorithms can be extended to the case of rectangular labels with the property that the ratio of the smallest and largest width, the ratio of the smallest and largest height, as well as the aspect ratio of every label is bounded by a constant, even if we allow the anchor point of each label to be an arbitrary point of the label. This applies to most practical scenarios where labels typically consist of few and relatively short lines of text.


Related Work. Most previous algorithmic research efforts on automated label placement cover static labeling models for point, line, or area features. For static point labeling, fixed-position models and slider models have been introduced [4, 8], in which the label, represented by its bounding box, needs to touch the labeled point along its boundary. The label number maximization problem is NP-hard even for the simplest labeling models, whereas there are efficient algorithms for the decision problem that asks whether all points can be labeled in some of the simpler models (see the discussion by Klau and Mutzel [7] or the comprehensive map labeling bibliography [14]). Approximation results [1,8], heuristics [13], and exact approaches [7] are known for many variants of the static label number maximization problem.


In recent years, dynamic map labeling has emerged as a new research topic that gives rise to many unsolved algorithmic problems. Petzold et al. [12] used a preprocessing step to generate a reactive conflict graph that represents possible label overlaps for maps of all scales. For any fixed scale and map region, their method computes a conflict-free labeling using heuristics. Mote [10] presents another fast heuristic method for dynamic conflict resolution in label placement that does not require preprocessing. The consistency desiderata of Been et al. [2] for dynamic labeling (no popping and jumping effects when panning and zooming), however, are not satisfied by either of the methods. Been et al. [3] showed NP-hardness of the label number maximization problem in the consistent labeling model and presented several approximation algorithms for the problem. N¨ollenburg et al. [11] recently studied a dynamic version of the alternative boundary labeling model, in which labels are placed at the sides of the map and connected to their points by leaders. They presented an algorithm to precompute a data structure that represents an optimal one-sided labeling for all possible scales and thus allows continuous zooming and panning. None of the existing dynamic map labeling approaches supports map rotation.


2 Model

In this section we describe a general model for rotating maps with axis-aligned rectangular labels. Let M be a labeled input map, i.e., a set P = {p1,...,pn} of points in the plane together with a set L = {1,...,n} of pairwise disjoint, closed, and axis-aligned rectangular labels, where each point pi is a point on the boundary ∂i of its label i. We say i is anchored at pi. As M is rotated, each label i in L remains horizontally aligned and anchored at pi. Thus, label intersections form and disappear during rotation of M. We take the following alternative perspective on the rotation of M. Rather than rotating the points, say clockwise, and keeping labels horizontal we may instead rotate each label around its anchor point counterclockwise and keep the set of points fixed. It is easy to see that both rotations are equivalent and yield exactly the same results.


A rotation of L is defined by a rotation angle α ∈ [0,2π); a rotation labeling of M is a function φ: L×[0,2π) →{0,1}such that φ(,α) = 1 if label is visibleor active in the rotation of L by α, and φ(,α) = 0 otherwise. We call a labeling φ valid if, for any rotation α, the set of labels L(α) = { ∈ L | φ(,α) = 1} consists of pairwise disjoint labels and no label in L(α) contains any point in P (other than its anchor point). We note that a valid labeling is not yet consistent in terms of the definition of Been et al. [2,3]: given fixed anchor points, labels clearly do not jump and the labeling is independent of the rotation history, but labels may still pop during a full rotation from 0 to 2π, i.e., appear and disappear more than once. In order to avoid popping effects, each label may be active only in a single contiguous range of [0,2π), where ranges are circular ranges modulo 2π so that they may span the input rotation α = 0. A valid labeling φ, in which for every label the set Aφ() = {α ∈ [0,2π) | φ(,α) = 1} is a contiguous range modulo 2π, is called a consistent labeling. For a consistent labeling φ the set Aφ() is called the active range of . The length |Aφ()| of an active range Aφ() is defined as the length of the circular arc {(cosα,sinα) | α ∈ Aφ(`)} on the unit circle.

L的旋转定义为旋转角α∈[0,2π);M的旋转标注是函数φ:l×[0,2π)→{0,1}使φ(l,α)=1,如果标签l在α的旋转中可见或活跃,否则的话φ(l,α)=0.。我们称一个标注函数φ为有效的,如果对于任何旋转α,标记集L(α)={l∈L | (φ(l,α)=1}由两两不相交的标记组成,且L(α)中的任何标记都不包含P中的任何点(除了它的锚点之外)。我们注意到,有效的标记在定义等方面与参考文献[2,3]还不一致:给定固定的锚点,标签明显不跳,标签独立于旋转历史,但标签仍然可能在0到2π的全旋转期间弹出,即出现和消失不止一次。为了避免弹出效果,每个标签只能在[0,2π)的单个连续范围内活动,其中范围是模2π的圆形范围,因此它们可以跨越输入旋转α=0。一个有效的标记函数φ称为持续性标注,其中对每一个标签 l 集合 Aφ(l)={α∈[0,2π)|φ(,α)=1}是一个连续的模2π.。对于持续性标注函数φ,集合Aφ(l)称为标注l的活动范围。有效范围Aφ(l)的长度length|Aφ(l)|`定义为单位圆上的圆弧{(cosα,sinα)|α∈Aφ(l)}的长度。



3 Properties of consistent labelings

这一部分展示持续性标注的基本属性。两个标注l和l'在旋转角度α下相交表示他们在α下有冲突,即在持续性标注下他们之中顶多有一个可以在α下展示集合 C(l,l') = {α ∈ [0,2π) | l and l' are in conflict at α}成为l和l'的冲突集合。



证明过程简单说就是标注都是保持水平对齐的,也就是说横轴与横轴平行,竖轴与竖轴平行,所以相交情况就只有四种: t∩b', b∩t', l ∩r', and r ∩l'。这四种情况随着旋转方向的变化可能出现两次,所以总共算下来是8种情况。每个冲突都定义了一个唯一的旋转角度,并且很明显,以这8个旋转角度作为端点最多可以定义4个不相交的冲突范围。下面八个图显示了八种相交方式,锚点使用黑点表示