Method for automatically generating boundaries of a DTM model
By generating DTM model topology data using red-black binary trees and removing redundancy using the cosine theorem, and automatically generating boundaries, the problem of slow calculation speed and high cost caused by manual boundary drawing in existing technologies is solved, thus achieving efficient earthwork volume calculation.
Patent Information
- Application Number
- CN202110998990.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-28
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2041-08-28
AI Technical Summary
The existing DTM method for earthwork volume calculation requires manual operation for drawing boundaries and modifying triangular meshes, resulting in slow calculation speed and high human resource costs.
Red-black binary trees are used to generate topology data for irregular triangular networks in the DTM model. Boundary points are automatically processed by a boundary generation algorithm, and redundant data is removed using the cosine theorem to generate efficient boundaries.
It achieves automated generation of DTM model boundaries, reduces labor costs, increases the speed of earthwork volume calculation, removes redundant data, and improves calculation efficiency.
Smart Images

Figure CN113706703B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to earthwork calculation, in particular to a method for automatically generating a boundary of a DTM model. BACKGROUND
[0002] The DTM model is a digital expression of the properties of the topographic surface, and is a digital description with spatial location characteristics and topographic property characteristics, such as ground temperature, rainfall, earth magnetic force, gravity, land use, soil type, and other ground features. Alternatively, the digital terrain model is a database representing the spatial distribution of ground features, and is generally composed of a series of ground point coordinates (x, y, z) and a data array of ground properties (target category, features, etc.), to form a digital terrain model.
[0003] The model is generally based on a triangular mesh or a grid, and in the calculation of earthwork, the TIN method is generally used. It mainly uses discrete data points to construct adjacent triangles to obtain a mesh structure. Earthwork calculation based on such a model can reasonably use measured discrete elevation points and topographic feature points to construct a triangular mesh. When field measurement is performed in an engineering area, topographic feature points are collected based on the terrain conditions, and the digital terrain model obtained from the measured data has good authenticity and can be very close to the true terrain characteristics. It is very suitable for areas with relatively complex terrain conditions. After the triangular mesh is constructed, the volume of the triangular prism corresponding to the triangle is calculated, and the volumes of all triangular prisms are added to obtain the total filling and excavation amount.
[0004] The digital terrain model method can be well adapted to different terrains, better match the relevant features of the ground surface, and significantly improve the calculation efficiency and accuracy. When the method is used to calculate earthwork, the final result is obtained through the volume of the triangular prism described above. Currently, DTM method for calculating earthwork mostly uses computers for calculation, and the general steps are as follows:
[0005] 1) Obtain the three-dimensional coordinate point file obtained by field measurement, select an appropriate scale, and complete the point expansion operation;
[0006] 2) Draw the boundary, manually connect the boundary points of the earthwork calculation in the software to form a closed boundary, and determine the earthwork calculation range;
[0007] 3) Establish a DTM for the three-dimensional points within the boundary according to the coordinate point file;
[0008] 4) Since there are triangles in the generated triangular mesh that do not conform to the actual situation, some triangles of the triangular mesh need to be manually deleted;
[0009] 5) Calculate earthwork volume for the modified triangulation network;
[0010] The DTM method earthwork volume calculation step can be seen that drawing the boundary and the modified part of the triangulation network needs manual operation, which greatly reduces the calculation speed and increases the human resources and cost. SUMMARY
[0011] In view of the above technical problems, the present application provides a DTM model automatic boundary generation method, which reduces the labor cost investment and improves the earthwork volume calculation speed.
[0012] The specific technical solution is:
[0013] A DTM model automatic boundary generation method, comprising the following steps:
[0014] S1: input point cloud data to generate a DTM model;
[0015] S2: use a red-black binary tree to generate topological data for the irregular triangulation network in the DTM model;
[0016] S3: read the topological data of S2 to generate a boundary.
[0017] Wherein, the S2 comprises the following steps:
[0018] S2.1: first establish a structure m_out, and store four arrays of pointlist, pointattributelist, trianglelist and neighborlist in the structure; wherein, the pointlist is used to store the planar coordinates of the triangular points, the pointattributelist is used to store the elevation coordinates of the triangular points, the trianglelist is used to store the triangular vertex serial number, and the neighborlist is used to store the three adjacent triangular serial numbers of each side of the triangle, and -1 indicates that there is no adjacent triangle in the direction;
[0019] S2.2: establish a red-black binary tree, iterate each triangle in the DTM, set an index value for each point of each triangle, the initial value is 0, add 1 according to the iteration number, and then add the point to the tree according to the red-black binary tree rule;
[0020] S2.3: Set each value in the neighborlist array to -1, iterate through each triangle, put the points of the triangle into the red-black binary tree to find, return the index value of the point, store the planar coordinates of the point into the pointlist, and set the key value according to the index value; store the elevation value of the point into the pointattributelist, and set the key value according to the index value; store the vertex of the point into the trianglelist, and set the key value to start from 0 and add 1 according to the iteration number;
[0021] S2.4: Set an integer variable nTriCount with an initial value of 0 and add 1 according to the iteration number, establish a data structure map container neighbourMap, two member variables are composed of a structure template pair, the first member variable is the edge of the triangle, and the second member variable is the left and right triangle serial number of the current edge, and the two member variables of pair are composed of integer variables, the index values of the three points in the triangle iterated in S2.3 form an edge two by two, with the smaller index value first, and are stored in pair, and the edge is stored in neighbourMap for searching, if not found, the edge is stored in the first member variable of neighbourMap, and the front and back two variables of the second member variable of neighbourMap are set to -1 and nTriCount respectively; if the edge is found, update the two member variables of the value in neighbourMap according to the edge as the key;
[0022] S2.5: Set an integer variable num with an initial value of 0, iterate through each triangle, two points in the triangle form an edge, set according to the index value of the point, with the smaller index value first, and store it in pair, search neighbourMap according to the edge as the key, get the second member variable of neighbourMap, if the variable is not equal to the current triangle index value, assign this variable to num, finally, store num into neighborlist, and set the key according to the current triangle index value; at this point, the topological data generation is complete.
[0023] The step S3 comprises the following steps:
[0024] S3.1: Establishing data structure map container bndTable, iterating the triangle of m_out in S2, checking whether the neighbor list of each edge of the current triangle is -1, if not -1, jumping to the next triangle, if -1, storing the two vertices of the edge in the triangle list serial number and the triangle index value nTriCount into bndTable, thus the triangle index value and the vertex serial number of the boundary edge in the DTM model are found out;
[0025] S3.2: In order to better fit the DTM model, removing the redundant data in the DTM model, establishing data structure pt for storing the boundary point plane coordinate and the elevation point information, iterating each triangle of bndTable in S3.1, calculating the inverse cosine value of the third vertex except the vertex of the boundary edge by using the cosine theorem, if the inverse cosine value is less than a threshold value, the vertex serial number of the boundary edge is reserved, otherwise, the vertex serial number of the other two edges of the triangle is reserved, the vertex serial number obtained after iteration is used as a key, the coordinate point information in the pointlist and the pointattributelist in m_out is extracted and stored into pt, thus the boundary point information extraction is completed;
[0026] S3.3: Drawing the boundary point extracted in S3.2.
[0027] Preferably, the threshold value in S3.2 is set to 90°.
[0028] The DTM model automatic boundary generation method provided by the application is simple and efficient, the redundant data in the DTM model is removed, and the automatic degree of the DTM method for calculating the earthwork volume is improved. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 The DTM model boundary generation flowchart of the application is shown in the figure;
[0030] Figure 2 The DTM model topological data generation flowchart of the application is shown in the figure;
[0031] Figure 3 The topological data boundary point extraction flowchart of the application is shown in the figure;
[0032] Figure 4 The DTM model of the three-dimensional point cloud data of the embodiment is shown in the figure;
[0033] Figure 5 The DTM model boundary line of the embodiment is shown in the figure;
[0034] Figure 6 The DTM method is used to calculate the earthwork for the example. DETAILED DESCRIPTION
[0035] The specific technical solutions of the present application are described in combination with examples.
[0036] As shown in the flowchart, a DTM model automatic boundary generation method includes the following steps: Figure 1
[0037] S1: input point cloud data and generate a DTM model;
[0038] S2: use a red-black binary tree to generate topological data for the irregular triangle network in the DTM model; the specific steps are as shown in Figure 2
[0039] S3: read the topological data of S2 to generate a boundary; the specific steps are as shown in Figure 3
[0040] This embodiment uses the VisualStidio 2019 platform to automatically draw the boundary of the DTM model, which can not only reduce the labor cost and improve the earthwork calculation speed, but also shrink the triangle network and remove redundant data.
[0041] This example is a new project of Yichun-Sanyang to Xintian section of Yichun-Jinggangshan Expressway, the starting point of the project is located near the east of Changlingbei in Sanyang Town of Yuanzhou District in Yichun City, and the ending point is located near Yangya Village, 1.25 kilometers south of Shanghai-Kunming Expressway in Xintian Town of Yuanzhou District in Yichun City. A cross-type hub is set to connect Shanghai-Kunming Expressway and Yichun-Sui Expressway. After the interchange, the route directly connects the starting point of the Yichun-Sui Expressway new project which is in the preliminary design stage. The route passes through Sanyang Town, Hutan Town, Hongtang Town and Xintian Town in Yuanzhou District, with a total length of 18.423 kilometers. The main control points of the route are in turn Wan-Yichun Expressway S81, Sanyang Town, Hutan Town, National Highway G320, Hongtang Town, Xintian Town, Yichun urban area, Shanghai-Kunming Expressway G60 and Yichun-Sui Expressway.
[0042] First, a DTM model is established for the three-dimensional point cloud data of the project, as shown in Figure 4 , second, the boundary is automatically generated for the DTM model, as shown in Figure 5 , and as can be seen from the figure, the generated boundary has removed redundant data as needed. Finally, the earthwork calculation is performed for the model within the boundary, as shown in Figure 6 , and the elevation is selected as 105m.
[0043] The experimental results show that the DTM model automatic boundary generation can speed up the earthwork calculation, save cost and improve the automation degree.
[0044] The technical principles of the present application are described above in combination with specific embodiments. These descriptions are only for explaining the principles of the present application, and cannot be interpreted as limiting the protection scope of the present application in any way. Based on the explanations herein, other specific embodiments of the present application can be conceived by those skilled in the art without any creative effort, and these embodiments will all fall within the protection scope of the claims of the present application.
Claims
1. A method for automatically generating boundaries of a DTM model, characterized in that, Includes the following steps: S1: Input point cloud data and generate DTM model; S2: Use red-black binary trees to generate topology data for irregular triangular networks in the DTM model; S3: Read the topology data from S2 and generate the boundary; S2 includes the following steps: S2.1: First, create a structure m_out, which stores four arrays: pointlist, pointattributelist, trianglelist, and neighborlist. Pointlist stores the planar coordinates of the triangle points, pointattributelist stores the elevation coordinates of the triangle points, trianglelist stores the vertex indices of the triangle, and neighborlist stores the indices of the three adjacent triangles on each side of the triangle. -1 indicates that there are no adjacent triangles in that direction. S2.2: Construct a red-black binary tree. Iterate over each triangle in the DTM and set an index value for each point in each triangle. The initial value is 0 and is incremented by 1 according to the number of iterations. Then, add the points to the tree according to the rules of the red-black binary tree. S2.3: Set each value in the neighborlist array to -1, iterate over each triangle, search for the points of the triangle in the red-black binary tree, return the index value of the point, store the planar coordinates of the point in pointlist, and set the key value according to the index value; store the elevation value of the point in pointattributelist, and set the key value according to the index value; store the vertex of the point in trianglelist, and start the key value from 0 and increment it by 1 according to the number of iterations. S2.4: Set an integer variable nTriCount with an initial value of 0, incrementing by 1 with each iteration. Create a data structure map container neighborMap. The two member variables are composed of the structure template pair. The first member variable is the edge of the triangle, and the second member variable is the left and right triangle indices of the current edge. The two member variables of pair are integer variables. In S2.3, the indices of the three points in the iterated triangle are paired to form an edge, with the smaller index value first. This edge is stored in pair and searched in neighborMap. If not found, the edge is stored in the first member variable of neighborMap. The two variables of the second member variable of neighborMap are set to -1 and nTriCount respectively. If the edge is found, the two member variables of neighborMap are updated using the edge as the key. S2.5: Set an integer variable `num` with an initial value of 0. Iterate over each triangle. Three points in a triangle form an edge in pairs. Based on the index value of the points, the smaller index value is placed first and stored in `pair`. Using the edge as the key, search in `neighbourMap` in S2.4 to obtain the second member variable of `neighbourMap`. If the variable is not equal to the current triangle index value, assign this variable to `num`. Finally, store `num` in `neighborlist`, with the key set according to the current triangle index value. At this point, the topology data generation is complete.
2. The method for automatically generating boundaries of a DTM model according to claim 1, characterized in that, Step S3 includes the following steps: S3.1: Establish a data structure map container bndTable, iterate over the triangles in m_out in S2, and check whether the adjacent triangle values of each edge of the current triangle in neighborlist are -1. If they are not -1, jump to the next triangle. If they are -1, store the two vertices of the edge in the trianglelist index and the triangle index value nTriCount in bndTable. At this point, the index values of the triangles with boundaries in the DTM model and the vertex indices of the boundary edges in the triangles have been found. S3.2: To better fit the DTM model and remove redundant data, a data structure pt is established to store the planar coordinates and elevation information of boundary points. Each triangle in the bndTable of S3.1 is iterated, and the inverse cosine value of the third vertex (excluding the vertices on the boundary edges) is calculated using the cosine theorem. If the inverse cosine value is less than a threshold, the vertex index of the boundary edge is retained; otherwise, if the inverse cosine value is greater than the threshold, the vertex indices of the other two sides of the triangle are retained. The vertex indices obtained after iteration are used as keys to extract the coordinate point information from pointlist and pointattributelist in m_out and store it in pt. At this point, the boundary point information extraction is complete. S3.3: Draw the boundary points extracted in S3.
2.
3. The method for automatically generating boundaries of a DTM model according to claim 2, characterized in that, The threshold mentioned in S3.2 is set to 90°.
Citation Information
Patent Citations
Discrete point zone topology boundary tracking process based edge length ratio constraint
CN101477691A
Two dimensional vector graphics triangulation system and method thereof
US20110122139A1