Text2MapAnnotations: An Automatic Framework of Generating Map Annotations from Textual Descriptions

1. Abstract

In this work, we propose a general framework for crafting annotated map. Based on this framework, we further propose an automatic method that can generate map annotations according to given textual descriptions, leveraging the large language models.

2. Introduction

As one of the most efficient methods to express spatial information, individuals have been creating maps since ancient times. In addition to the precise cartographic maps crafted by professional cartographers, more intriguing maps emerge outside the realm of formal cartography. These non-professional mapmakers craft their maps to share their geographies of human experience (Pearce 2008). In contrast to maps constructed within the constraints of cartographic language, these informal maps center on the expression of insights, experiences, and even emotions. Indeed, the demand for creating such annotated maps is extensive. When encountering situations involving spatial descriptions or even spatial narratives, the expressive capacity relying on cartographic maps and textual content falls significantly short compared to a well-crafted annotated map (Simone et al. 2014). When expressing historical war developments, individual biographical trajectories, or even fictional locations and stories within novels, crafting annotated maps stands as a highly viable choice.

To satisfy the increasing requirement of crafting annotated maps, several map annotation tools have been developed. Those tools enable individuals to create annotations on maps through straightforward interactions, eliminating the need for complex programming or a background in cartography. Consequently, these map annotation tools significantly lower the barriers to creation, making it feasible for ordinary individuals to produce annotated maps. Nevertheless, there are still serious shortcomings with these tools.

First, these annotations exhibit weak connections with the underlying geographic data. In other words, existing authoring tools function similarly to image annotations, since users add annotations to the screen without establishing any linkings to the map. The fragile connections between the map and annotations rely on the approximate positions assigned by users, which can be easily destroyed during exploration and reproduction, especially after re-scaling. Simultaneously, while some tools theoretically cover a significant portion of annotations within the entire design space, the absence of high-level semantic packages still presents substantial challenges for individuals lacking relevant background knowledge to create high-quality annotated maps. Neglect of supporting complex annotation templates with high-level semantic meanings, rather that simple ones like pins, arrows and text labels, will result in repetitive and monotonous efforts during creations. Lastly, there is also a deficiency of intelligent aids, which can considerably reduce learning barriers of operating authoring tools and replace great manual efforts during the creation process.

To fill these gaps, we proposes a general workflow for crafting annotated maps through summarizing the design space of map annotations. Further more, we provide an automatic method that can generate annotated maps based on given textual descriptions, where the cutting-edge natural language processing techniques are adopted to extract geographic information from the textual materials. We conduct a case study on our prototype system to illustrate a textual research on the boundary of ancient map.

3. Framework

The creation of annotated map contains three important steps, including identifying the information needed to be annotated, choosing suitable annotation templates, and rendering annotations accordingly. Thus, four conceptions can be extracted from these steps as follows:

Geographic Elements: GEs include basic features, which consist of Point, Line, and Area (Crampton / Krygier 2018), and the collections of features. This setting is adopted by widely applied geographic data formats like GeoJson 1 and KML 2 .

Structured Geographic Information: SGIs are structurized geographic information that needed to be annotated. SGIs can be divided into two types. The first type describes the attributes of one GE, while the second type contains the relations between a pair of GEs. More complex information can be represented using these two types of SGIs.

Annotation Templates: Templates are pre-defined ways of crafting annotations. Through appointing required parameters, including GEs and their attributes, different annotation instances can be generated. Templates allow the quick re-usage of similar annotation styles.

Annotation Instances: Annotation instances are annotations finally generated and rendered on the map.

With these four conceptions, we propose our general framework for map annotations. At first, the GEs are imported as the foundation, which can also be treated as the map to be annotated. Then, SGIs are generated according to the GEs, describing what should be annotated. After that, pre-defined templates are applied to generate annotation instances according to SGIs. And finally, an annotated map can be rendered through putting all annotation instances on the map.

The extraction of these four conceptions can considerably improve the scalability and reusability of the annotated maps. SGIs standardize the geographic information and convert the unstructured textual information into structured data, which will reduce the barriers of data represention, analysis and communication. Besides, the annotation templates make the creation process more flexible. Users can simply replace templates to transform the styles of annotated maps, and they can also quickly generate projects with similar styles through applying the same group of templates with other SGIs. Finally, the abstraction of annotation instances allows the communication of easy-to-edit annotated maps, since annotation instances are structured data and different users can easily reproduce the annotated maps accordingly.

4. Text2MapAnnotations Method

Based on the framework, we further propose Text2MapAnnotations, an automatic method that generate annotated maps based on given textual materials leveraging the large language models. Text2MapAnnotations consists of two parts. First, we adopt the large language model (LLM) (in this work, we adopted OpenAI gpt-3.5-turbo6 model3 ) to deal with the extraction of geographic information from textual materials and the generation of corresponding SGIs. LLM has shown its excellent ability in reading comprehension ever since its release. It is capable of multitarget understanding and text-generating tasks without redundant and time-consuming special targeted pre-training compared to traditional models, and thus is suitable in this situation. Through prompting the models, where the prompts should include the requirements, an example, and the data to be processed to achieve a better response, LLMs can automatic provide high quality results of SGIs from the text.

After that, Text2MapAnnotations will search for the best solution to encoding the SGIs using the pre-defined annotation templates automatically. This part involves selecting the most suitable templates and mapping data attributes on best visual channels. We model this process as an optimization problem. Each solution should satisfy constraints from two aspects, including covering all SGIs provided correctly and following the design guidelines of visualization. These requirements can be interpreted to details constraints, where some are hard constraints that should be satisfied while others may be optional soft constaints and become the goals of optimization.

Finally, Text2MapAnnotations system will rendering the annotated map according the best solution calculated above. Moreover, we additionally support authoring requirements during the whole workflow. That means that users can manual modify the intermediate results, correcting mistakes and improving according their preferences, and the system will update the annotated map finally generated.

5. Case

We implement a prototype system and demonstrate it on a case comes from the historical geography research by Shen (Shen 2022). In this textual research, new opinions are expressed towards the boundary identification between Shunning Prefecture and Yongchang Prefecture in the Qing dynasty in ancient China. In this case, we provide the documentary records used in the research to Text2MapAnnotations system and automatically generate annotated maps to illustrate the textual materials. The results are shown in Figure 1.

The generated map annotations, including six maps numbered 1 to 6. The first figure (0) indicates the fundamental map. (1) and (2) are similar to each other while (1) annotated the incorrect direction information due to the mistakes from the original text, shown in the slice in the second sub-figure.
Figure 1. The generated map annotations, including six maps numbered 1 to 6. The first figure (0) indicates the fundamental map. (1) and (2) are similar to each other while (1) annotated the incorrect direction information due to the mistakes from the original text, shown in the slice in the second sub-figure.

Appendix A

Bibliography
  1. Crampton, Jeremy W. / Krygier, John (2005): "An introduction to critical cartography.", in:  ACME: An International Journal for Critical Geographies  4, 1: 11-33.
  2. De Simone, Flavia / Presta, Roberta / Protti, Federica (2014): "Evaluating data storytelling strategies: A case study on urban changes.", in:  IARIA Cognitive : 250-255.
  3. Pearce, Margaret Wickens (2008): "Framing the days: place and narrative in cartography.", in:  Cartography and geographic information science  35, 1: 17-32.
  4. Shen, Kaxiang (2022): "Four New Textual Researches on the Boundaries and Administrative Centers of Qing Dynasty Yunnan Map in The Historical Atlas of China.", in:  Historical Geography Research  42, 1: 140-147.
Notes
1.

https://geojson.org/

2.

https://developers.google.com/kml

Hanning Shao (hanning.shao@pku.edu.cn), Peking University, People's Republic of China and Xiaoru Yuan (xiaoru.yuan@pku.edu.cn), Peking University, People's Republic of China