7
Journal of Mathematical Sciences, Vol. 203, No. 6, December, 2014 AN ALGORITHM FOR CARTOGRAPHIC GENERALIZATION THAT PRESERVES GLOBAL TOPOLOGY V. V. Alexeev, V. G. Bogaevskaya, M. M. Preobrazhenskaya, A. Yu. Ukhalov, H. Edelsbrunner, and O. P. Yakimova UDC 517.38 Abstract. We propose an algorithm for the generalization of cartographic objects that can be used to represent maps on different scales. 1. Introduction The process of generalization is an important process in the creation of geographic maps. Generaliza- tion is an adaptation of geographic objects on the map for presentation in accordance with the purpose of the map, scale, and features of the territory (see [1]). For a long time, generalization was considered to be a subjective process requiring participation of a qualified expert. With the development of computers and automation it has become necessary to formalize this process and develop computer algorithms for performing this job. This is especially important when information must be used in automatic navigation systems and maps that are available via Internet. It is impossible to store on the server the data for representing maps in all scales that can be demanded by a user. It is natural to store only the most detailed representation of the map and scale the map on the fly. The chief difficulty in the automatic scaling is the superfluity of information. For example, the image of an area of 1 km 2 in scale 1:1000 occupies 1 m 2 on the map, in scale 1:100 000 it occupies 1 cm 2 , and in scale 1:1 000 000 it occupies 1 mm 2 . It is impossible to represent the area in all these scales with the same amount of detail. While decreasing the scale we have to reduce the number of objects and eliminate some details. This is required not only because of shortage of space. On a map of small scale that represents a large area, details lose their meaning. It is difficult to understand the map if all the details are preserved. Moreover, the transmission of this unnecessary data via information network consumes valuable resources. While performing generalization, it is important to preserve the relative positions of objects. Simple averaging of the cartographic data may cause serious issues. For example, if, reducing an image 10 times, we preserve one of 100 pixels out of the source data, it may happen that a road passing along a river will intersect the river though there is no bridge in this place. In this work, we propose a new algorithm for automated cartographic generalization that preserves the topology of the map. The source data for our algorithm is a set of graphs embedded in the plane, each referred to as a layer. Each layer represents a particular cartographic object such as country borders, rivers, roads, etc. (see Fig. 1 for an example). Our aim is to simplify the data by decreasing the number of nodes of the graphs while preserving the global topology of the picture, which includes the relative position of objects to each other. The result of such a simplification can be used for representing the original map at a given scale. Translated from Fundamentalnaya i Prikladnaya Matematika, Vol. 18, No. 2, pp. 5–12, 2013. 754 1072–3374/14/2036–0754 c 2014 Springer Science+Business Media New York DOI 10.1007/s10958-014-2165-8

An Algorithm for Cartographic Generalization that Preserves Global Topology

  • Upload
    o-p

  • View
    213

  • Download
    1

Embed Size (px)

Citation preview

Page 1: An Algorithm for Cartographic Generalization that Preserves Global Topology

Journal of Mathematical Sciences, Vol. 203, No. 6, December, 2014

AN ALGORITHM FOR CARTOGRAPHIC GENERALIZATIONTHAT PRESERVES GLOBAL TOPOLOGY

V. V. Alexeev, V. G. Bogaevskaya, M. M. Preobrazhenskaya,A. Yu. Ukhalov, H. Edelsbrunner, and O. P. Yakimova UDC 517.38

Abstract. We propose an algorithm for the generalization of cartographic objects that can be used torepresent maps on different scales.

1. Introduction

The process of generalization is an important process in the creation of geographic maps. Generaliza-tion is an adaptation of geographic objects on the map for presentation in accordance with the purposeof the map, scale, and features of the territory (see [1]). For a long time, generalization was considered tobe a subjective process requiring participation of a qualified expert. With the development of computersand automation it has become necessary to formalize this process and develop computer algorithms forperforming this job. This is especially important when information must be used in automatic navigationsystems and maps that are available via Internet. It is impossible to store on the server the data forrepresenting maps in all scales that can be demanded by a user. It is natural to store only the mostdetailed representation of the map and scale the map on the fly. The chief difficulty in the automaticscaling is the superfluity of information.

For example, the image of an area of 1 km2 in scale 1:1000 occupies 1 m2 on the map, in scale 1:100 000it occupies 1 cm2, and in scale 1:1 000 000 it occupies 1 mm2. It is impossible to represent the area in allthese scales with the same amount of detail. While decreasing the scale we have to reduce the numberof objects and eliminate some details. This is required not only because of shortage of space. On a mapof small scale that represents a large area, details lose their meaning. It is difficult to understand themap if all the details are preserved. Moreover, the transmission of this unnecessary data via informationnetwork consumes valuable resources.

While performing generalization, it is important to preserve the relative positions of objects. Simpleaveraging of the cartographic data may cause serious issues. For example, if, reducing an image 10 times,we preserve one of 100 pixels out of the source data, it may happen that a road passing along a river willintersect the river though there is no bridge in this place.

In this work, we propose a new algorithm for automated cartographic generalization that preservesthe topology of the map.

The source data for our algorithm is a set of graphs embedded in the plane, each referred to asa layer. Each layer represents a particular cartographic object such as country borders, rivers, roads, etc.(see Fig. 1 for an example).

Our aim is to simplify the data by decreasing the number of nodes of the graphs while preserving theglobal topology of the picture, which includes the relative position of objects to each other. The result ofsuch a simplification can be used for representing the original map at a given scale.

Translated from Fundamentalnaya i Prikladnaya Matematika, Vol. 18, No. 2, pp. 5–12, 2013.

754 1072–3374/14/2036–0754 c© 2014 Springer Science+Business Media New York

DOI 10.1007/s10958-014-2165-8

Page 2: An Algorithm for Cartographic Generalization that Preserves Global Topology

Fig. 1. Sample input data. Different layers are drawn in different line styles.

To generalize the data without changing its topology, we superimpose all layers into one data structureand simplify using the method of edge contraction. Edges are contracted in a sequence that gives priorityto small geometric error, and the new vertices are placed to locally minimize the error. To preserve thetopology, we check the local neighborhood of the edge and we avoid the contraction if it would changethe topology type of the structure.

2. Principal Ideas of the Algorithm

The fundamental operation for simplifying the map is the contraction of an edge, AB. It shrinks theedge to a point X, which replaces both A and B in all edges incident to either endpoint. The position ofthe new vertex X is chosen according to the method described in [4].

For each vertex of the graph we calculate the error matrix as follows. Let N be the number of edgesthat are incident to the vertex A. Each edge determines a line on the plane. Let aix+ biy + ci = 0, wherea2i + b2i = 1 (i = 1, . . . , N) are the equations of these lines. Let us find the sum of the distances from eachline to the point (x, y):

F (x, y) =N∑

i=1

(aix + biy + ci)2 = q11x2 + 2q12xy + q22y

2 + 2q1x + 2q2y + q0.

This quadratic form is called the error of the vertex A. The matrix of this quadratic form

QA =

⎝q11 q12 q1q12 q22 q2q1 q2 q0

is called the error matrix of the vertex A. We will associate the edge AB with the matrix QAB = QA+QB,where QA and QB are the error matrices for the vertices A and B, respectively.

When we contract the edge AB, the position of the new vertex X = (x, y, 1)T will be determined asa solution of the following minimization problem:

XQABXT → min .

This minimal value will be called the cost of the contraction of the edge AB. The problem of minimizingthe quadratic form is equivalent to solving a system of two linear equations. If the solution of this system

755

Page 3: An Algorithm for Cartographic Generalization that Preserves Global Topology

is not determined, then the new vertex will coincide with one of the vertices A or B, the one that givesthe minimal value of the quadratic form XQABXT. The cost of the contraction in this case will be equalto the corresponding value of this quadratic form.

The contraction of an edge can change the topology of the map, in which case we prevent thecontraction. More precisely, we restrict ourselves to topology preserving edge contractions that translateinto isotopies of the map. In other words, there is a homotopy of the plane to itself that starts with thesituation before and ends with the situation after the contraction and whose restriction to any moment oftime is a homeomorphism. General conditions that recognize topology preserving edge contractions aregiven in [2,6,7]. For the case of an embedded graph, these conditions are straightforward: the contractionof an edge AB preserves the topology if and only if

(a) at least one of the two endpoints belongs to exactly two edges (see Fig. 2);(b) the vertices A and B have no common neighbors.

Fig. 2. The condition on edge contraction. All three edges AB, BC, and CD can becontracted, but after contracting two, the remaining edge has endpoints of degree 4 on theleft and 3 on the right. Therefore its contraction no longer preserves the topology.

3. The Algorithm

We describe our algorithm as a sequence of five steps. Most important is Step (3), which constructsthe simplification by repeated edge contraction.

(1) Superimposing. We superimpose all the layers into one data structure. This allows us to simplifyall layers simultaneously, thus preserving its global topology and not just the topology of eachindividual layer. We remember for each edge the original layer it belongs to.

(2) Sorting. For each edge, we calculate the cost as the geometric error that results from contractingthis edge (see [4]). We store all edges in a priority queue ordered by cost so that edges can becontracted in the order of increasing cost.

(3) Simplifying. We simplify the structure by contracting edges in the order of increasing cost. Westop when the number of vertices drops below a specified percentage of the original number ofvertices.

(4) Smoothing. We finally smooth the resulting polylines with B-splines for improved appearance.(5) Decomposing. Now the simplified structure can be decomposed into the individual layers, each

a simplified version of the corresponding original layer.We illustrate the algorithm in Fig. 3, which shows an original layer and its simplified version. Note

that both vertices of degree 3 are preserved.

4. Computational Experiments

We have implemented the algorithm and use the software to compare its performance with our ownmodification of two popular algorithms for generalization: the Whirlpool algorithm [3] and the Li–Open-shaw algorithm [5].

756

Page 4: An Algorithm for Cartographic Generalization that Preserves Global Topology

Fig. 3. A small segment of the data simplified by our algorithm.

The original versions of these algorithms work only for polygonal lines, which are characterized byhaving only vertices of degree 2 and 1. We have adapted them to simplify graphs in which vertices ofdegree 3 or higher are viewed as endpoints of polygonal lines.

The Whirlpool algorithm includes the following steps.(1) Each vertex of the line is considered as the center of the circle with radius equal to some given

value ε.(2) Circles intersecting each other forms clusters. Vertices–centers of a cluster must be eliminated;

one new vertex appears. The position of this new vertex is determined as the geometric mean ofthe removed vertices.

(3) All the cycles of the obtained graph are deleted.The Li–Openshaw algorithm (the raster-to-vector algorithm) works as follows.(1) The line is superimposed with a regular grid. The size of the grid step is equal to the minimal

visible element of the map in the new scale.(2) Points of the first and last intersection of the line with the cell border are marked.(3) The middle of the line connecting these two points is used for representing the line in this cell.To measure the error of approximation, we introduce the notion of distance between two embedded

graphs. Letting Gi be a graph, we write Vi and ni for the set and the number of vertices, and we writeEi for the set of edges. Letting d(X, e) be Euclidean distance of the point X from the edge e, we write

d(X, Ei) = mine∈Ei

d(X, e).

Then we compute

D1,2 = max

⎧⎪⎨

⎪⎩

∑Y ∈V2

d(Y, E1)

n2,

∑X∈V1

d(X, E2)

n1

⎫⎪⎬

⎪⎭.

This notion incorporates elements of the Hausdorff distance and of the Wasserstein distance between setsin the plane.

We compare the performance of our edge contraction algorithm with that of the Whirlpool algorithmon a set of nine datasets. The results of the comparison are shown in Figs. 4 and 5. Our experimentsgive evidence to the claim that the algorithm proposed in this paper performs better than competingalgorithms.

757

Page 5: An Algorithm for Cartographic Generalization that Preserves Global Topology

Fig. 4. Comparison between the edge contraction algorithm, the Whirlpool algorithm, andthe Li–Openshaw algorithm. The numbers give the distance between the original and thesimplified structure after the number of vertices drops below a desired threshold.

Acknowledgments. We would like to offer our special thanks to students of the Department of Math-ematics of Demidov Yaroslavl State University A. A. Gorokhov and V. N. Knyazev for participation indeveloping the program and assistance in preparation of test data.

This work was supported by grant 11.G34.31.0053 from the government of the Russian Federation.

REFERENCES

1. A. M. Berlyant, O. R. Musin, and T. V. Sobchuk, Cartographic Generalization and Fractal Theory [inRussian], Moscow (1998).

2. T. K. Dey, H. Edelsbrunner, S. Guha, and D. V. Nekhayev, “Topology preserving edge contraction,”Publ. Inst. Math. (Beograd) (N. S.), 66, 23–45 (1999).

3. E. Fritsch, Use of Whirlpool Algorithm for ODBS Data Generalization, ODBS meeting (1999).4. M. Garland and P. S. Heckbert, “Surface simplification using quadric error metrics,” in: SIGGRAPH

’97, Proc. 24th Ann. Conf. Comput. Graphics, Addison-Wesley, New York (1997), pp. 209–216.5. Z. Li and S. Openshaw, “Algorithms for automated line generalization based on a natural principle of

objective generalization,” Int. J. Geogr. Inform. Syst., 6, No, 5, 373–389 (1992).

758

Page 6: An Algorithm for Cartographic Generalization that Preserves Global Topology

Fig. 5. Graphs illustrating the numerical results in Fig. 4, which compare the edge con-traction algorithm with our modification of the Whirlpool algorithm and the Li–Openshawalgorithm.

6. D. M. Thomas, V. Natarajan, and G.-P. Bonneau, “Link conditions for simplifying meshes withembedded structures,” IEEE Trans. Vis. Comput. Graph., 17, 1007–1019 (2011).

7. F. Vivodtzev, G.-P. Bonneau, and P. Le Texier, “Topology preserving simplification of 2D non-manifoldmeshes with embedded structures,” Visual Comput., 21, 679–688 (2005).

V. V. AlexeevP. G. Demidov Yaroslavl State University, Yaroslavl, RussiaE-mail: [email protected]

V. G. BogaevskayaP. G. Demidov Yaroslavl State University, Yaroslavl, RussiaE-mail: [email protected]

M. M. PreobrazhenskayaP. G. Demidov Yaroslavl State University, Yaroslavl, RussiaE-mail: [email protected]

759

Page 7: An Algorithm for Cartographic Generalization that Preserves Global Topology

A. Yu. UkhalovP. G. Demidov Yaroslavl State University, Yaroslavl, RussiaE-mail: [email protected]

H. EdelsbrunnerInstitute of Science and Technology Austria, Klosterneuburg, AustriaE-mail: [email protected]

O. P. YakimovaP. G. Demidov Yaroslavl State University, Yaroslavl, RussiaE-mail: olga [email protected]

760