Automatic label placement
   HOME

TheInfoList



OR:

Automatic label placement, sometimes called text placement or name placement, comprises the computer methods of placing labels automatically on a map or chart. This is related to the typographic design of such labels. The typical features depicted on a geographic map are line features (e.g. roads), area features (countries, parcels, forests, lakes, etc.), and point features (villages, cities, etc.). In addition to depicting the map's features in a geographically accurate manner, it is of critical importance to place the names that identify these features, in a way that the reader knows instantly which name describes which feature. Automatic text placement is one of the most difficult, complex, and time-consuming problems in mapmaking and GIS (Geographic Information System). Other kinds of computer-generated graphics – like
chart A chart (sometimes known as a graph) is a graphical representation for data visualization, in which "the data is represented by symbols, such as bars in a bar chart, lines in a line chart, or slices in a pie chart". A chart can represent ...
s,
graph Graph may refer to: Mathematics *Graph (discrete mathematics), a structure made of vertices and edges **Graph theory, the study of such graphs and their properties *Graph (topology), a topological space resembling a graph in the sense of discre ...
s etc. – require good placement of labels as well, not to mention engineering drawings, and professional programs which produce these drawings and charts, like spreadsheets (e.g.
Microsoft Excel Microsoft Excel is a spreadsheet developed by Microsoft for Microsoft Windows, Windows, macOS, Android (operating system), Android and iOS. It features calculation or computation capabilities, graphing tools, pivot tables, and a macro (comp ...
) or computational software programs (e.g.
Mathematica Wolfram Mathematica is a software system with built-in libraries for several areas of technical computing that allow machine learning, statistics, symbolic computation, data manipulation, network analysis, time series analysis, NLP, optimiza ...
). Naively placed labels overlap excessively, resulting in a map that is difficult or even impossible to read. Therefore, a GIS must allow a few possible placements of each label, and often also an option of resizing, rotating, or even removing (suppressing) the label. Then, it selects a set of placements that results in the least overlap, and has other desirable properties. For all but the most trivial setups, the problem is
NP-hard In computational complexity theory, NP-hardness ( non-deterministic polynomial-time hardness) is the defining property of a class of problems that are informally "at least as hard as the hardest problems in NP". A simple example of an NP-hard pr ...
.


Rule-based algorithms

Rule-based algorithms try to emulate an experienced human cartographer. Over centuries, cartographers have developed the art of mapmaking and label placement. For example, an experienced cartographer repeats road names several times for long roads, instead of placing them once, or in the case of Ocean City depicted by a point very close to the shore, the cartographer would place the label "Ocean City" over the land to emphasize that it is a coastal town. Cartographers work based on accepted conventions and rules, such as those itemized by Swiss cartographer Eduard Imhof in 1962.Imhof, Eduard, “Die Anordnung der Namen in der Karte,” Annuaire International de Cartographie II, Orell-Füssli Verlag, Zürich, 93-129, 1962. English Translation: "Positioning Names on Maps," ''The American Cartographer'', V.2 #2 (1975), pp.128-144 For example, New York City, Vienna, Berlin, Paris, or Tokyo must show up on country maps because they are high-priority labels. Once those are placed, the cartographer places the next most important class of labels, for example major roads, rivers, and other large cities. In every step they ensure that (1) the text is placed in a way that the reader easily associates it with the feature, and (2) the label does not overlap with those already placed on the map.


Local optimization algorithms

The simplest greedy algorithm places consecutive labels on the map in positions that result in minimal overlap of labels. Its results are not perfect even for very simple problems, but it is extremely fast. Slightly more complex algorithms rely on local optimization to reach a local optimum of a placement evaluation function – in each iteration placement of a single label is moved to another position, and if it improves the result, the move is preserved. It performs reasonably well for maps that are not too densely labelled. Slightly more complex variations try moving 2 or more labels at the same time. The algorithm ends after reaching some local optimum. A simple algorithm –
simulated annealing Simulated annealing (SA) is a probabilistic technique for approximating the global optimum of a given function. Specifically, it is a metaheuristic to approximate global optimization in a large search space for an optimization problem. ...
– yields good results with relatively good performance. It works like local optimization, but it may keep a change even if it worsens the result. The chance of keeping such a change is \exp \frac, where \Delta E is the change in the evaluation function, and T is the ''temperature''. The temperature is gradually lowered according to the ''annealing schedule''. When the temperature is high, simulated annealing performs almost random changes to the label placement, being able to escape a local optimum. Later, when hopefully a very good local optimum has been found, it behaves in a manner similar to local optimization. The main challenges in developing a simulated annealing solution are choosing a good evaluation function and a good annealing schedule. Generally too fast cooling will degrade the solution, and too slow cooling will degrade the performance, but the schedule is usually quite a complex algorithm, with more than just one parameter. Another class of direct search algorithms are the various evolutionary algorithms, e.g.
genetic algorithm In computer science and operations research, a genetic algorithm (GA) is a metaheuristic inspired by the process of natural selection that belongs to the larger class of evolutionary algorithms (EA). Genetic algorithms are commonly used to ge ...
s.


Divide-and-conquer algorithms

One simple optimization that is important on real maps is dividing a set of labels into smaller sets that can be solved independently. Two labels are ''rivals'' if they can overlap in one of the possible placements. Transitive closure of this relation divides the set of labels into possibly much smaller sets. On uniformly and densely labelled maps, usually the single set will contain the majority of labels, and on maps for which the labelling is not uniform it may bring very big performance benefits. For example, when labelling a map of the world,
America The United States of America (U.S.A. or USA), commonly known as the United States (U.S. or US) or America, is a country primarily located in North America. It consists of 50 states, a federal district, five major unincorporated territori ...
is labelled independently from
Eurasia Eurasia (, ) is the largest continental area on Earth, comprising all of Europe and Asia. Primarily in the Northern and Eastern Hemispheres, it spans from the British Isles and the Iberian Peninsula in the west to the Japanese archipelag ...
etc.


2-satisfiability algorithms

If a map labeling problem can be reduced to a situation in which each remaining label has only two potential positions in which it can be placed, then it may be solved efficiently by using an instance of
2-satisfiability In computer science, 2-satisfiability, 2-SAT or just 2SAT is a computational problem of assigning values to variables, each of which has two possible values, in order to satisfy a system of constraints on pairs of variables. It is a special case ...
to find a placement avoiding any conflicting pairs of placements; several exact and approximate label placement algorithms for more complex types of problems are based on this principle.; ; ; .


Other algorithms

Automatic label placement algorithms can use any of the algorithms for finding the maximum disjoint set from the set of potential labels. Other algorithms can also be used, like various graph solutions,
integer programming An integer programming problem is a mathematical optimization or feasibility program in which some or all of the variables are restricted to be integers. In many settings the term refers to integer linear programming (ILP), in which the objective ...
etc.


Notes


References

* Freeman, H., Map data processing and the annotation problem, Proc. 3rd Scandinavian Conf. on Image Analysis, Chartwell-Bratt Ltd. Copenhagen, 1983. * Ahn, J. and Freeman, H., “A program for automatic name placement,” Proc. AUTO-CARTO 6, Ottawa, 1983. 444–455. * Freeman, H., “Computer Name Placement,” ch. 29, in Geographical Information Systems, 1, D.J. Maguire, M.F. Goodchild, and D.W. Rhind, John Wiley, New York, 1991, 449–460. * Podolskaya N. N. Automatic Label De-Confliction Algorithms for Interactive Graphics Applications. Information technologies (ISSN 1684-6400), 9, 2007, p. 45–50. In Russian: Подольская Н.Н. Алгоритмы автоматического отброса формуляров для интерак тивных графических приложений. Информационные технологии, 9, 2007, с. 45–50. * Kameda, T. and K. Imai. 2003. Map label placement for points and curves. IEICE Transactions of Fundamentals of Electronics Communications and Computer Sciences. E86A(4):835–840. * Ribeiro Glaydston and Luiz Lorena. 2006. Heuristics for cartographic label placement problems. Computers & Geosciences. 32:739–748. * Wagner, F., A. Wolff, V. Kapoor, and T. Strijk. 2001. Three Rules Suffice for Good Label Placement. Algorithmica. 30:334–349.


External links


Alexander Wolff's Map Labeling Site

The Map-Labeling Bibliography

Label placement

An Empirical Study of Algorithms for Point-Feature Label Placement
{{DEFAULTSORT:Automatic Label Placement Optimization algorithms and methods Geographic information systems