A Labeling Model Based on the Region of Movability for Point-Feature Label Placement
Abstract
:1. Introduction
2. Methodology
2.1. Region of Movability
2.2. Label Placement Process
- (1)
- Generation of candidate positions: Given a point feature, obtain the conflict-free space (region of movability) for the label. Then, refine this continuous search space to a number of discrete candidate positions.
- (2)
- Evaluation of candidate positions: Given a label, compute the score that indicates its quality with respect to various evaluation factors.
- (3)
- Selection of label positions: Given a set of candidate label positions for each point feature, select one label position from each set to maximize the overall quality of the labeling, as measured in the evaluation phase.
2.2.1. Generation of Candidate Positions
(i) Candidate Search Space Generation
(ii) Candidate Label Position Selection
- (1)
- Equally divide the outline of the label textbox with the horizontal and vertical intervals of w and h to produce n discrete points as the reference points for distance computation, as shown in Figure 7a.
- (2)
- Choose point M as the reference point from n discrete points. Then, within the candidate label region, find the position from which the point M is nearest to the point feature to be a candidate label position, as shown in Figure 7b.
- (3)
- Repeat Step 2 to select all of the other reference points for the total n candidate label positions. (When the map features are too crowded, then the candidate positions fail to be generated because of the limited candidate label region; thus, the default positions in the fixed-position model are used.)
2.2.2. Evaluation of the Candidate Positions
- Conflict or overlap between labels and graphical features.
- A priori preferences among a set of candidate label positions.
- Association between a label and its corresponding feature.
2.2.3. Selection of Label Positions
- For each point feature, place its label randomly in any of the candidate positions.
- Initialize the temperature T to a high initial value To.
- Repeat the following steps until the temperature T falls below a given threshold value Tc:
- (a)
- Decrease the temperature T according to an annealing schedule.
- (b)
- Randomly pick a label and move it to a new randomly chosen candidate position.
- (c)
- Compute ΔE, the change of the objective function caused by moving the label.
- (d)
- If the new labeling is worse, undo the label repositioning with the probability .
Algorithm 1 Region of movability based point-feature labeling |
Input: U: the point features to be labeled (with corresponding label width and height) O: the point obstacles L: the line obstacles P: the polygon obstacles Start: (1) repeat (2) Select a point u from U, and get its textbox polygon t according to the width and height (3) Calculate the original search space g for the point u according to t and label-feature distance threshold value r (4) Get the obstacles from O, L and P which occlude the labeling region g (5) Based on these obstacles, calculate the region of movability s for point u with Minkowski addition (6) Get the reference point set V of the textbox t (7) repeat (8) Select a reference point v from V (9) Find the candidate label position c within the region s, which makes the distance between reference point v and point u shortest (10) Add c to the candidate label position set Cu for point u (11) until the candidate label position is created for every reference point from V (12) Add Cu to the candidate label position sets C (13) until the candidate label position set is created for every point in U (14) initialize randomly choose label position from C for each point to initialize the labeling solution z (15) repeat (16) Improve the solution z with simulated annealing process (17) until the temperature for simulated annealing falls below a given threshold value (18) Create the labeling result layer R according to the solution z Output: R: the labeling result layer |
3. Experiments
3.1. Labeling with Only Point Features
3.2. Labeling with Point, Line, and Area Features
3.3. Placement of Arbitrarily Shaped Labels
4. Conclusions
Acknowledgments
Author Contributions
Conflicts of Interest
References
- Imhof, E. Positioning names on maps. Am. Cartogr. 1975, 2, 128–144. [Google Scholar] [CrossRef]
- Wagner, F.; Wolff, A. A combinatorial framework for map labeling. In Graph Drawing; Whitesides, S.H., Ed.; Springer: Berlin, Germany, 1998; pp. 316–331. [Google Scholar]
- Christensen, J.; Marks, J.; Shieber, S. An empirical study of algorithms for point-feature label placement. ACM Trans. Graph. 1995, 14, 203–232. [Google Scholar] [CrossRef]
- Iturriaga, C.; Lubiw, A. NP-Hardness of Some Map Labeling Problems; University of Waterloo: Waterloo, ON, Canada, 1997. [Google Scholar]
- Marks, J.; Shieber, S.M. The Computational Complexity of Cartographic Label Placement; Harvard University: Cambridge, MA, USA, 1991. [Google Scholar]
- Ribeiro, G.M.; Mauri, G.R.; Lorena, L.A.N. A lagrangean decomposition for the maximum independent set problem applied to map labeling. Oper. Res. 2011, 11, 229–243. [Google Scholar] [CrossRef]
- Gomes, S.P.; Ribeiro, G.M.; Lorena, L.A.N. Dispersion for the point-feature cartographic label placement problem. Expert Syst. Appl. 2013, 40, 5878–5883. [Google Scholar] [CrossRef]
- Rabello, R.L.; Mauri, G.R.; Ribeiro, G.M.; Lorena, L.A.N. A clustering search metaheuristic for the point-feature cartographic label placement problem. Eur. J. Oper. Res. 2014, 234, 802–808. [Google Scholar] [CrossRef]
- Schwartges, N.; Haunert, J.H.; Wolff, A.; Zwiebler, D. Point labeling with sliding labels in interactive maps. In Connecting a Digital Europe through Location and Place; Springer International Publishing: Cham, Switzerland, 2014; pp. 295–310. [Google Scholar]
- Do Nascimento, H.A.D.; Eades, P. User hints for map labeling. J. Vis. Lang. Comput. 2008, 19, 39–74. [Google Scholar] [CrossRef]
- Van Kreveld, M.; Strijk, T.; Wolff, A. Point labeling with sliding labels. Comput. Geom. Theory Appl. 1999, 13, 21–47. [Google Scholar] [CrossRef]
- Klau, G.W.; Mutzel, P. Optimal labeling of point features in rectangular labeling models. Math. Program. 2003, 94, 435–458. [Google Scholar] [CrossRef]
- Raidl, G.R. A genetic algorithm for labeling point features. In Proceedings of the International Conference on Imaging Science, Systems, and Technology, Las Vegas, NV, USA, July 1998; pp. 189–196.
- Yamamoto, M.; Camara, G.; Lorena, L.A.N. Tabu search heuristic for point-feature cartographic label placement. Geoinformatica 2002, 6, 77–90. [Google Scholar] [CrossRef]
- Cravo, G.L.; Ribeiro, G.M.; Nogueira Lorena, L.A. A greedy randomized adaptive search procedure for the point-feature cartographic label placement. Comput. Geosci. 2008, 34, 373–386. [Google Scholar] [CrossRef]
- Ribeiro, G.M.; Lorena, L.A.N. Lagrangean relaxation with clusters for point-feature cartographic label placement problems. Comput. Oper. Res. 2008, 35, 2129–2140. [Google Scholar] [CrossRef]
- Mauri, G.R.; Ribeiro, G.M.; Lorena, L.A.N. A new mathematical model and a lagrangean decomposition for the point-feature cartographic label placement problem. Comput. Oper. Res. 2010, 37, 2164–2172. [Google Scholar] [CrossRef]
- Alvim, A.C.F.; Taillard, E.D. Popmusic for the point feature label placement problem. Eur. J. Oper. Res. 2009, 192, 396–413. [Google Scholar] [CrossRef]
- Wagner, F.; Wolff, A.; Kapoor, V.; Strijk, T. Three rules suffice for good label placement. Algorithmica 2001, 30, 334–349. [Google Scholar] [CrossRef]
- Luboschik, M.; Schumann, H.; Cords, H. Particle-based labeling: Fast point-feature labeling without obscuring other visual features. IEEE Trans. Vis. Comput. Graph. 2008, 14, 1237–1244. [Google Scholar] [CrossRef] [PubMed]
- Kameda, T.; Imai, K. Map label placement for points and curves. IEICE Trans. Fundam. Electron. Commun. Comput. Sci. 2003, E86A, 835–840. [Google Scholar]
- Ebner, D.; Klau, G.W.; Weiskircher, R. Label number maximization in the slider model (extended abstract). In Graph Drawing; Springer: New York, NY, USA, 2004; pp. 144–154. [Google Scholar]
- Hirsch, S.A. An algorithm for automatic name placement around point data. Am. Cartogr. 1982, 9, 5–17. [Google Scholar] [CrossRef]
- Doddi, S.; Marathe, M.V.; Mirzaian, A.; Moret, B.M.; Zhou, B. Map labeling and its generalizations. In Proceedings of the 8th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA’97), New Orleans, LA, USA, 13–23 December 1997; pp. 148–157.
- Strijk, T.; van Kreveld, M. Practical extensions of point labeling in the slider model. Geoinformatica 2002, 6, 181–197. [Google Scholar] [CrossRef]
- Poon, S.H.; Shin, C.S.; Strijk, T.; Uno, T.; Wolff, A. Labeling points with weights. Algorithmica 2004, 38, 341–362. [Google Scholar] [CrossRef]
- Yoeli, P. The logic of automated map lettering. Cartogr. J. 1972, 9, 99–108. [Google Scholar] [CrossRef]
- Rylov, M.A.; Reimer, A.W. Improving label placement quality by considering basemap detail with a raster-based approach. GeoInformatica 2014, 19, 463–486. [Google Scholar] [CrossRef]
- Sack, J.-R.; Toussaint, G.T. Translating polygons in the plane. In Stacs 85: 2nd Annual Symposium on Theoretical Aspects of Computer Science Saarbrücken, January 3–5, 1985; Mehlhorn, K., Ed.; Springer: Berlin, Germany, 1985; pp. 310–321. [Google Scholar]
- Lin, M.; Gottschalk, S. Collision detection between geometric models: A survey. In Proceedings of the IMA Conference on Mathematics of Surfaces, Birmingham, UK, 31 August–2 September 1998; pp. 602–608.
- Kockara, S.; Halic, T.; Iqbal, K.; Bayrak, C.; Rowe, R. Collision detection: A survey. In Proceedings of the IEEE International Conference on Systems, Man and Cybernetics, Montreal, QC, Canada, 7–10 October 2007; pp. 4046–4051.
- Sack, J.-R.; Toussaint, G.T. Separability of pairs of polygons through single translations. Robotica 1987, 5, 55–63. [Google Scholar] [CrossRef]
- Ghosh, P.K. A solution of polygon containment, spatial planning, and other related problems using minkowski operations. Comput. Vis. Graph. Image Process. 1990, 49, 1–35. [Google Scholar] [CrossRef]
- Ghosh, P.K. An algebra of polygons through the notion of negative shapes. CVGIP Image Underst. 1991, 54, 119–144. [Google Scholar] [CrossRef]
- Edmondson, S.; Christensen, J.; Marks, J.; Shieber, S.M. A general cartographic labeling algorithm. Cartogr. Int. J. Geogr. Inf. Geovis. 1996, 33, 13–24. [Google Scholar]
- Zhang, Q.; Harrie, L. Placing text and icon labels simultaneously: A real-time method. Cartogr. Geogr. Inf. Sci. 2006, 33, 53–64. [Google Scholar] [CrossRef]
- Zoraster, S. Practical results using simulated annealing for point feature label placement. Cartogr. Geogr. Inf. Syst. 1997, 24, 228–238. [Google Scholar] [CrossRef]
- Kapoor, V.; Kühl, D.; Wolff, A. A tutorial for designing flexible geometric algorithms. Algorithmica 2002, 33, 52–70. [Google Scholar] [CrossRef]
- Wolff, A. General Map Labeling. Available online: http://i11www.iti.uni-karlsruhe.de/~awolff/map-labeling/general/ (accessed on 27 August 2016).
Type | Textbox | Point | Line | Area |
---|---|---|---|---|
Figure |
Parameter | Definition | Value |
---|---|---|
To | Initial temperature for simulated annealing | 20 |
Tc | Threshold temperature for simulated annealing | 0.01 |
A | Temperature cooling rate for simulated annealing | 0.975 |
M | Reposition times for each annealing stage | 20 × N |
K | Maximum accepted times for an immediately annealing | 5 × N |
Instance | Labeling Type | Map Feature | Number of Points |
---|---|---|---|
RandomRect | Labeling with point | Point | 500 |
RandomMap | 500 | ||
VariableDensity | 1000 | ||
RoadResident | Labeling with point, line, and area | Point, line, area | 558 |
WeatherMap | Placement of arbitrarily shaped labels | Point, line, area | 32 |
Instance | Four-Position Model | Four-Slider Model | The Proposed Model | |||
---|---|---|---|---|---|---|
Labels | Time(s) | Labels | Times(s) | Labels | Times(s) | |
RandomRect | 339 | 9.22 | 380 | 5.28 | 450 | 17.35 |
RandomMap | 224 | 11.93 | 205 | 4.81 | 358 | 21.39 |
VariableDensity | 833 | 16.91 | 925 | 8.55 | 960 | 30.66 |
© 2016 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC-BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Li, L.; Zhang, H.; Zhu, H.; Kuai, X.; Hu, W. A Labeling Model Based on the Region of Movability for Point-Feature Label Placement. ISPRS Int. J. Geo-Inf. 2016, 5, 159. https://doi.org/10.3390/ijgi5090159
Li L, Zhang H, Zhu H, Kuai X, Hu W. A Labeling Model Based on the Region of Movability for Point-Feature Label Placement. ISPRS International Journal of Geo-Information. 2016; 5(9):159. https://doi.org/10.3390/ijgi5090159
Chicago/Turabian StyleLi, Lin, Hang Zhang, Haihong Zhu, Xi Kuai, and Wei Hu. 2016. "A Labeling Model Based on the Region of Movability for Point-Feature Label Placement" ISPRS International Journal of Geo-Information 5, no. 9: 159. https://doi.org/10.3390/ijgi5090159
APA StyleLi, L., Zhang, H., Zhu, H., Kuai, X., & Hu, W. (2016). A Labeling Model Based on the Region of Movability for Point-Feature Label Placement. ISPRS International Journal of Geo-Information, 5(9), 159. https://doi.org/10.3390/ijgi5090159