Abstract

As a space-filling method, Voronoi Treemaps are used for showcasing hierarchies. Previously presented algorithms are limited to visualize nonspatial data. The approach of spatial Voronoi Treemaps is proposed in this paper to eliminate these problems by enabling the subdivisions for points, lines, and polygons with spatial coordinates and references. The digital distance transformation is recursively used to generate nested raster Voronoi polygons while the raster to vector conversion is used to create a vector-based Treemap visualization in a GIS (geographic information system) environment. The objective is to establish a spatial data model to better visualize and understand the hierarchies in the geographic field.

1. Introduction

As a well-known approach of visualizing hierarchical structures, Treemaps use recursive subdivision algorithms to partition an -dimensional plane into the nested regions without producing holes or overlaps. The size of each region corresponds to the value of a data element and the nesting depth represents the depth of the data element in the corresponding hierarchical data structure [1]. Treemaps were first presented by Johnson and Shneiderman in 1991 designed to visualize the files on a hard drive [2]. Nowadays, they have been widely applied to a variety of domains, such as the sports reporting [3], the photo management [4], the business data visualization [5], and the repository search visualization [6].

Previously presented Treemap algorithms mainly focus on displaying hierarchical data using the nested rectangles, such as Slice-and-Dice Treemaps [7], Squarified Treemaps [8], Strip Treemaps [4], Spiral Treemaps [9], and Spatially Ordered Treemaps [10]. They have one thing in common: their branches are all given rectangles which are tiled with smaller rectangles in accordance with their respective generation norms. Subsequently, approaches to visualize the hierarchies with the nonrectangular regions were addressed, such as Voronoi Treemaps [11, 12], Jigsaw Treemaps [13], and Circular Treemaps [14].

Voronoi Treemaps enable the two-dimensional subdivisions of the arbitrary polygons following the norms of Treemaps and Voronoi diagrams within the areas of arbitrary shapes. Since introduced by Balzer and Deussen [11, 12] to visualize the software metrics, they have been used in many applications ranging from the biodiversity exhibition [15] to the gene expression [16]. But they are rarely used in the field of geography, let alone integrated with the mainstream GIS software. For better integration of Voronoi Treemaps and GIS, we present an approach of generating spatial Voronoi Treemaps for points, lines, and polygons to better visualize the hierarchies in the geographic field. For simplicity, we use the term “SVT” for the spatial Voronoi Treemaps for points, lines, and polygons; except explicit specification is made.

In Section 2, the principles of the SVT and the relevant concepts are introduced. Section 3 elaborates the implementation of the layout algorithm. Section 4 shows several examples. Discussions and the conclusions are given in Section 5.

2. Preliminary Knowledge

The SVT is a visualization method to create geographical map-like representations of trees with ordinary or weighted Voronoi polygons (or called cells) from a set of generators, such as points, lines, and polygons. As is shown in Figure 1, an SVT is composed of nested cells and their corresponding generators. A level cell contains all level generators that are closer to that level generator than to any other (e.g., a level 1 cell contains three level 2 generators , , and ). Each cell in the hierarchy has a size that is the sum size of its contained leaf cells (e.g., the size of is equal to the total size of , , and ) and a depth that corresponds to its contained generator’s depth. The initial boundary of all generators is regarded as the root node, which has an arbitrary shape, mostly a rectangle.

As a combination of Voronoi Treemaps and Voronoi diagrams, the SVT is motivated by the work of Balzer and Deussen on Voronoi Treemaps [11, 12] and the work of Dong on multiplicatively weighted Voronoi diagrams for point, line, and polygon features [17]. Traditional Voronoi Treemaps consist of nested cells without spatial information. Differently, the nested cells and their corresponding generators, both of which have spatial coordinates and references, are used by our proposed Treemap layout to express hierarchies. Generators can represent various kinds of geographic objects, such as cities, railways, and lakes, and cells are their corresponding dominant areas. Voronoi Treemap algorithms usually use centroidal Voronoi tessellations to create nested polygonal structures. In each recursion step, generators are generated randomly and shift to the center of mass of its cell using Lloyd’s method [18], whereas generators of different levels are preset and fixed for an SVT. At each recursive subdivision step, the cells are subdivided into smaller polygons from the generators contained within.

Generators can be obtained from the files in shapefile format for an SVT. The shapefile format is a popular geospatial vector data format for GIS software, which is developed and regulated by Environmental Systems Research Institute (ESRI) as an open specification for data interoperability among GIS software products. It can describe vector spatial features (points, lines, and polygons) with spatial coordinates and references. Each feature commonly has attributes to describe itself, such as the name and the location. To clearly convey the idea of the SVT, several key concepts are introduced first.

2.1. Relevant Definitions

Definition 1 (see [19]). Let be a point and let be a generator (a point, line, or polygon) in ; the distance between and is defined as below:where the denotation represents a specified distance function between two points and ; mostly the Euclidian metric is used, which is defined asbut others, such as the Manhattan metric or the Chessboard metric, are possible as well.
The Manhattan metric isThe Chessboard metric isIn vector mode, and are -coordinates and and are -coordinates. In raster mode, the coordinates are defined by integer numbers of row and column of raster pixels. Figure 2 shows three distance metrics in raster mode.

Definition 2. Let be a set of distinct generators in . For each , a weight is assigned. A weighted Voronoi diagram for points, lines, and polygons denotes a subdivision of into cells with a property that a point lies in a cell if and only if for each with . The notation is defined as If , is reduced to an ordinary Voronoi diagram for points, lines, and polygons .

Definition 3. Let be a weighted Voronoi diagram for points, lines, and polygons. denotes the cell of the generator with a positive real weight . If there are any weighted Voronoi diagrams which could meet the criteria , then the expression is called a weighted SVT. Regardless of weights of generators, the expression is named as an ordinary SVT. A weighted SVT is a special case of the ordinary SVT that takes weights into consideration. Both of them are collectively called the SVT.

2.2. Distance Transformation

It can be known from the above contents that an SVT consists of layers of ordinary or weighted Voronoi diagrams for points, lines, and polygons. To construct an SVT, we need to generate its compositions first. The Voronoi diagram or weighted Voronoi diagram algorithms can be divided into two categories: vector-based methods and raster-based methods. Vector-based methods are suitable for point sets but not good for line and area sets. By contrast, the computation of Voronoi diagrams or weighted Voronoi diagrams for line and polygon sets is as easy as that for point sets in raster mode. Computation via distance transformation is one of the important raster-based methods.

A distance transformation is a derived form of a digital image. Supposing that the digital binary image consists of feature and nonfeature pixels and the features can be points, lines, or polygons, the distance transformation is an operator that converts this binary image to a grey-level image where all pixels have a value corresponding to the distance to the nearest feature pixel [20]. It uses only a structuring mask at a time based on the following idea: global distances in the image are approximated by propagating local distances [20]. There are various types of distance transformations, depending on which distance metric is used to determine the distance between pixels. In this paper, three most basic metrics are used. They are the Manhattan metric (a cross shaped mask), the Chessboard metric (a 3 × 3 square mask), and the Euclidean metric.

In a digital space, the fulfillment of Euclidean geometry is a complex operation due to the discrete structure [21]. In order to get a better approximation of Euclidean distance transformation, several approaches are proposed, such as chamfer distance algorithms [20], sequence algorithms [22, 23], and parallel algorithms [24]. To simplify the calculation, octagonal distance is used to approximate Euclidean distance transformation, which is an alternate usage of Chessboard distance and Manhattan distance [20]. It needs to point out that it is not our intention to acquire a better approximation of Euclidean distance transformation. Such discussions will be encouraged following this paper.

3. The SVT Algorithm

The SVT uses a recursive layout algorithm to segment a two-dimensional plane into nested cells from a set of generators. Generators can be points, lines, and polygons that represent different forms of spatial objects in the real world, among which points are abstracted as their locations, lines represent their skeletons, and polygons depict their boundaries. Each generator is assigned two initial parameters. One is “level” that represents generator’s hierarchy and the other is “weight” that reflects generator’s certain property.

The construction of SVTs is as follows: first, classify generators into different sets in accordance with their level values. Then, regard the initial boundary and its contained level 1 set of generators as a digital image and process it via distance transformation. The output is a set of raster cells, which makes up a raster ordinary or weighted Voronoi diagram of level 1. For the next hierarchy level, this procedure is performed recursively for all level generators within respective level cells. When the recursion ends, converting the digital images to vector files and overlaying them, a complete layout of SVT is obtained.

For simplicity, let represent an ordinary Voronoi diagram or a weighted Voronoi diagram of level in the hierarchy, and let denote an ordinary Voronoi region or a weighted Voronoi region of ; except explicit specification is made in this section.

In Algorithm 1, is a set of pixels determined by , Width, and Height. Each pixel corresponds to five properties: an identifier , an identifier of the father node , an original transformation speed , a current transformation speed , and a status . Consider , where “” signifies that is waiting to be processed, “” represents that is being processed, and “” denotes that pixel has been processed. While initializing for an ordinary SVT, define , , and for each . While initializing for a weighted SVT, define , , , , and for each . is a set of pixels for , in which each has the same properties as in . While initializing for an ordinary SVT, define , , and for each . While initializing for a weighted SVT, define , , , , and for each . is a subset of with for each , which is obtained from the function GetLevelGenerators(). count is the number of pixels with in , which is obtained from the function PixelsUpdate().

Input: a set of generators meeting the criteria that each corresponds to an
unique identifier , a level and a weight with , and ;
: the boundary of ; Height: the number of rows of the output image; Width: the number of columns of the output image
Output: an SVT
Begin
= Width × Height
 initialize : a set of pixels for
) %Get the maximum level value of
for  ; step 1 until    do
  initialize : a set of pixels for
   = GetLevelGenerators() %: an array for level set of generators.
  PixelsAssignment()
  count = 0
  while () do
   PixelsTransformation()
   PixelsUpdate()
  endwhile
  
  TreemapExport()
endfor
End

The function GetLevelGenerators() (Algorithm 2) is to acquire a level set of generators from .

Input: a set of generators , a level value
Output: the level set of generators
Begin
Initialize an array for the level set of generators.
for  ; step 1 until    do
if () then
   %add to
endif
endfor
End

A weighted SVT subdivides the two-dimensional space recursively with consideration of both location and weight of each generator, while an ordinary SVT partitions space only considers generator’s location. The different division approaches necessitate a different handling of the auxiliary functions PixelsAssignment() and PixelsTransformation() in Algorithm 1.

The function PixelsAssignment() ( Algorithm 3) is to assign values of generators to pixels correspondingly if pixels intersect with generators in the two-dimensional raster space, which is a vector to raster conversion of spatial objects in essence. Specifically speaking, assign to and set to 0 if a pixel intersects with a generator . In addition, is set to for a weighted SVT. It can be known that , which determines the speed of distance transformation of pixel . is an accumulator of . In this function, define . Figures 3(a) and 3(b) describe the variations of pixel properties for a weighted SVT after executing the function PixelsAssignment().

(a)
Input: a set of generators , a set of pixels
Output: a set of pixels
Begin
for  ; step 1 until    do
for  ; step 1 until    do
    if () then
    
    
    endif
endfor
endfor
End
(b)
Input: a set of generators , a set of pixels
Output: a set of pixels
Begin
maxweight = max) %Get the maximum weight of
for  ; step 1 until    do
for  ; step 1 until    do
    if () then
    
    
    
    
    endif
endfor
endfor
End

The function PixelsTransformation() (Algorithm 4) is to create a raster Voronoi diagram or weighted Voronoi diagram via distance transformation. For an ordinary SVT, each pixel with will propagate in each loop in accordance with a structuring mask , which can be a cross shaped mask (the Manhattan metric), a 3 × 3 square mask (the Chessboard metric), a disk shaped mask (the Euclidean metric), and so forth. Once a pixel propagates, its state will change to 1, which means that this pixel will cease to be processed in the next loop. If ’s neighbor pixels () own the same father node with () and have not been processed (), assign to .

(a)
Input: a set of pixels
Output: a set of pixels
Begin
for  ; step 1 until    do
if () then
 initialize : a set of pixels around
for  ; step 1 until    do
    if (  &  ) then
     
    endif
endfor
endif
endfor
End
(b)
Input: a set of pixels
Output: a set of pixels
Begin
for  ; step 1 until    do
if () then
  
  if () then
   initialize : a set of pixels around
   for  ; step 1 until    do
if (  &  ) then
    
    
    
     endif
   endfor
   
  endif
endif
endfor
End

For a weighted SVT, we use the property to control whether a pixel with propagates in each loop. If is less than an established threshold, it continues to execute accumulation. Once it exceeds the threshold, will propagate and its state will change to 1. In Algorithm 4, as the maximum of original transformation speed is 1, so the threshold is set to 1. If ’s neighbor pixels () own the same father node with () and have not been processed (), the properties of will be assigned as follows: , and . It can be known from Algorithm 4 that a pixel with a higher original transformation speed owns a higher priority to execute distance transformation. For example, a pixel with will propagate every time and a pixel with will propagate every two times. From the point of view of vector space, it means that a generator with a bigger weight will dominate more area. Figures 3(d), 3(e), and 3(f) describe the first three steps of distance transformation for a raster layer of a weighted SVT and the variations of pixel properties.

The function PixelsUpdate() (Algorithm 5) is to update the status of pixels and calculate the parameter count. In each loop, if a pixel has been assigned values by a neighbor pixel () yet has not executed distance transformation (), set to 0, which means that this pixel will participate in the next distance transformation. Figures 3(c) and 3(d) show an instance of the function PixelsUpdate() and the variations of pixel properties.

Input: a set of pixels , count
Output: a set of pixels , count
Begin
for  ; step 1 until    do
if () then
   if () then
    
   endif
   if () then
    count ++
   endif
endif
endfor
End

The function TreemapExport() specifies the output mode of SVTs: for each level set of generators , a level set of pixels that represents a raster ordinary or weighted Voronoi diagram for points, lines, and polygons is exported correspondingly. Pixels that have the same identifier will be converted to a vector ordinary or weighted Voronoi polygon through a raster to vector conversion. Then, a vector file in shapefile format with spatial coordinates and references can be obtained. Overlaying with , we can construct a final hierarchical layout suitable for GIS environment.

4. Examples

Four Treemap layouts shown in Figure 4, respectively, use the data set with 200, 130, 100, and 130 generators that are randomly generated without spatial references at 4 hierarchy levels. Figure 4(a) is an ordinary SVT for points based on the Manhattan metric; Figure 4(b) is an ordinary SVT for lines based on the Chessboard metric; Figure 4(c) is a weighted SVT for polygons based on the Euclidean metric; Figure 4(d) is a weighted SVT for points, lines, and polygons based on the Euclidean metric. Different legend symbols represent different sets of generators. Border thickness expresses the different levels of cells. The coarser boundaries indicate a higher hierarchical level of cells in the Treemap layout.

We implemented the SVT algorithm in C# and used ArcGIS Engine (a complete library of embeddable GIS components) to read shapefile and execute conversions between vector and raster data. The hardware of our experiments is an Intel Pentium Dual-Core E5800 3.2 GHz and 4 G RAM, running under Microsoft Windows 7. In this experiment, the program is running in single thread mode using one core of the CPU. The computations of four layouts shown in Figure 4 require 1.80 min, 1.88 min, 1.99 min, and 2.13 min, respectively. For many GIS applications, the speed is acceptable.

To better visualize the spatial hierarchies in the real world, we use the SVT to express the spatial pattern of the population landscape as shown in Figure 5, which is motivated by the research of Mu and Wang [25]. The point generators are abstracted as the locations of cities that are municipal level and above in China (342 cities in all, not including Zhoushan, Hong Kong, Macau, the Hainan Province, and Taiwan Province of China). The boundary is the inland border of China. They are, respectively, obtained from a point file and a polygon file in shapefile format at a scale of 1 : 100,000, that is, the Lambert projection-based maps.

According to [25], we only choose population as the weight of each city. The population data were obtained from the Tabulation on the 2010 Population Census of the People’s Republic of China by Township. In China, cities can be divided into five categories based on the urban concentration of the population. They are “Mega” city, “Macro” city, “Large” city, “Middle” city, and “Micro” city. Their population sizes are “10,000,000 and above,” “5,000,000–10,000,000,” “1,000,000–5,000,000,” “500,000–1,000,000,” and “1–500,000,” respectively. As the proportion of “Middle” and “Micro” city is small (“Mega”: 13, “Macro”: 76, “Large”: 213, “Middle”: 19, and “Micro”: 21), we combined them with the 213 “Large” cities. Thus, an urban population hierarchy can be defined as in Table 1.

Using the SVT subdivision algorithm, we can get a spatial Voronoi Treemap that represents the population landscape pattern of urban hierarchy (Figure 5). In Algorithm 1, the generators denote the cities in China and . For each , the unique identifier is set to , the level corresponds to the value in field “Level” in Table 1, and the weight is equal to the population of the city. is the inland border of China.

5. Discussions and Conclusions

This paper presents an approach for the generation of SVTs. Contrary to the existent Voronoi Treemaps that are used to visualize hierarchical nonspatial objects, our proposed layout algorithm allows to create Voronoi Treemap visualizations for geographical objects with spatial coordinates and references, which can serve as a spatial data model to express urban hierarchies, organization structures, region differences, and so forth.

The SVT approach accepts point, line, and polygon files in shapefile format, classifies generators into different groups according to their level values in their attribute tables, uses a vector to raster conversion to create an initial raster layer, and then generates raster images using distance transformation. Through a raster to vector conversion, layers of ordinary or weighted Voronoi diagrams in shapefile format can be generated to construct a Treemap layout, which can be applied in mainstream GIS software. Input generators and output Treemap layers can be stored together in geodatabase and flexibly change their styles. All GIS symbols and layout styles can be used to enhance the visual effect of Treemaps and to support the user in the perception and interpretation of the Treemap visualizations; for example, Figure 4(a) uses star, square, triangle, and circle symbols to depict different levels of point features.

The layout algorithm needs to loop through all generators one by one to generate an SVT, so the process may be relatively slow while facing massive input features. Because the major processing steps are raster-based, it is possible that an input generator does not have an output Voronoi polygon if that generator is very close to others and raster cell size is not small enough. This problem can be eliminated by reducing the cell size.

In future work, the efficiencies and applications of the presented layout method will be studied extensively.

Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.