1. Introduction
Spatial analysis is among the core functions of geographic information systems, and it is also important for evaluating the function of geographic information systems. Buffer analysis is an important part of spatial analysis. It describes the influence of geo-spatial objects on the surroundings, and it is an effective means to solve the problem of spatial proximity [
1]. From a mathematical point of view, the basic concept of buffer analysis is to determine the neighborhood of a given buffer radius and a spatial object or collection. As the expression results of buffer analysis are intuitive and conducive to monitoring, buffer analysis plays an important role in mineral resource evaluation, road traffic management, urban planning, environmental monitoring, and many other fields [
2,
3,
4,
5].
Buffer analysis mainly includes point, line, plane, and volume buffers according to the type of spatial objects. For two-dimensional space, the buffer generation algorithms and analytic applications are very mature. Buffer generation algorithms are mainly divided into raster algorithms, such as the mathematical morphology expansion method, filling algorithm, and raster-based Euclidian distance transformation, and vector algorithms, such as the parallel double-line method and boundary tracking method [
6]. Sumeet et al. studied the construction method of composite buffers for multiple vector objects in vector layers [
7]. For special objects, such as polygons with holes, Mate et al. comprehensively considered the analysis efficiency and the practical properties of the analysis object, and they listed different analysis methods [
8]. Yang et al. proposed an algorithm for the fast implementation of the buffer analysis of vector data using a Graphics Processing Unit (GPU), which solved the problem of data self-intersection in the buffer analysis of the traditional vector algorithm [
9]. The principle of the raster algorithms is relatively simple and easy to implement, but they have disadvantages, such as low precision and being limited by computer memory. Vector algorithms are usually more complex, involving the calculation and judgment of multiple spatial relations, such as curve intersection, arc cutting and recombination, and inclusion relation determination. The implementation of the algorithms is more complex, but they have the advantage of not reducing the accuracy of original data within the range of computer accuracy, and the memory consumption is much lower than that for the raster algorithms.
With the rapid development of 3D GIS and the wide application of 3D visualization and analysis technology in various fields, 2D buffer analysis has been unable to meet its needs, and 3D buffer analysis has become an urgent requirement. The geometric relations of objects in 3D space are far more complex than those in 2D space, and an algorithm for generating a 2D buffer cannot be directly applied to objects in 3D space. There have been few studies on algorithms for generating a 3D buffer at present. Li et al. used the raster model to express 3D buffers and proposed a raster-based isosurface expansion 3D buffer generation algorithm [
10]. The efficiency of the raster-based algorithm is related to the buffer radius. The larger the buffer radius, the greater the number of cells in the grid, the larger the computer memory occupation, and the lower the efficiency. In order to solve this problem, Yuan et al. proposed the introduction of parallel computing into buffer computing, the core concept of which is to decompose the computing part with parallel characteristics into multiple tasks for parallel computing, so as to improve its operating efficiency [
11]. Zhang et al. proposed a 0–1 interchange algorithm based on linear octree neighborhood analysis to construct a 3D buffer of urban rail transit [
12]. Li proposed a 3D buffer analysis method based on the concept of space filling. After the surface model was discretized, the voxels were screened based on the 3D signed Euclidean distance algorithm, and finally, the 3D buffer surface was reconstructed [
13].
The Discrete Global Grid System (DGGS) is a kind of geosphere fitting grid based on the sphere that can be infinitely subdivided but does not change its shape. It has the characteristics of hierarchy and global continuity. When subdivided to a certain extent, it can achieve the purpose of simulating the Earth’s surface. It is expected to fundamentally solve the problems of data fracture, deformation, and topological inconsistency of the planar grid model in global multiscale data management [
14]. In recent years, international academic circles have conducted in-depth research on the DGGS from different aspects. Effective progress has been made in the hierarchical subdivision and indexing of global spatial data [
15,
16], global meteorological and hydrological simulations [
17,
18], spatial data quality and cartographic synthesis [
19], global mass image management [
20,
21], and global visualization models [
22,
23]. Bowater realized the visualization and query of the offset region around IoT points based on the Rhealpix DGGS [
24]. With the development of Digital Earth research, the concept of the Earth System Spatial Grid (ESSG) [
25] has been proposed, which is now also called the 3D DGGS. The 3D DGGS belongs to a 3D volume grid, which provides a new method for the 3D visual modeling and analysis of 3D space objects. Chinese scholars have proposed the Spheroid Degenerated-Octree Grid (SDOG) [
25], Sphere Shell Space Grid (S3G) [
26], Sphere Geodesic Octree Grid (SGOG) [
27], and other schemes. Multiscale 3D modeling and visualization of the global lithosphere [
28], 3D modeling and analysis of geological truth [
29], integrated modeling of the crustal atmosphere and dynamic visualization of elements [
30], space orbit target management and collision detection methods [
31], the Earth system framework and its application to cellular automata [
32], 3D grid technology and its coding conversion in the geospace and lunar sphere [
33], etc., have been applied and are in leading positions in the field globally.
With the growing interest in Digital Earth and the subsequent use of the 3D DGGS to meet the needs of efficient indexing, analysis, and visualization of 3D data, in this paper, we propose a new method to generate a 3D buffer to analyze the proximity of spatial objects, for which we chose the SGOG as the data model. The SGOG’s sphere division based on the QTM makes full use of the characteristics of the great circle. Its grid system has the characteristics of simplicity, regularity, and moderate deformation, which can be used for the organization and management of space data integration of space and the Earth. First, the target object is converted to the SGOG. Then, using the spherical topological properties of the SGOG and the radius of the buffer, we propose an expansion method base on QTM edge neighbors to obtain the spherical 2D buffer characteristic grid. Finally, the spherical 2D buffer data are expanded by the method of radial elevation expansion to obtain the elevation data of the corresponding cell IDs, namely, the SGOG of the 3D buffer, so as to generate the 3D buffer of the target object. In order to verify the effectiveness of this method, we compare the proposed algorithm with the raster model buffer in terms of visualization effect and algorithm complexity. The methods proposed in this paper facilitate new ways to obtain 3D buffers to exploit 3D spatial data that are stored in the 3D DGGS framework of a Digital Earth, which is beneficial to spatial analysis and calculation of the 3D DGGS.
The rest of this paper is organized as follows: In
Section 2, we describe the data model of SGOG and propose the methods of generating the 3D buffer. In
Section 3, we present a variety of results produced by applying the proposed algorithm to obtain the 3D buffer. In
Section 4, we conclude the paper and provide directions for future work.
2. Methods
A 3D buffer is a 3D object established by a growth element through 3D space analysis, in which a growth element can be a single point, line, plane, or body, or a collection of them. Its mathematical definition is as follows: the 3D buffer D based on the growth element A is ; that is, the 3D buffer of radius r for A is the set of all x with minimum Euclidean distance from A.
A Digital Elevation Model (DEM) was used as the test target for our 3D buffer operations. The DEM realizes a digital simulation of the ground terrain through limited terrain elevation data, which is a digital expression of the terrain surface morphology. First, the target DEM data were processed and converted into SGOG cell IDs and the corresponding elevation storage of the cell IDs. If the corresponding target object was a 2D surface object or 3D volume object, it was necessary to extract the boundary data of the target object, convert it into the SGOG, and store the data of its boundary and target region separately. Then, the transformed SGOG cell IDs were transformed by our proposed Euclidean distance expansion algorithm based on QTM cell edge neighbors, and the corresponding cell IDs and the Euclidean distance relationships of the corresponding target cells were obtained, i.e., the 2D spherical buffer of the target object. Then, our proposed radial elevation transfer expansion algorithm was used to expand the corresponding radial elevation of the 2D spherical buffer grids, and the grids’ cell IDs in SGOG and corresponding elevations of the 3D buffer were obtained. Finally, the obtained boundary buffer and the radial buffer data set of the target area were intersected to obtain the 3D buffer of the target object.
2.1. Data Model Selection and Data Processing
In this paper, the sphere grid of SGOG was selected as the data storage and expression model. The model first splits the recursive quaternary of a spherical large-arc quaternary triangular mesh and then splits the radial equidistant recursive binary [
29]. The structures of the grid elements are spherical triangular pyramids around the center of the sphere and spherical triangular platforms at the remaining positions. In view of the fact that the current research content does not reach the geocentric domain, the SGOG units involved in this paper were all spherical triangular prism structures.
Since there are many calculations for the elevation of the radial direction in the calculation of the 3D buffer, if the data are stored in the form of SGOG ‘cell ID + radial ID’, a large number of radial ID decoding operations will be generated. In order to reduce unnecessary radial ID decoding operations and improve computational efficiency, the data storage format adopted in this paper was ‘cell ID + elevation’. Through the expansion algorithm, all the cell IDs of the object’s 3D buffer and the corresponding upper and lower elevations were obtained and finally returned to the SGOG model for visualization.
2.2. The 3D Buffer Generation Algorithm Based on QTM Edge Neighbors
Buffer generation can be regarded as starting from the initial cell and gradually expanding to the surrounding neighborhood until the distance from the expanded cell to the initial cell is greater than or equal to the given buffer radius. According to the radial continuity of the SGOG, in this paper we use the concept of dimensionality reduction to transform the 3D expansion of the 3D buffer into the 2D expansion of the growth grid element and the corresponding radial expansion of the elevation. On the one hand, we propose a method of Euclidean distance expansion based on QTM cell edge neighbors to expand the initial cell in 2D. On the other hand, we propose a method of radial elevation transfer expansion to determine the radial elevation of the corresponding 3D buffer cell ID.
2.2.1. The Euclidean Distance Expansion Based on QTM Cell Edge Neighbors
The purpose of the Euclidean distance expansion is to expand the initial cell by using QTM cell edge neighbors to obtain cells with different proximity and their corresponding Euclidean distances, that is, to obtain the spherical 2D buffer zone of the initial cell and the corresponding Euclidean distance attributes. In this paper, the distance between the center points of the QTM cells was used to express the Euclidean distance between the cells.
In order to facilitate the calculation of the Euclidean distance of the grid, complex units were used to indicate the expansion direction of the edge proximity of the grid, and the Euclidean distance between the cell and the initial cell was determined while the edge proximity expansion was performed. In view of the difference between the edge proximity of the positive and negative grids, a complex plane was established, as shown in
Figure 1 below. The three complex units of the positive grids are v
11, v
12, and v
13, and the three complex units of the negative grids are v
21, v
22, and v
23. Their values are shown in the following Equation (1):
First, it is determined whether the initial cell is a positive grid or a negative grid, so as to determine the complex units when the cell expands by edge neighbors. If it is a positive grid, the initial complex units are v
11, v
12, and v
13; if it is a negative grid, the initial complex units are v
21, v
22, and v
23. Then, according to the initial complex unit of the grid, the expansion complex unit of the cell is determined according to the corresponding relationship in
Table 1, and the next step is to expand the edge proximity. Then, according to the initial complex unit of the cell and the corresponding relationship in
Table 1, the expansion complex unit of the cell is determined for the next edge to expand using the edge neighbor. Assuming that the steps of complex units v
11, v
12, v
13, v
21, v
22, and v
23 passed by the cell are k
0, k
1, k
2, k
3, k
4, and k
5, the path complex number corresponding to the cell is shown in Equation (2).
We combine Equations (1) and (2) to obtain Equation (3).
From Equation (3), it can be seen that the simultaneous appearance of v
11 and v
23, v
12 and v
21, and v
13 and v
22 would result in a large number of repeated cells during edge neighbor expansion. Therefore, the following provisions are made during expansion: when the path complex number appears to be v
11, delete v
23 from the candidate expansion complex units; when the path complex number appears to be v
23, delete v
11 from the candidate expansion complex units; the same rules apply to v
12 and v
21, as well as v
13 and v
22. In this regard, each path complex number is only composed of the sum of three complex units: v
11 or v
23, v
12 or v
21, and v
13 or v
22. The path complex number composition and distribution of the expanded cell are shown in
Figure 2. Therefore, x = k
0 − k
5, y = k
1 − k
3, and z = k
2 − k
4 can be set; then Equation (3) can be transformed into Equation (4).
In Equation (4), when x ≥ 0, this indicates that the complex unit of the number of steps x of the cell is v
11; when x < 0, this indicates that the complex unit of the number of cell steps |x| is v
23. The relationship between the values of y and z and the complex unit is the same. The expansion complex units and corresponding (x, y, z) value changes are shown in
Table 2. At this time, the (x, y, z) value of the initial cell is (0, 0, 0); then (x, y, z) can be used to represent the cell obtained by the path complex number, and they are in a one-to-one correspondence. Incorporating the value of each complex unit into Equation (1), the relationship between the path complex number amplitude and (x, y, z) is shown in Equation (5).
If the side length of the grid under this subdivision level is r, the relationship between the distance
l between the cell corresponding to the complex number of paths and the initial cell and the path amplitude is as follows:
. We can combine this with Equation (5) to obtain Equation (6).
As shown in
Figure 3, the edge neighbor expansion starts from the initial cell with the cell ID of 120, which is a positive grid. The figure shows the edge neighbor expansion along the v
21 direction as an example. Corresponding to
Table 1, the next expansion complex units are v
11 and v
13. According to this recurrence, the path complex number of the corresponding cell and the Euclidean distance between the cells are obtained. This method directly obtains the Euclidean distance between the cells through the cell radius of the corresponding subdivision level and the path complex number between the corresponding cells, avoiding a large number of calculations caused by cell decoding to obtain coordinate points. In the figure, the path from cell ID 120 to cell ID 113 is the complex unit sequence v
21, v
11, v
21, v
11, and v
22. When cell ID 120 passes through the complex units v
21, v
11, v
22, and v
11 to obtain cell ID 103, the next complex unit is v
22 to obtain cell ID 131 because cell ID 113 has already been obtained. At the same time, the (x, y, z) value of cell ID 113 can be obtained as (2, −2, −1); by substituting this into Equation (6), the distance between cells 113 and 120 is
.
In order to facilitate the storage of the cell ID and the distance data of the corresponding initial cell, cells at the same distance from the initial cell are stored in the same container. To ensure the convenience of storage of the distance data in the container, marking r = 1, the distance in the container is represented by d = 3
l2 = |v|
2. As shown in
Figure 3, assuming that the initial cell’s cell ID is 100, the cells with cell IDs 101, 102, and 103 are stored in a container with a distance of 1, and the cells with cell IDs 112, 113, 121, 123, 131, and 132 are stored in a container with a distance of 3, etc. This data storage method facilitates the subsequent radial elevation expansion processing of the cells that are at the same distance from the initial cell.
2.2.2. The Radial Elevation Expansion
The function of the radial elevation transfer expansion of the grid is to expand the elevation of the QTM 2D buffer grid obtained by the edge neighbor expansion combined with the buffer radius and transform it into a SGOG 3D voxel. According to the edge neighbor expansion, the distance between the cell and the initial cell is 2D, and the obtained cell’s ID is the projection of the 3D buffer area of the initial cell in the spherical direction. It is assumed that the corresponding upper and lower elevations of the initial cell are htop and hdown, and the corresponding container marking distance for storing the cell is d. At this time, radial elevation expansion is performed on the cell; the maximum value of the corresponding elevation of the cell in the container is and the minimum value is . Through decoding, the maximum and minimum values of the SGOG radial ID are obtained, and all grid cells of SGOG located in the buffer are obtained according to the continuity of the SGOG radial ID.
Figure 4 is a schematic diagram of the radial elevation expansion, assuming that there is only one initial cell with ID 0000 and edge length
. The upper elevation of the initial cell is 1 and the lower elevation is -1, so the initial cell could be expressed as (0000, 1, −1); its similar triangular prism structure is shown in
Figure 4a. By carrying out edge neighbor expansion according to the above method, the cell IDs obtained after one edge neighbor expansion are 0001, 0002, and 0003, which are expressed as (0001, 1, −1), (0002, 1, −1), and (0003, 1, −1), and the structure is shown in
Figure 4b. Then, the Euclidean distance from the cells with IDs 0001, 0002, and 0003 to the initial cell ID 0000 can be calculated to be 6, and if the buffer radius is 10, the elevation expansion value of the corresponding cells is calculated to be 8. Finally, the elevation is expanded up and down as the calculations, which is shown in
Figure 4c. The cells in the 3D buffer are expressed as (0000, 11, −11), (0001, 9, −9), (0002, 9, −9), and (0003, 9, −9), as shown in
Figure 4d.
2.3. The Generation of the 3D Buffer
The purpose of 3D buffer generation of a point is first to transform the target point to the SGOG; that is, the initial cell is a grid cell of SGOG. The corresponding data are a cell ID and its corresponding elevation, and the Euclidean distance expansion based on QTM edge neighbors is performed on the cell ID to obtain cells and the Euclidean distances from these cells to the initial cell. The spherical 2D buffer of the cell ID is obtained as shown in
Figure 5a below. Then, through the radial elevation transfer expansion, that is, the elevation of the cell ID of the spherical 2D buffer zone corresponding to the radial expansion of the buffer radius, the 3D buffer zone of the cell is obtained as shown in
Figure 5b below.
To generate the 3D buffer of a line object, the line object needs to be transformed to the SGOG first. In this paper, the dimensionality reduction generation algorithm of the triangular mesh discrete line by Zhao et al. [
34] was used to discretize the spherical triangular mesh of a vector line. Then, the cells of the entire line in the SGOG were expanded in a 3D buffer, and the cell IDs and upper and lower elevation data of the buffer were obtained. Different initial cells may produce cells with repeated cell IDs when the 3D buffer is expanded, and because the corresponding initial cells of the repeated cells are different, the upper and lower elevation data of the repeated cells will be different. Therefore, it is necessary to obtain the union of the obtained buffer cells and perform data fusion on the repeated cells. For the cells with repeated cell IDs in all the obtained buffer cells, only one cell corresponding to the cell ID was retained. The upper elevation of this retained cell ID is the maximum value of the elevation subset on the repeated cell, and the lower elevation of it is the minimum value of the elevation subset on the repeated cell. In summary, 3D buffer generation of the line was completed, and the effect diagram is shown in
Figure 6.
With regard to the 3D buffer generation algorithm for area objects and volume objects, in view of the similarity between an area object and a volume object when they are transformed to the SGOG, the area object is a volume object with a very small difference between the upper and lower elevations, and the generated 3D buffers are also volume objects. Therefore, the 3D buffer generation algorithms for the two are the same. First, the boundary of the target DEM data is extracted to obtain its boundary line. The 3D buffer generation algorithm of a line object is adopted for the boundary line to obtain the peripheral buffer area of the boundary line. The peripheral buffer area refers to the buffer area obtained by the boundary line expanding outward to the target DEM. The target DEM is transformed to the cell IDs of the SGOG, and the corresponding DEM data of the obtained cell IDs are matched to the corresponding elevations. Therefore, to complete the target object transformation to the SGOG, radial elevation expansion is performed on the corresponding buffer radius of the acquired grid cells of the SGOG; that is, the upper and lower elevation values of the corresponding cell IDs correspond to the addition and subtraction of the buffer radius, respectively, to obtain the target’s radial elevation buffer area. Taking the union with the peripheral buffer area of the boundary line, the result is the 3D buffer of the target. In summary, taking the generation of the 3D buffer of the volume object as an example, the overall flow of the algorithm is shown in
Figure 7.