Earthwork calculation method and device, computer equipment and storage medium
By using multiple sampling points and high-precision rasterization, the problem of low efficiency in earthwork volume calculation under complex terrain conditions is solved, improving the accuracy and efficiency of the calculation and adapting to the calculation needs of complex terrain.
Patent Information
- Application Number
- CN202511051626.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-12-09
AI Technical Summary
Existing computer-aided methods are inefficient in calculating earthwork volumes in complex terrain environments. Traditional methods rely on manual measurement, are prone to errors, and cannot accurately reflect subtle changes in the terrain.
The method employs multiple sampling points and high-precision rasterization. By constructing a raster structure, elevation data of multiple sampling points are obtained, the raster type is determined, and the earthwork volume is calculated based on the elevation data and raster area. BVH is used to accelerate the structural optimization calculation process, and slope raster and boundary raster are combined to handle complex terrain.
It improves the accuracy and efficiency of earthwork volume calculation, better adapts to complex terrain, ensures the accuracy and speed of calculation results, and reduces the amount of calculation and memory usage.
Smart Images

Figure CN121092811A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of earthwork engineering technology, specifically to an earthwork calculation method, apparatus, computer equipment, and storage medium. Background Technology
[0002] Earthwork is often a prerequisite and key process for project success. Rapid and accurate calculation of earthwork volume helps improve the efficiency of engineering design and control on-site construction costs.
[0003] Traditional earthwork calculation methods rely on manual measurement and simple geometric calculations, which are inefficient and prone to errors. Existing computer-aided methods suffer from performance bottlenecks when handling large-scale scenarios, especially in complex terrain environments where computational efficiency is low. Summary of the Invention
[0004] In view of this, this application proposes an earthwork calculation method, apparatus, computer equipment, and storage medium to solve the problem of low calculation efficiency of existing computer-aided methods in handling earthwork volumes in complex terrain environments.
[0005] The first aspect of this application provides a method for calculating earthwork volume, the method comprising:
[0006] A grid structure is constructed based on a terrain model and a building model; the grid structure comprises multiple grids of the same size.
[0007] For any given grid, acquire elevation data for multiple sampling points within that grid;
[0008] The grid type is determined based on the elevation data of the multiple sampling points; the grid type includes one of cut grid, fill grid, and slope grid.
[0009] The earthwork volume of the grid is calculated based on the grid type, the elevation data of the multiple sampling points, and the grid area; the earthwork volume is either fill or excavation.
[0010] The total earthwork volume is obtained by merging the earthwork volumes corresponding to multiple grids.
[0011] This application's embodiments, by acquiring elevation data from multiple sampling points in each grid, can capture subtle changes in terrain more meticulously, thereby improving the accuracy of earthwork volume calculation. Traditional single-sampling-point methods may fail to accurately reflect subtle terrain undulations, while multi-sampling-point methods are better suited to complex terrains. Complex terrains (such as mountainous areas, valleys, and urban built-up areas) often exhibit numerous subtle changes, which traditional low-precision sampling may not accurately capture. Through multi-sampling-point and high-precision rasterization, it is possible to better adapt to complex terrains and ensure the accuracy of the calculation results.
[0012] In this embodiment of the application, determining the raster type of the raster based on the elevation data of the plurality of sampling points includes:
[0013] For any of the plurality of sampling points, if the sampling point has terrain elevation data and building elevation data, and the terrain elevation data is less than the building elevation data, then the sampling point is determined to meet a first preset condition; if the sampling point has terrain elevation data and building elevation data, and the terrain elevation data is greater than the building elevation data, then the sampling point is determined to meet a second preset condition.
[0014] When all of the multiple sampling points meet the first preset condition, the grid is determined to be a fill grid;
[0015] When all of the multiple sampling points meet the second preset condition, the grid is determined as a cut grid.
[0016] In this embodiment of the application, the grid type further includes boundary grids and grids to be determined; determining the grid type of the grid based on the elevation data of the multiple sampling points further includes:
[0017] When some of the sampling points among the plurality of sampling points meet the first preset condition, or when some of the sampling points meet the second preset condition, the grid is determined as a boundary grid.
[0018] The grid cells other than the fill grid cells, the cut grid cells, and the boundary grid cells are identified as grid cells to be judged.
[0019] In this embodiment of the application, the grid to be determined includes fill slope grids and cut slope grids; after determining the grid as the grid to be determined, the method further includes:
[0020] Using the grid cell to be determined as the center, search for nearby grid cells;
[0021] If the adjacent grid of the grid to be determined is a fill grid, then the grid to be determined is determined as the fill slope grid;
[0022] If the adjacent grid of the grid to be determined is a cut grid, then the grid to be determined is identified as the cut slope grid.
[0023] In this embodiment of the application, calculating the earthwork volume of the grid based on the grid type, the elevation data of the plurality of sampling points, and the grid area includes:
[0024] When the grid is a fill grid or a cut grid, calculate the first elevation difference between the terrain elevation data and the building elevation data of any sampling point in the grid;
[0025] If the first elevation difference is greater than zero, the product of the first elevation difference and the grid area is used as the excavation volume of the grid.
[0026] If the first elevation difference is less than zero, the product of the first elevation difference and the grid area is used as the fill volume of the grid.
[0027] In this embodiment of the application, the slope grid includes embankment slope grid and cut slope grid; calculating the earthwork volume of the grid based on the grid type, the elevation data of the plurality of sampling points, and the grid area further includes:
[0028] When the grid is a slope grid, calculate the horizontal projected distance between the grid and the adjacent fill grid or cut grid;
[0029] Calculate the building elevation data of the grid based on the horizontal projection distance, slope ratio, and building elevation data of the adjacent fill or cut grids;
[0030] Calculate the second elevation difference between the terrain elevation data and the building elevation data of the grid;
[0031] If the second elevation difference is greater than zero, the product of the second elevation difference and the grid area is determined as the excavation volume of the grid.
[0032] If the second elevation difference is less than zero, the product of the second elevation difference and the grid area is determined as the fill volume of the grid.
[0033] In this embodiment of the application, the plurality of grids of the same size are divided according to a first sampling precision; after determining the grids as boundary grids, the method further includes:
[0034] The sub-grid structure of the boundary grid is generated using a second sampling precision; the second sampling precision is higher than the first sampling precision, and the sub-grid structure includes multiple sub-grids of the same size;
[0035] For any sub-grid, the sub-grid is used as the grid, and the step of acquiring the elevation data of multiple sampling points in the grid is performed until the multiple sub-earthwork volumes corresponding one-to-one with the multiple sub-grids are merged to obtain the earthwork volume of the boundary grid.
[0036] An embodiment of the second aspect of this application provides an earthwork calculation device, comprising:
[0037] A grid structure building module is used to construct a grid structure based on a terrain model and a building model; the grid structure includes multiple grids of the same size.
[0038] The elevation data acquisition module is used to acquire elevation data of multiple sampling points in any given grid.
[0039] The grid type determination module is used to determine the grid type of the grid based on the elevation data of the multiple sampling points; the grid type includes one of cut grid, fill grid and slope grid;
[0040] The earthwork volume calculation module is used to calculate the earthwork volume of the grid based on the grid type, the elevation data of the multiple sampling points, and the grid area; the earthwork volume is either fill volume or cut volume.
[0041] The earthwork volume merging module is used to merge the earthwork volumes corresponding to multiple grids to obtain the total earthwork volume.
[0042] An embodiment of the third aspect of this application provides a computer device including a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the earthwork calculation method described in the first aspect by executing the computer instructions.
[0043] An embodiment of the fourth aspect of this application provides a computer-readable storage medium storing computer instructions for causing a computer to perform the earthwork calculation method described in the first aspect above.
[0044] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0045] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings.
[0046] In the attached diagram:
[0047] Figure 1 A flowchart illustrating an earthwork calculation method according to an embodiment of this application is shown;
[0048] Figure 2 A flowchart illustrating another earthwork calculation method provided in an embodiment of this application is shown;
[0049] Figure 3 This invention provides a schematic diagram of the structure of an earthmoving calculation device according to an embodiment of the present application.
[0050] Figure 4 This illustration shows a schematic diagram of the structure of a computer device according to an embodiment of this application;
[0051] Figure 5 A schematic diagram of a storage medium provided in one embodiment of this application is shown. Detailed Implementation
[0052] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.
[0053] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains.
[0054] According to an embodiment of this application, an embodiment of an earthwork calculation method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0055] This embodiment provides a method for calculating earthwork volume. Figure 1 This is a flowchart of an earthwork calculation method according to an embodiment of this application, such as... Figure 1 As shown, the process includes the following steps:
[0056] Step S101: Construct a grid structure based on the terrain model and building model.
[0057] Specifically, a terrain model can be understood as terrain typically represented by a mesh, which is a surface composed of many triangles or polygons. For example, mountains, plains, and other terrain features in a 3D map can be modeled using a mesh. Building models are also composed of meshes. The grid structure consists of multiple grids of the same size.
[0058] More specifically, for example Figure 2 As shown: Before constructing a grid structure containing multiple grids, it is necessary to first construct a BVH (Bounding Volume Hierarchy) acceleration structure based on the terrain model and building model, and then perform sampling region rasterization on the BVH acceleration structure, that is, divide the geometric objects (such as terrain mesh) in the BVH acceleration structure into regular grid cells.
[0059] In this embodiment, since BVH has divided the geometric objects in the scene into multiple levels of bounding boxes, the grid area can be divided according to the boundaries of these bounding boxes; through the hierarchical structure of BVH, the bounding box containing the target location can be quickly located, thereby reducing the number of geometric objects that need to be searched.
[0060] In some specific embodiments, the grid can be divided according to the sampling precision, where [w,h] represents the precision resolution. Here, w refers to the width of the grid, and h refers to the height of the grid. [w,h] determines the size of the grid, thus affecting the sampling precision. For example, if the value of [w,h] is small, the grid will be smaller, resulting in higher sampling precision, but also greater computational cost. If the value of [w,h] is large, the grid will be larger, resulting in lower sampling precision, but less computational cost.
[0061] Step S102: For any given grid, acquire elevation data of multiple sampling points within the grid.
[0062] Specifically, the elevation data for each sampling point includes topographic elevation data (i.e., the vertical height of a point on the ground relative to a reference surface (usually sea level), such as the height of the general ground) and building elevation data (i.e., building elevation refers to the vertical height of the top of a building relative to a reference surface (usually sea level). If the sampling point does not contain buildings, then the sampling point may only contain building elevation data.
[0063] Step S103: Determine the grid type of the grid based on the elevation data of the multiple sampling points.
[0064] Specifically, for example Figure 2 As shown: The grid type includes one of the following: cut grid, fill grid, boundary grid and slope grid; among which, slope grid can be further divided into fill slope grid and cut slope grid.
[0065] More specifically, if the elevation within a slope grid is generally higher than the reference elevation (i.e., the height of the datum plane), but there are certain elevation variations, then this grid is classified as an embankment slope grid; conversely, if the elevation within a slope grid is generally lower than the reference elevation, but there are certain elevation variations, then this grid is classified as an excavation slope grid.
[0066] In some specific embodiments, step S103 above includes steps S1031-S1033:
[0067] Step S1031: For any of the plurality of sampling points, if the sampling point has terrain elevation data and building elevation data, and the terrain elevation data is less than the building elevation data, then the sampling point is determined to meet the first preset condition; if the sampling point has terrain elevation data and building elevation data, and the terrain elevation data is greater than the building elevation data, then the sampling point is determined to meet the second preset condition.
[0068] Step S1032: When all the sampling points meet the first preset condition, the grid is determined as a fill grid. The first preset condition can be understood as... Figure 2 The filling conditions in the text.
[0069] Step S1033: When all the sampling points meet the second preset condition, the grid is determined as a cut-out grid. The second preset condition can be understood as... Figure 2 Excavation conditions in the process.
[0070] In this embodiment of the application, when the terrain elevation data is less than the building elevation data, it means that the height of the building is higher than the ground level. Therefore, it is necessary to fill the area and calculate the fill volume, so that the grid can be identified as a fill grid. Conversely, when the terrain elevation data is greater than the building elevation data, it means that the height of the building is lower than the ground level. Therefore, it is necessary to excavate the area and calculate the excavation volume, so that the grid can be identified as an excavation grid.
[0071] In some specific embodiments, step S103 above includes steps a1-a2:
[0072] Step a1: When some of the sampling points among the plurality of sampling points meet the first preset condition, or when some of the sampling points meet the second preset condition, the grid is determined as a boundary grid.
[0073] Specifically, the first presupposition condition can be understood as Figure 2 The filling conditions in the text, the second presupposition condition can be understood as Figure 2In the excavation conditions, if the sampling points within a raster partially meet the filling conditions or partially meet the excavation conditions, the raster is classified as a boundary raster. A boundary raster indicates that the area is a transition zone between the terrain and the elevation of the object being monitored. This means that there is a significant change between the terrain elevation and the elevation of the object being monitored within this raster. For example, if some sampling points in a raster have building elevation data greater than the terrain elevation data, while other sampling points only contain terrain elevation data, the raster can be identified as a transition zone between the terrain and buildings above ground. Similarly, if some sampling points in a raster have building elevation data less than the terrain elevation data, while other sampling points only contain terrain elevation data, the raster can be identified as a transition zone between the terrain and buildings below ground.
[0074] In some specific embodiments, after step a1 above, the method further includes:
[0075] The sub-grid structure of the boundary grid is generated using a second sampling precision; the second sampling precision is higher than the first sampling precision, and the sub-grid structure includes multiple sub-grids of the same size;
[0076] For any sub-grid, the sub-grid is used as the grid, and the step of acquiring the elevation data of multiple sampling points in the grid is performed until the multiple sub-earthwork volumes corresponding one-to-one with the multiple sub-grids are merged to obtain the earthwork volume of the boundary grid.
[0077] In this embodiment, higher-precision sampling (sub-grids) allows for more detailed capture of subtle terrain changes, thereby improving the accuracy of earthwork volume calculation. For example, in traditional methods, a large grid may not accurately reflect the subtle undulations of the terrain, while sub-grids can measure these changes more precisely. Complex terrains (such as mountains and valleys) often exhibit numerous subtle changes, which traditional low-precision sampling may not accurately capture. The sub-grid structure better adapts to complex terrains, ensuring the accuracy of the calculation results.
[0078] Step a2: Identify the grid cells other than the fill grid cells, the cut grid cells, and the boundary grid cells as grid cells to be determined.
[0079] In some specific embodiments, the grid to be determined further includes: fill slope grid and cut slope grid; after step a2 above, the method further includes steps b1-b3:
[0080] Step b1: Using the grid cell to be determined as the center, search for nearby grid cells.
[0081] Step b2: If the adjacent grid of the grid to be determined is a fill grid, then the grid to be determined is determined as the fill slope grid.
[0082] Step b3: If the adjacent grid of the grid to be determined is a cut grid, then the grid to be determined is determined as the cut slope grid.
[0083] In the embodiments of this application, embankment slope refers to a slope with a certain inclination angle formed by artificial filling, usually located between the ground and buildings above the ground, used to raise the ground to the design elevation of the building to meet engineering requirements, such as the construction of embankments, filling sites, etc.; cut slope refers to a slope with a certain inclination angle formed by artificial excavation, usually located between the ground and buildings below the ground, used to lower the ground to the design elevation of the building to meet engineering requirements, such as the construction of road cuts, foundation pits, etc.
[0084] In this embodiment, all grids to be determined in the grid structure are traversed, and it is determined whether the adjacent grids around each grid to be determined are fill grids or cut grids. If the adjacent grids are fill grids, and the building elevations of multiple sampling points in the grid to be determined vary to a certain extent (for example, the building elevations of multiple sampling points in the grid are arranged in descending order, where the building elevation of the sampling point closer to the adjacent grid is greater than the building elevation of the sampling point farther from the adjacent grid), then the grid to be determined can be identified as a fill slope grid. Conversely, if the adjacent grids are identified as cut grids, and the building elevations of multiple sampling points in the grid to be determined vary to a certain extent (for example, the building elevations of multiple sampling points in the grid are arranged in ascending order, where the building elevation of the sampling point closer to the adjacent grid is less than the building elevation of the sampling point farther from the adjacent grid), then the grid to be determined can be identified as a cut slope grid.
[0085] Step S104: Calculate the earthwork volume of the grid based on the grid type, the elevation data of the multiple sampling points, and the grid area. Specifically, the earthwork volume is either fill or excavation. The grid area is determined when dividing the grid according to the sampling precision. For example, when the sampling precision is [1,1], the area of each grid is 1×1 = 1 square unit. When the sampling precision is [10,10], the area of each grid is 10×10 = 100 square units.
[0086] In some specific embodiments, steps S1041-S1043 above are:
[0087] Step S1041: When the grid is a fill grid or a cut grid, calculate the first elevation difference between the terrain elevation data and the building elevation data of any sampling point in the grid.
[0088] Step S1042: If the first elevation difference is greater than zero, the product of the first elevation difference and the grid area is used as the excavation volume of the grid.
[0089] Step S1043: If the first elevation difference is less than zero, the product of the first elevation difference and the grid area is used as the fill volume of the grid.
[0090] In this embodiment, the first elevation difference represents the difference between the terrain elevation data (i.e., ground height) and the building elevation data (building height) of the sampling point. When the first elevation value is greater than zero, it indicates that the building height at the sampling point is less than the ground height. For example, if the ground height is 0 and the building height is -5, the first elevation difference is 0 - (-5) = 5, meaning that the building is located below ground level, requiring excavation and calculation of the excavation volume. The product of the first elevation difference and the grid area can be used as the excavation volume of the grid.
[0091] Similarly, when the first elevation value is less than zero, it indicates that the building height at the sampling point is greater than the ground height. For example, if the ground height is 0 and the building height is 5, the first elevation difference is 0 - 5 = -5. This means that the building is located above the ground and fill work is required, and the fill volume needs to be calculated. The fill volume of the grid can be obtained by multiplying the first elevation difference by the grid area.
[0092] More specifically, topographic elevation data (i.e., ground height) includes, but is not limited to, 0, and may be greater than or less than 0, depending on the topography of the sampling point location and its relationship to the reference surface (sea level). For example, if the terrain is high (e.g., a mountain peak above sea level), the ground height is greater than 0; conversely, if the terrain is low (e.g., a basin below sea level), the ground height is less than 0.
[0093] In some specific embodiments, step S104 above further includes steps c1-c5:
[0094] Step c1: When the grid is a slope grid, calculate the horizontal projection distance between the grid and the adjacent fill grid or cut grid.
[0095] Step c2: Calculate the building elevation data of the grid based on the horizontal projection distance, slope ratio, and building elevation data of the adjacent fill or cut grids.
[0096] Step c3: Calculate the second elevation difference between the terrain elevation data and the building elevation data of the raster;
[0097] Step c4: If the second elevation difference is greater than zero, the product of the second elevation difference and the grid area is determined as the excavation volume of the grid.
[0098] Step c5: If the second elevation difference is less than zero, the product of the second elevation difference and the grid area is determined as the fill volume of the grid.
[0099] For example, let's illustrate steps c1-c5 above:
[0100] Assume the grid size is 1m*1m, with a 45° slope; the grid coordinates are (4, 4), and the grid's terrain elevation data Z... dem The elevation is 118.5m; the coordinates of the adjacent cut grid are (2, 2), and the building elevation Z is... ref The slope is 118m; the slope ratio is 1:1 → tanθ = 1;
[0101] The horizontal projected distance d between the grid and the adjacent cut grid is calculated as follows:
[0102]
[0103] Calculate the building elevation data Z of the raster. s for:
[0104] Z s =Z ref -d*tanθ
[0105] Z s =118m - 2.828m * 1 = 115.172m
[0106] The second elevation difference ΔH is:
[0107] ΔH=Z dem -Z s
[0108] ΔH = 118.5 - 115.172 = 3.328m
[0109] When ΔH = 3.328m < 0, excavation is required;
[0110] The excavation volume is V = 3.328 * 1m. 2 =3.328m 2
[0111] Step S105: Combine the earthwork volumes corresponding to multiple grids to obtain the total earthwork volume.
[0112] Specifically, the process merges rasters from different regions and generates rendering objects based on their rendering elevation start and end points. Rasteres with different attributes are merged separately and returned as collection objects. The calculation results are then converted into a visualization model, using different colors to distinguish cut, fill, and slope areas, allowing users to intuitively understand the cut and fill distribution. The model can also be exported.
[0113] In some specific embodiments, after step S105 above, the method further includes:
[0114] Multiple threads are invoked to calculate the earthwork volume of multiple grids in the grid structure in parallel; the multiple threads correspond one-to-one with the multiple grids.
[0115] In this embodiment, Web Workers (which can be understood as background threads running in a browser environment) can be used for parallel computing to improve computational efficiency in large-scale scenarios. Computational tasks are performed in the background to avoid blocking the main thread. The Web Worker file is responsible for executing computationally intensive tasks such as excavation and fill volume calculations. The system can perform complex computational tasks without blocking the main thread, maintaining the responsiveness of the user interface. The main thread can continue to handle user interactions, while computationally intensive tasks are executed in background threads. The Worker also periodically reports the computational progress to the main thread, allowing the user to understand the computational status.
[0116] The embodiments of this application have the following technical effects:
[0117] By constructing a BVH tree to accelerate the intersection test of rays and triangular meshes, sampling efficiency is significantly improved.
[0118] The calculation region is automatically divided based on the size of the calculation region and the sampling accuracy.
[0119] By leveraging the browser's multithreading capabilities for parallel computing, the main thread can be prevented from being blocked, thus improving the user experience.
[0120] By using partitioned computing and data structure optimization, memory usage is effectively controlled, enabling the processing of large-scale terrain data.
[0121] By employing grid mapping and neighborhood analysis methods, the boundaries of cut and fill areas are accurately identified, providing a reliable basis for slope calculation.
[0122] Corresponding to the above implementation of the earthwork calculation method, this application also provides an earthwork calculation device for executing the earthwork calculation method described in the above embodiments. Figure 3 As shown, the earthwork calculation device includes:
[0123] A grid structure building module is used to construct a grid structure based on a terrain model and a building model; the grid structure includes multiple grids of the same size.
[0124] The elevation data acquisition module is used to acquire elevation data of multiple sampling points in any given grid.
[0125] The grid type determination module is used to determine the grid type of the grid based on the elevation data of the multiple sampling points; the grid type includes one of cut grid, fill grid and slope grid;
[0126] The earthwork volume calculation module is used to calculate the earthwork volume of the grid based on the grid type, the elevation data of the multiple sampling points, and the grid area; the earthwork volume is either fill volume or cut volume.
[0127] The earthwork volume merging module is used to merge the earthwork volumes corresponding to multiple grids to obtain the total earthwork volume.
[0128] Optionally, the grid type determination module is further configured to: for any one of the plurality of sampling points, if the sampling point has terrain elevation data and building elevation data, and the terrain elevation data is less than the building elevation data, then determine that the sampling point meets a first preset condition; if the sampling point has terrain elevation data and building elevation data, and the terrain elevation data is greater than the building elevation data, then determine that the sampling point meets a second preset condition; when all the plurality of sampling points meet the first preset condition, determine the grid as a fill grid; when all the plurality of sampling points meet the second preset condition, determine the grid as a cut grid.
[0129] Optionally, the grid type determination module is further configured to: determine the grid as a boundary grid when some of the sampling points among the plurality of sampling points meet the first preset condition, or when some of the sampling points meet the second preset condition; and determine the grids other than the fill grid, the cut grid and the boundary grid among the plurality of grids as grids to be determined.
[0130] Optionally, a slope grid determination module is used to search for nearby grids centered on the grid to be determined after determining the grid to be determined; if the adjacent grid of the grid to be determined is a fill grid, then the grid to be determined is determined as the fill slope grid; if the adjacent grid of the grid to be determined is a cut grid, then the grid to be determined is determined as the cut slope grid.
[0131] Optionally, the earthwork volume calculation module is further configured to calculate, when the grid is a fill grid or a cut grid, a first elevation difference between the terrain elevation data and the building elevation data of any sampling point in the grid; if the first elevation difference is greater than zero, the product of the first elevation difference and the grid area is used as the cut volume of the grid; if the first elevation difference is less than zero, the product of the first elevation difference and the grid area is used as the fill volume of the grid.
[0132] Optionally, the earthwork volume calculation module is further configured to: calculate the horizontal projection distance between the grid and adjacent fill or cut grids when the grid is a slope grid; calculate the building elevation data of the grid based on the horizontal projection distance, slope ratio, and building elevation data of the adjacent fill or cut grids; calculate a second elevation difference between the topographic elevation data and the building elevation data of the grid; if the second elevation difference is greater than zero, determine the cut volume of the grid by multiplying the second elevation difference by the grid area; if the second elevation difference is less than zero, determine the fill volume of the grid by multiplying the second elevation difference by the grid area.
[0133] Optionally, the apparatus further includes: a secondary sampling module, used to generate a sub-grid structure of the boundary grid after the grid is determined as a boundary grid, using a second sampling precision; the second sampling precision is higher than the first sampling precision, and the sub-grid structure includes multiple sub-grids of the same size; for any sub-grid, the sub-grid is used as the grid, and the step of obtaining the elevation data of multiple sampling points in the grid is performed until the multiple sub-earthwork volumes corresponding one-to-one with the multiple sub-grids are merged to obtain the earthwork volume of the boundary grid.
[0134] The earthwork calculation device and the earthwork calculation method provided in the above embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0135] This application also provides a computer device for performing the above-described earthwork calculation method. Please refer to... Figure 4 This illustrates a schematic diagram of a computer device provided by some embodiments of this application. For example... Figure 4 As shown, the computer device 4 includes: a processor 400, a memory 401, a bus 402, and a communication interface 403. The processor 400, the communication interface 403, and the memory 401 are connected via the bus 402. The memory 401 stores a computer program that can run on the processor 400. When the processor 400 runs the computer program, it executes the earthwork calculation method provided in the foregoing embodiments of this application.
[0136] The memory 401 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 403 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network.
[0137] Bus 402 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory 401 is used to store programs. After receiving an execution instruction, the processor 400 executes the program. The earthwork calculation method disclosed in the foregoing embodiments can be applied to the processor 400, or implemented by the processor 400.
[0138] The processor 400 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 400 or by instructions in software form. The processor 400 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 401. The processor 400 reads the information in memory 401 and, in conjunction with its hardware, completes the steps of the above method.
[0139] The computer device provided in this application embodiment and the earthwork calculation method provided in this application embodiment are based on the same inventive concept and have the same beneficial effects as the methods they adopt, run or implement.
[0140] This application also provides a computer-readable storage medium corresponding to the earthwork calculation method provided in the foregoing embodiments. Please refer to... Figure 5 The computer-readable storage medium shown is an optical disc 30, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it executes the earthwork calculation method provided in any of the foregoing embodiments.
[0141] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.
[0142] The computer-readable storage medium provided in the above embodiments of this application and the earthwork calculation method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0143] It should be noted that:
[0144] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known structures and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0145] Similarly, it should be understood that, for the sake of brevity and to aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of this application, various features of this application are sometimes grouped together in a single embodiment, figure, or description thereof. However, this disclosure should not be construed as reflecting a schematic diagram in which the claimed application requires more features than expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.
[0146] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
[0147] The above description is merely a preferred embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for calculating earthwork volume, characterized in that, The method includes: A grid structure is constructed based on a terrain model and a building model; the grid structure comprises multiple grids of the same size. For any given grid, acquire elevation data for multiple sampling points within that grid; The grid type is determined based on the elevation data of the multiple sampling points; the grid type includes one of cut grid, fill grid, and slope grid. The earthwork volume of the grid is calculated based on the grid type, the elevation data of the multiple sampling points, and the grid area; the earthwork volume is either fill or excavation. The total earthwork volume is obtained by merging the earthwork volumes corresponding to multiple grids.
2. The method according to claim 1, characterized in that, The raster type of the grid is determined based on the elevation data of the multiple sampling points, including: For any of the plurality of sampling points, if the sampling point has terrain elevation data and building elevation data, and the terrain elevation data is less than the building elevation data, then the sampling point is determined to meet a first preset condition; if the sampling point has terrain elevation data and building elevation data, and the terrain elevation data is greater than the building elevation data, then the sampling point is determined to meet a second preset condition. When all of the multiple sampling points meet the first preset condition, the grid is determined to be a fill grid; When all of the multiple sampling points meet the second preset condition, the grid is determined as a cut grid.
3. The method according to claim 2, characterized in that, The grid types also include boundary grids and grids to be determined; Determining the raster type based on the elevation data of the multiple sampling points also includes: When some of the sampling points among the plurality of sampling points meet the first preset condition, or when some of the sampling points meet the second preset condition, the grid is determined as a boundary grid. The grid cells other than the fill grid cells, the cut grid cells, and the boundary grid cells are identified as grid cells to be judged.
4. The method according to claim 3, characterized in that, The grid to be determined includes fill slope grids and cut slope grids; After determining the raster to be judged, the method further includes: Using the grid cell to be determined as the center, search for nearby grid cells; If the adjacent grid of the grid to be determined is a fill grid, then the grid to be determined is determined as the fill slope grid; If the adjacent grid of the grid to be determined is a cut grid, then the grid to be determined is identified as the cut slope grid.
5. The method according to claim 2, characterized in that, The earthwork volume of the grid is calculated based on the grid type, the elevation data of the multiple sampling points, and the grid area, including: When the grid is a fill grid or a cut grid, calculate the first elevation difference between the terrain elevation data and the building elevation data of any sampling point in the grid; If the first elevation difference is greater than zero, the product of the first elevation difference and the grid area is used as the excavation volume of the grid. If the first elevation difference is less than zero, the product of the first elevation difference and the grid area is used as the fill volume of the grid.
6. The method according to claim 4, characterized in that, The slope grid includes embankment slope grids and cut slope grids; calculating the earthwork volume of the grid based on the grid type, the elevation data of the multiple sampling points, and the grid area also includes: When the grid is a slope grid, calculate the horizontal projected distance between the grid and the adjacent fill grid or cut grid; Calculate the building elevation data of the grid based on the horizontal projection distance, slope ratio, and building elevation data of the adjacent fill or cut grids; Calculate the second elevation difference between the terrain elevation data and the building elevation data of the grid; If the second elevation difference is greater than zero, the product of the second elevation difference and the grid area is determined as the excavation volume of the grid. If the second elevation difference is less than zero, the product of the second elevation difference and the grid area is determined as the fill volume of the grid.
7. The method according to claim 3, characterized in that, The plurality of identical grids are divided according to a first sampling precision; after determining the grids as boundary grids, the method further includes: The sub-grid structure of the boundary grid is generated using a second sampling precision; the second sampling precision is higher than the first sampling precision, and the sub-grid structure includes multiple sub-grids of the same size; For any sub-grid, the sub-grid is used as the grid, and the step of acquiring the elevation data of multiple sampling points in the grid is performed until the multiple sub-earthwork volumes corresponding one-to-one with the multiple sub-grids are merged to obtain the earthwork volume of the boundary grid.
8. An earthwork calculation device, characterized in that, The device includes: A grid structure building module is used to construct a grid structure based on a terrain model and a building model; the grid structure includes multiple grids of the same size. The elevation data acquisition module is used to acquire elevation data of multiple sampling points in any given grid. The grid type determination module is used to determine the grid type of the grid based on the elevation data of the multiple sampling points; the grid type includes one of cut grid, fill grid and slope grid; The earthwork volume calculation module is used to calculate the earthwork volume of the grid based on the grid type, the elevation data of the multiple sampling points, and the grid area; the earthwork volume is either fill volume or cut volume. The earthwork volume merging module is used to merge the earthwork volumes corresponding to multiple grids to obtain the total earthwork volume.
9. A computer device, characterized in that, include: A memory and a processor are interconnected, the memory storing computer instructions, and the processor executing the computer instructions to perform the earthwork calculation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the earthwork calculation method according to any one of claims 1 to 7.