An improved spatial contour tree constructed method

contours are important data to delineate the landform on a map. A contour tree provides an object-oriented description of landforms and can be used to enrich the topological information. The traditional contour tree is used to store topological relationships between contours in a hierarchical structure and allows for the identification of eminences and depressions as sets of nested contours. This research proposes an improved contour tree so-called spatial contour tree that contains not only the topological but also the geometric information. It can be regarded as a terrain skeleton in 3-dimention, and it is established based on the spatial nodes of contours which have the latitude, longitude and elevation information. The spatial contour tree is built by connecting spatial nodes from low to high elevation for a positive landform, and from high to low elevation for a negative landform to form a hierarchical structure. The connection between two spatial nodes can provide the real distance and direction as a Euclidean vector in 3dimention. In this paper, the construction method is tested in the experiment, and the results are discussed. The proposed hierarchical structure is in 3-demintion and can show the skeleton inside a terrain. The structure, where all nodes have geo-information, can be used to distinguish different landforms and applied for contour generalization with consideration of geographic characteristics.


Introduction
A contour map is composed of several lines which are required by cutting landform horizontally and projected on a plane.The lines are curved, equidistance, closed and uncrossed.Each point in a contour represents an actual position in space with a same elevation.A contour line connected by these points could show map readers the position of surface outline.Through the recognition of a group of contours, an entire landform would be acknowledged in the mind of readers.Also, a contour map contains plenty morphological information of surface.The ups and downs of surface are characterized by random combination of basic topography, such as peaks, ridges, and depressions.Although a contour map appears to be composed of a number of discrete contours, there are adjacent and inclusion relationships between contours and regions.With strict, accurate, measurable information, contour maps are regarded as an important element to represent a real landform in 2-dimensional plane.
In the computing environment, contours can be regarded as a kind of discontinuous structure data in vertical.The exhaustive searching for contours is impractical, the topological relationship of contours should be built (Freeman & Morse, 1967).So a contour tree is established to store the relationship of contours for a map.Existing works on con-tour trees mainly have focused on the optimization of generation, application and extension of contour trees.Kweon & Kanade (1994) generates the connectivity tree of regions separated by the contours, and calls it a topographic change trees.Cronin (1995) has achieved a topographical query by a contour tree.van Kreveld et al. (1997) have given a simple algorithm to compute contour trees in regular and irregular meshes.Chen et al. (2005) put forward a new approach for generating contour trees by introducing a Voronoi-based method.Zhu et al. (2011) have established a contour tree based on the spatial cognition when contours are not linked up.Guilbert (2013) has considered the multi-level of a map and tried to build a feature tree from contours, it is finally used in terrain analysis and terrain generalization (Guilbert et al., 2014).Wu et al. (2015) introduce a localized contour tree method that is able to fully exploit high-resolution topographical data for detecting, delineating and characterizing surface depressions across scales with a multitude of geometric and topography.Wu & Su (2016) build the "incremental contour tree" to identify saddles.In addition, more works have been done on the contour tree construction efficiently (Wang, 2004;Zhao & Sheng, 2009;Yao & Hong, 2012).In general, there are three common ways to build contour trees.From the related work, the traditional contour tree is used to store topological relationships between contours in a hierarchical structure and allows for the identification of eminences and depressions as sets of nested contours.However, only topological relationships such as adjacent and inclusion have been involved, and no more spatial information could be available.If more spatial information would be provided in a contour tree during its construction, it can give more quantified usages on terrain analysis, map generalization or terrain simulation.So, this paper will propose an improved contour tree called the spatial contour tree.The spatial contour tree modeling is introduced in the next section, and its construction method is also provided in section 3. Finally, the proposed method is tested in the experiment, and the results are discussed.

Spatial contour tree modeling 2.1 Spatial contour tree
In this work, the proposed contour tree is established based on the spatial points of contours, so can be called the spatial contour tree.A practical point that insides the corresponding contour is taken as a spatial node, and all spatial nodes are connected to form a tree.It is the spatial contour tree shown in Fig. 2, and it can be regarded as a terrain skeleton in 3-dimention.A spatial contour tree contains two components.They are defined as spatial contour tree nodes and spatial contour tree edges in following sections.Fig. 2. A contour map in 3-dimensional, and the spatial contour tree is illustrated in blue lines.In the tree, blue points are spatial contour tree nodes, and blue segments are spatial contour edges.

Spatial contour tree node
Taking a contour as a polygon, an spatial point is selected to represent it.The method for spatial point determination is given in section 3.1.The spatial point has the latitude, longitude and elevation information.In addition, through the topological relationship of contours, the affiliation relationship among these spatial points would be confirmed by connections.The data structure of a spatial contour tree node is shown in Fig. 3(a).According to the out degree, which is the count of its sub-nodes, a node can be classified into three types as shown in Table 1: common node, branch node and ending node.The out degrees of the common, branch and ending node are 1, >1, and 0 respectively.In a spatial contour tree node: "ID" is the index; "CentrePoint" stores the location information with elevation; "OutDegree" is the count of its sub-nodes; "Type" indicates the node type.(b) In a spatial contour tree edge: "ID" is the index of the edge; "SptID" and "EptID" point to the starting node and ending node respectively; "AngleV" is the angle between the edge and the horizontal plane; "AngleH" is the angle between the edge and the north direction.

Outdegree
Description 0 Common node 1 The most common node, the node with lowest elevation is the start of a spatial contour tree.
1 Branch node >1 A spatial contour tree will appear branch from this node and the corresponding landform will appear more geographic units.
2 Ending node 0 The ending node of one branch of a spatial contour tree, it generally represents the peak of a mountain.
Table 1.Types of a spatial contour tree node.

Spatial contour tree edge
The spatial contour tree edge is the connection between two nodes.Its data structure is illustrated in Fig. 3(a).
According to the type of the starting node, an edge could also be categorized into two types (Table 2).The first one is the straight edge.As shown in Fig. 4, they are regarded as the main straight skeleton of a geographical unit usually a mountain.Another one is the branch edge that usually connects two geographical units.So, the information of branch edges can indicate the distance and direction between two geographical units.The main part of spatial contour tree.
1 Branch edge

Branch node
The count of branch edges can imply a complex of geographical object.
Table 2. Types of a spatial contour tree edge.

Spatial contour tree node determination
The spatial contour tree node, also can be called spatial node for short in the paper, its determination is a key issue in this research.A logic spatial node is important to form a reasonable spatial contour tree.In usual, taking a contour as a polygon, its centroid can be regarded as the spatial node.However, for an irregular polygon.e.g.concave polygon, the centroid is outside the polygon sometimes.There is an example in Fig. 5. Point B is the centroid of a contour, but it is outside the polygon.In this situation, it cannot be used to represent a contour.Besides, there is a method to calculate the straight skeleton of the polygon.As the straight skeleton is absolutely inside any polygon whether it is concave or not, the center point of the straight skeleton is another option.However, the point is depended on the determination of straight skeleton.Sometimes, it is hard to gain a reasonable straight skeleton.As there are several principles used to find the straight skeleton, such as length prioritized (Visvalingam & Whyatty, 1993), area prioritized (Attneave, 1954), and convex hull diameter prioritized (Wang & Yan, 2011), it would bring diverse results.For the example also in Fig. 5, red lines are skeletons obtained by the Delaunay Triangulated Irregular Network (DTIN), it is difficult to choose which one is the probe straight skeleton.In this research, the geometric center point of the largest triangle in the DTIN inside a contour is applied to determine the spatial node.Because the largest triangle is always formed in the main part of a polygon, so its center point is also inside a contour and located in the main part.
In that case, the geometric center of the largest triangle is available.In Fig. 5, the point A in green color is the spatial node of the sample contour.

Spatial contour tree construction
Ideally, a contour map is composed of a certain number of closed curve.The steps of a spatial contour tree construction are as follows: 1) Sort contours by elevation from low to high value.
2) Calculation the spatial node for each contour with the method in section 3.1.3) Divide contours into sets by elevation, and sort all sets by elevation from low to high value.4) Select one set, for all contours in the set, estimate their relationships with the contours in its subsets, which have higher elevation.5) According to the relationship to build spatial contour tree edges by connecting related spatial nodes.6) Repeat step 4 until the spatial nodes are connected, contour tree are established.The construction steps are also illustrated in Fig. 6.

Spatial contour tree results
The proposed method is tested on the region of Lushan mountain, China in the map scale of 1:10,000, totally 138 contours.Its elevation ranges from 1120m to 1150m, and vertical interval is 10m.It is shown in (1) The contours in the dashed box in Fig. 7(a) are selected to show the details of the spatial contour tree.It is shown in Fig. 8.However, in the figure, not all IDs of spatial nodes and edges are marked.The information of marked spatial nodes and edges are listed in Table 3 and Table 4 respectively.
Fig. 8.The spatial contour tree of the selected contours.The black number is the ID of a spatial node, and the red number is the ID of spatial contour tree edges.
In Table 3, X, Y, Z are the coordinate of a spatial node, where Z is the height equaled to elevation value.The Out-degree shows to the count of sub-nodes of a spatial node, and the type 0, 1, and 2 indicate the common, branch and ending node respectively.In Table 4, the type 0 and 1 are the straight and branch edges respectively.(2) The whole spatial contour tree is illustrated in Fig. 9. From the results, some conclusions can be addressed as follows.
− In the spatial contour tree, not only the topological information of contours but also the geomorphology can be represented.From Fig. 9(b), the spatial edges show the inclusive relationships by connecting spatial nodes, and this information also can be obtained from traditional contour tree.However, each spatial node has the information of location and elevation, and the length of each edge also is provided (Table 4).So, the spatial distribution in 3-dimention of spatial nodes and edges can be taken to do quantitative usage.− The main contributions of the spatial contour tree are the value of edge length, angles of edge to the plane and the north.From the lengths of edge 12, 13 in Table 4, they are more longer than others.In addition, their angles to the plane (AngleV indicator), are near to 0. These information can show ending nodes 19, 27 are represented two small mountains far from the main mountain, and they have less importance of the landform.This information can be used in the contour generalization.
− Ridge, valley, depression, saddle and other basic landform elements have their specific shape of contours.Ridges and valleys need a group of contours to identity.A spatial contour tree is built to compress polylines to points, and also compress cube to line.It can be used to identify landform elements.In addition, with the value of spatial edges, they can be used to quantify the size of a landform elements.− However, the proposed spatial contour tree in this research is established based on the center of the triangle with the largest area of a contour.Its reasonability needs to be clarified further more.For example, in Fig. 10, it seems not in the center of its polygon, but it is the center of the largest triangle.
Fig. 10.The spatial node in a narrow contour situation.

Footnotes
It is a preliminary work for the application of spatial contour tree for the contour map generalization.In a spatial contour tree, some sub-trees can be extracted.Sub-trees are related to small geographical units.The main idea is to calculate the importance according to the angle value of branch edges.The bigger the "AngleV", the more important the edge.So, the sub-tree that starts with the important branch edge needs to be selected first in the generalization process.Taking a spatial contour tree in Fig. 11 as an example, it has three branch nodes in dashed circles.According to the above method, the importance of five sub-trees can be: a001230 > b001280 > b001320 > b011320 > b021320 > c001300.According to the importance of the five sub-trees, a generalization result is presented in Fig. 12(a).Its spatial contour tree in Fig. 12(b) shows that "c001300", "b021320", "b011320" and "b001320" are removed, "a001230" and "b001280" are reserved.Fig. 12(c) show the generalized result changed the contour interval based on (a).
Fig. 12.The spatial contour tree after generalization, the dashed lines are sub-trees that had been removed.
In the traditional contour map generalization, enlarging the contour interval is a common method to simply contours.But contours can reflect the landform, and its generalization should be considered in a geographical way.During the generalization, the topography information should be expressed by the important relatively part of a region.So, the primary and secondary relationship of all geographical units should be decided.
A spatial contour tree can directly reflect the spatial relationship of geographical units.According to a certain ordering rule, an importance sequence of geographical units can be decided through a spatial contour tree.Under the rule of this experiment, two main mountain hills were retained, unnecessary geographical units were removed entirely.That is a result makes contours' generalization with more consideration of its geographical characteristics.However, it is only a preliminary work for the application on contour map generalization, the whole solution needs to be done in the future.

Summary and future work
This paper proposes an improved method to establish a contour tree.By enriching the traditional contour tree with spatial attributes, the contour tree in 3-dimension can be built, and is also called the spatial contour tree.It contains two components: the spatial node and edge.The spatial node is obtained by the center point of the largest triangle in the DTIN which is inside a contour, and the spatial edges are connections between two nodes.In this work, the proposed tree is implemented and tested in the partial contours of Lushan mountain.Results show that the spatial contour tree can be regarded as the terrain skeleton in 3-dimention, which can be used for landform elements classification, terrain analysis and map generalization.The main contribution of the proposed tree is that it provides the spatial distribution of nodes and edges in 3-dimention, which can be taken for quantitative usage.
However, the construction of spatial contour tree is a fundamental work, and its applications are more important for the future work.In the short term, its application on map generalization should be researched further more.
Only removing less important sub-trees in the spatial contour tree is not enough, more generalization operators should be considered, such as the merging adjacent contours and the removal of small catchments.In the long term, the spatial contour tree can be applied in terrain analysis, e.g.landform elements classification, and it also can be used in terrain simulation.

Fig. 1 .
Fig. 1.The method in Fig. 1(b) is the most common way to build contour trees, because it can explicitly represent the topological relationship among contours.

Fig. 3 .
Fig. 3. Data structures of spatial contour tree node and edge.(a)In a spatial contour tree node: "ID" is the index; "CentrePoint" stores the location information with elevation; "OutDegree" is the count of its sub-nodes; "Type" indicates the node type.(b) In a spatial contour tree edge: "ID" is the index of the edge; "SptID" and "EptID" point to the starting node and ending node respectively; "AngleV" is the angle between the edge and the horizontal plane; "AngleH" is the angle between the edge and the north direction.

Fig. 4 .
Fig. 4. Different types of nodes and edges in a spatial contour tree.Type ID Type name

Fig. 5 .
Fig. 5. Spatial contour tree node of a contour.Point B in blue is the centroid.Red lines are the skeleton obtained by DTIN.Point A is the geometric center point of the Delaunay triangle with the largest area.

Fig. 6 .
Fig. 6.The spatial contour tree construction steps illustration.(a) Spatial nodes calculation; (b) Spatial nodes connection from bottom to top; (c) A established spatial contour tree.

Fig. 7 .Fig. 7 .
Fig. 7.The experimental data.(a) is the contour map in plane; (b) is the 3-dimentional representation of the data.

Fig. 9 .
Fig. 9.The spatial contour tree of the experimental data.(a) is the tree rendered in 3-dimention, red points are spatial nodes, and they are connected to from edges.(b) is the spatial contour tree without contours.

Fig. 11 .
Fig. 11.An illustration of applying a spatial contour tree.(a) is a contour map; (b) is the spatial contour tree of the contour map.

Table 3 .
The information of marked spatial nodes.

Table 4 .
The information of marked edges.