A method for constructing a slope surface elevation model and a method for generating a three-dimensional terrain model

CN122618136APending Publication Date: 2026-08-21CHINA POWER CONSRTUCTION GRP GUIYANG SURVEY & DESIGN INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610755022.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-28
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

这一技术路线虽然能够实现基本的矢量到三维转换,但在处理复杂地形要素时存在明显不足

Benefits of technology

[0015]根据本发明,可以实现坡面高程的自动化计算,无需人工干预即可从矢量数据中提取坡面三维信息,显著提高了三维地形建模的效率;计算高程的方案保证了计算结果的几何一致性和空间准确性,且适用于大规模数据处理场景,并提高了三维模型的质量;构建三维地形模型的策略可以降低将焦点统计的时间复杂度,显著提升了大规模栅格数据的处理效率和质量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122618136A_ABST
    Figure CN122618136A_ABST
Patent Text Reader

Abstract

The present application relates to the application field of geographic information system data processing and three-dimensional modeling technology, and discloses a slope elevation model construction method and a three-dimensional terrain model generation method, comprising: acquiring vector data containing plane elements and slope elements; determining the adjacency relationship between the slope elements and the plane elements; structuring the adjacency relationship to generate a CSR structure; constructing a constraint point set based on the intersection geometry of each slope element and the adjacent plane element, the constraint point set including intersection endpoints or envelope supplement points; the elevation value of the constraint point is the elevation attribute value of the corresponding adjacent plane element; solving the slope elevation model according to the continuity constraint to generate a slope elevation raster file; merging the plane elevation raster and the slope elevation raster to obtain a composite raster, and outputting a three-dimensional model file. According to the above technical scheme, the automatic calculation of the slope elevation can be realized, the efficiency of three-dimensional terrain modeling is improved, and the geometric consistency and spatial accuracy of the calculation result are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the application of geographic information system data processing and 3D modeling technology, specifically to a method for constructing a slope elevation model and a method for generating a 3D terrain model. Background Technology

[0002] With the rapid development of technologies such as smart cities, digital twins, and virtual reality, the demand for constructing 3D geographic information models is increasing. Traditional GIS data is mainly in 2D vector format, while applications such as 3D visualization, simulation analysis, and game engines require 3D model data. How to efficiently and accurately convert 2D GIS data into 3D models has become a significant technical challenge for the geographic information industry.

[0003] To achieve this goal, the common approach to generating terrain / FBX from SHP is to first rasterize the vector data and then convert the raster data into a three-dimensional mesh model. Although this technical approach can achieve basic vector-to-three-dimensional conversion, it has obvious shortcomings when dealing with complex terrain features. Specifically, it is reflected in the following aspects: (1) The problem of missing elevation of slope features: In actual GIS data, planar features usually have clear elevation attribute values, while slope features (such as slopes, embankments, riverbanks, etc.) often only record boundary geometric information and lack internal elevation data. Therefore, it is necessary to manually measure or estimate the slope elevation based on experience, which has problems such as large workload, low accuracy, and poor efficiency, which seriously restricts the automatic generation of three-dimensional terrain models; (2) The problem of boundary continuity: Slope features and adjacent planar features need to maintain elevation continuity or minimize gaps at the shared boundary. Direct interpolation or simple assignment is easy to achieve. (2) Steps, gaps and discontinuities are generated, affecting the quality and usability of the 3D model; (3) Large-scale data processing efficiency problem: With the advancement of remote sensing technology and surveying methods, the resolution and coverage of geographic data are constantly improving. The amount of single raster data can reach several GB or even tens of GB. The traditional full loading processing method not only occupies a lot of memory resources, but may also lead to excessive processing time or even system crash; (4) Topological adjacency construction efficiency problem: In large-scale data scenarios, the number of geometric predicate calls during the topological adjacency construction process increases exponentially, resulting in low computational efficiency and high resource consumption. (5) Coordinate system transformation accuracy problem: GIS data usually adopts a projected coordinate system, while 3D visualization tools usually adopt a geographic coordinate system or a local coordinate system; there is an accuracy loss during the coordinate system transformation process, especially for large-scale, high-precision geographic data, the transformation error may lead to spatial position deviation of the 3D model.

[0004] Therefore, a technical solution is needed that can automatically calculate slope elevation while ensuring the elevation continuity between the slope and adjacent planes at shared boundaries, and support efficient processing of large-scale data and accurate export of three-dimensional terrain models. Summary of the Invention

[0005] To achieve the above objectives, this application provides a method for constructing a slope elevation model, comprising the following steps: Obtain vector data containing both planar and slope features; where planar features have elevation attribute values, while slope features lack elevation attribute values. Determine the adjacency relationship between slope features and planar features; The adjacency relationships are structured to generate the CSR structure; A set of constraint points is constructed based on the boundary geometry between each slope feature and its adjacent plane features. The set of constraint points includes the endpoints of the intersection line or the envelope complement points. The elevation values ​​of the constraint points are the elevation attribute values ​​of the corresponding adjacent plane features. The slope elevation model is solved based on the continuity constraint. The slope elevation model is a mathematical expression that describes the elevation distribution inside the slope elements. The slope elevation model includes a planar model, a curved surface model, or a piecewise model. Generating a slope elevation raster file includes: traversing the cell center points within the envelope of the slope features, calculating the elevation based on the slope elevation model, writing the cell center points falling within the slope features into the raster buffer, and outputting the slope elevation raster file.

[0006] The adjacency relationships include: adjacent, connected, contained, and non-adjacent; adjacent means that the slope and the plane have one or more common points, and connected means that the slope and the plane have one or more common edges; the confirmation of the adjacency relationship is achieved through a two-stage screening strategy; the two-stage screening strategy means: first, judging whether the two face features intersect based on their envelopes; then, calculating the geometric predicate to determine whether the two face features share edges and contain each other.

[0007] Furthermore, the two-stage screening strategy includes a first stage and a second stage; The first stage involves rough screening of the envelope, including determining whether the spatial envelopes of slope features and planar features intersect; wherein, the envelope of the slope feature is represented as... The envelope of a planar feature is The rule for determining the intersection of two objects is: only if... , , and When intersecting; The second stage involves geometric predicate determination, which includes: for element pairs that were identified as relevant in the first stage coarse screening, if the conditions of the geometric predicate are met, the actual adjacency relationship can be confirmed.

[0008] The geometric predicates include: adjacency, containment, and intersection; adjacency refers to the length of the shared edge segment between two elements being greater than a threshold; when determining adjacency, the boundary segment is extracted and the length of the shared edge is calculated. ,when Adjacency is determined when the slope feature is included by the planar feature; inclusion refers to the slope feature's envelope being included by the planar feature; when inclusion is determined, it is when... Completely located Inner and and When they do not intersect, they are considered to be adjacent; when they intersect, the area of ​​their intersection is greater than a threshold.

[0009] The CSR structure includes an offset array. and adjacency index array The offset array has a length of N+1, and the adjacency index array has a length of M. Storage number The adjacency relationship of individual slope features The starting index in This refers to the number of adjacent planes of the slope feature.

[0010] Furthermore, the endpoints of the intersection line are first-level constraint points; first-level constraint points need to meet the requirements for solving the slope elevation model. The requirements for solving the slope elevation model include: the number of non-collinear first-order constraint points is greater than or equal to three; If the primary constraint points do not meet the requirements, the point supplementation mechanism is triggered. The point supplementation mechanism refers to uniformly sampling according to the envelope corner points or boundary of the slope feature to generate secondary constraint points, and assigning the elevation attribute value of the nearest adjacent plane feature to the elevation value of the supplemented point.

[0011] Furthermore, the implementation methods of continuity constraints include: hard constraint method and penalty term method; where hard constraint method refers to: using shared boundary constraint points as hard constraints in the solution; penalty term method refers to: adding a boundary elevation deviation penalty term to the least squares objective function to minimize the elevation gap at the shared boundary.

[0012] Furthermore, in the process of solving the slope elevation model, when a slope feature is adjacent to multiple plane features and their elevation attribute values ​​conflict, the constraint points of different adjacent plane features are assigned weights according to the shared boundary length, distance, or data reliability to participate in the solution; this includes using robust estimation to remove abnormal constraint points; when robust estimation fails, it reverts to determining the slope model based on the main adjacent plane features or using regularization terms to stabilize the solution.

[0013] On the other hand, the present invention provides a method for generating a three-dimensional terrain model, based on the slope elevation model provided by the present invention, including the following steps: Raster merging and denoising processing includes: merging plane elevation rasters and slope elevation rasters to obtain a composite raster; performing focal statistical denoising on the composite raster; and calculating the minimum value excluding the center pixel within a 5×5 or 3×3 neighborhood as the output pixel value. During denoising, a two-stage strategy is used for boundary regions. This two-stage strategy includes a first stage and a second stage. The first stage involves constructing a monotonic queue in the horizontal direction to extract the minimum value from the horizontal neighborhood and outputting an intermediate buffer matrix. The second stage refers to the stage based on the intermediate buffer matrix. Perform column-direction sliding window minimum filtering, fuse the four-way strip minimums, and output the final denoised raster. ; Furthermore, after performing a double-step reprojection on the raster, a triangular mesh is generated according to the sampling step size, and the 3D model file is output in ENU local coordinates.

[0014] In the noise reduction process, a streaming block processing mechanism is used for large-scale raster data, including dividing the raster into several... Each Expand outward Pixel formation Region; During the first stage of processing, load the data for this row, each Horizontal calculations are performed independently; during the second stage of processing, each... Data from the top and bottom rows needs to be loaded to perform vertical calculations.

[0015] According to the present invention, the calculation of slope elevation can be automated, and the three-dimensional information of slope can be extracted from vector data without manual intervention, which significantly improves the efficiency of three-dimensional terrain modeling. The elevation calculation scheme ensures the geometric consistency and spatial accuracy of the calculation results, and is applicable to large-scale data processing scenarios, and improves the quality of the three-dimensional model. The strategy for constructing the three-dimensional terrain model can reduce the time complexity of focus statistics, which significantly improves the processing efficiency and quality of large-scale raster data. Attached Figure Description

[0016] Figure 1 This is a step diagram illustrating the method for constructing a slope elevation model and generating a three-dimensional terrain model according to an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the process of determining the adjacency relationship between slope features and planar features according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a CSR structure provided according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a streaming block processing mechanism provided in an embodiment of the present invention; Figure 5This is a schematic diagram of the slope surface GeoTIFF result output from the slope elevation model provided in the embodiment of the present invention; Figure 6 This is a schematic diagram of the output FBX three-dimensional model provided according to an embodiment of the present invention. Detailed Implementation

[0017] The specific implementation of the present invention will now be described in detail with reference to the accompanying drawings.

[0018] Figure 1 The present invention provides steps for constructing a slope elevation model and generating a three-dimensional terrain model according to the method thereof; such as Figure 1 As shown, constructing a slope elevation model includes the following steps: Step S100: Obtain vector data containing planar features and slope features; The SHP vector data obtained in this step includes planar features with valid elevation attribute values ​​and the ability to output planar elevation rasters, while slope features lack elevation attribute values.

[0019] Slope features are either missing or labeled as slopes and have one or more of the following characteristics: 1) An elevation attribute value of 0 or close to 0 indicates that elevation data is missing or has not been assigned. 2) An elevation attribute value of null or empty indicates that elevation data is missing; 3) If the elevation attribute value falls within the preset abnormal range, it indicates that the elevation data is abnormal; 4) The elevation attribute field contains a specific identifier, such as the type field being "slope" or "incline"; 5) The slope element is a directly specified element.

[0020] This type of vector data can provide target objects for subsequent topology construction and elevation calculations.

[0021] Step S110: Construct a slope elevation model and generate a slope elevation raster file; specifically including the following steps: Step S111: Determine the adjacency relationship between slope features and planar features; In the field of civil engineering, an area typically contains many slopes and planes, and the elevation value of a slope can be calculated based on the elevation values ​​of the surrounding planes. Therefore, it is necessary to construct the topological relationship between slopes and planes to determine the planes surrounding the slope features.

[0022] The adjacency relationships in this step include: adjacent (i.e., the slope and the plane have one or more common points), connected (i.e., the slope and the plane have one or more common edges), contained, and not adjacent.

[0023] To effectively determine the adjacency relationship between slopes and other planar features, this invention employs a two-stage screening strategy. First, it determines whether two planar features intersect based on their bounding boxes (minimum enclosing rectangles). If the bounding boxes of two planar features do not intersect, then these two planar features will definitely not intersect. Then, it calculates geometric predicates to determine whether two planar features share edges and whether they contain each other. The specific implementation is as follows: Figure 2 As shown, the details are as follows: The first stage involves rough screening of the envelope, which means quickly screening potential adjacent features by determining whether the spatial envelopes of slope features and planar features intersect. Among them, slope elements The envelope is represented as planar elements The envelope is The rule for determining the intersection of the two is: only if... , , and When determining intersection; determine the slope elements that intersect. With planar elements Constituent elements pair.

[0024] Envelope screening can significantly reduce the number of elements that require precise judgment.

[0025] The second stage involves geometric predicate determination. That is, for element pairs that are identified as relevant in the first stage coarse screening, the actual adjacency relationship can be confirmed if the geometric predicate conditions are met.

[0026] Among them, geometric predicates include: adjacency, containment, and intersection: 1) Adjacency refers to two elements whose shared edge segment length is greater than a threshold; when determining adjacency: extract the boundary segment and calculate the shared edge length. ,when Adjacency is determined by the meter. 2) Inclusion refers to the slope feature being included by the planar feature; when determining inclusion, when... Completely located Inner and and If they do not intersect, they are considered to be inclusive and adjacent. 3) Intersection refers to the area of ​​intersection between two objects being greater than the threshold.

[0027] This two-stage screening strategy can significantly reduce the number of geometric predicate calls and improve processing efficiency. Through this step, the spatial relationship between the slope and adjacent planes can be established, providing a data foundation for subsequent boundary point collection and plane fitting.

[0028] Step S112: Structure the adjacency relationships to generate the CSR structure; In this step, the data structure for determining adjacency relationships is specified. In this invention, adjacency relationships are stored using a CSR (Compressed Sparse Row) structure. The CSR structure includes an offset array. and adjacency index array This enables zero-copy queries of adjacent planar features for any slope feature. The offset array has a length of N+1, and the adjacency index array has a length of M (M being the total number of adjacency relationships). Storage number The adjacency relationship of individual slope features The starting index in This represents the number of adjacent planes for that slope feature. Using this structure, you can query the... The time complexity of all adjacent planes of the slope is . ,in The number of adjacencies is O(n), and the space complexity is O(n). .like Figure 3 As shown, the adjacency lines between S1-S4 and P1-P7 demonstrate the adjacency relationship, and the positions of non-zero elements are marked by a 4×7 adjacency matrix; and in the storage structure, the specific values ​​and meanings of the row_ptr and col_idx arrays can be seen.

[0029] The CSR structure provides a compact storage method for adjacency relationships and supports... It offers adjacency lookup with minimal time complexity, while reducing memory usage and improving cache hit rate. Furthermore, the CSR storage format is particularly suitable for scenarios with sparse adjacency relationships, which can significantly improve the processing efficiency of large-scale data.

[0030] Step S113: Construct a set of constraint points based on the boundary geometry of each slope feature and adjacent plane features. The set of constraint points includes intersection endpoints or envelope complements. The elevation values ​​of the constraint points are the elevation attribute values ​​of the corresponding adjacent plane features.

[0031] Specifically, the endpoints of the intersection lines between slope features and adjacent plane features are extracted as first-level constraint points, and the first-level constraint points need to meet the requirements for solving the slope elevation model; the requirements for solving the slope elevation model include: the number of non-collinear first-level constraint points is greater than or equal to three.

[0032] If the endpoints of the intersection do not meet the requirements, the point supplementation mechanism is triggered. The point supplementation mechanism involves uniformly sampling the envelope corners or boundaries of the slope features at fixed steps to generate secondary constraint points, and assigning the elevation attribute value of the nearest neighboring plane feature to the supplemented point. This mechanism ensures that plane fitting can be completed even if there are insufficient intersection points.

[0033] The constraint points collected in this step on the slope boundary, and the elevation values ​​of these points can be obtained through adjacent planes, serve as constraint conditions for solving the slope plane equation.

[0034] Step S114: Solve the slope elevation model based on the continuity constraints.

[0035] A slope elevation model is a mathematical expression that describes the elevation distribution within slope features. This mathematical expression can be determined based on the geometric characteristics of the slope features and the distribution of constraint point sets, including but not limited to planar models, curved surface models, or segmented models.

[0036] Specifically, the implementation methods of continuity constraints include: hard constraint method and penalty term method; hard constraint method refers to: using shared boundary constraint points as hard constraints in the solution, that is, the elevation value of the constraint points remains unchanged in the solution process; penalty term method refers to: adding a boundary elevation deviation penalty term to the least squares objective function to minimize the elevation gap at the shared boundary.

[0037] During the solution process, when a slope feature is adjacent to multiple planar features and their elevation attribute values ​​conflict, the constraint points of different adjacent planar features are weighted according to the shared boundary length, distance, or data reliability to participate in the solution. To improve the robustness of the solution, robust estimation is used to remove abnormal constraint points. When robust estimation fails, the solution reverts to determining the slope model based on the primary adjacent planar features or using regularization terms to stabilize the solution.

[0038] In solving the slope elevation model, continuity constraints are used to ensure the elevation consistency between the slope and adjacent planes at the boundary, eliminating steps and gaps. Robust estimation and backoff strategies improve the stability and applicability of the method.

[0039] Step S115: Generate a slope elevation raster file based on the slope elevation model.

[0040] Specifically, the process iterates through the center points of pixels within the envelope of the slope features, calculates the elevation based on the slope elevation model, and writes the center points of pixels falling within the slope features into the raster buffer, outputting a slope elevation raster file. The cell size of the slope elevation raster is calculated from the maximum side length of the slope features and a preset upper limit resolution; the cell size is used to limit the raster size from exceeding a threshold. Specifically, cell size = maximum side length / 4096, ensuring a moderate raster resolution that guarantees both accuracy and data volume. In this step, only pixels within the slope envelope are traversed, reducing unnecessary calculations and improving processing efficiency.

[0041] This invention provides Embodiment 1, which provides a method for outputting GeoTIFF format raster files: 1) First, obtain a Shapefile containing planar features and slope features. The planar features have valid elevation attribute values, while the slope features have elevation attribute values ​​of null or 0. In this step, features whose elevation attribute values ​​meet the preset conditions are identified as slope candidates, and N slope features are identified. 2) For each slope feature, establish the adjacency relationship with adjacent planar features through envelope frame coarse screening and geometric predicate determination; 3) Store the adjacency relationships in CSR format, and construct the row_ptr and col_idx arrays; 4) For each slope feature, collect the coordinates of the boundary points with adjacent planar features, and perform envelope point supplementation if necessary; 5) Based on the boundary constraint points, the least squares method is used to fit the plane equation and solve the slope elevation model; the center points of pixels within the slope envelope are traversed, and their affiliation is confirmed by the Contains property. The elevation values ​​are then calculated according to the plane equation; finally, a GeoTIFF format slope elevation raster file is output; such as Figure 4 As shown, in the output slope elevation raster file, each cell stores the calculated elevation value, maintaining elevation continuity with adjacent planar features at the boundary.

[0042] At this point, the slope elevation calculation has been completed, and the slope elevation model has been converted into a raster format for easy merging with the plane elevation raster and subsequent processing.

[0043] Based on the slope elevation model provided by this invention and the generation of slope elevation raster files, this invention also provides a method for generating three-dimensional terrain models.

[0044] Generating a 3D terrain model specifically includes the following steps: Step S101: Output a plane elevation raster using vector data.

[0045] Step S120: Merge the planar elevation grid with the slope elevation grid output in step S110, and process the data to generate a 3D terrain model. This specifically includes the following steps: Step S121: Raster merging and noise reduction; Specifically, the plane elevation grid and the slope elevation grid are merged to obtain a composite grid. Then, focus statistical denoising is performed on the composite grid, and the minimum value of excluding the center cell is calculated in the 5×5 (3×3) neighborhood as the output cell value.

[0046] First, a denoising kernel function is defined using a 5×5 or 3×3 square sliding window, expressed as: ,in, Therefore A neighborhood window centered on the center; This indicates that the center pixel itself is excluded; Indicates the first in the output raster. line, number The new elevation values ​​of the pixels after denoising; This indicates that in the input raster, the position located at the th line, number Elevation values ​​of the column pixels.

[0047] When merging raster, establish numerical mapping rules: map NoData values, NaN values, or outliers outside the effective elevation range in the input raster to positive infinity (+inf) to ensure that they are automatically ignored in the minimum value calculation and avoid invalid values ​​from polluting the denoising results.

[0048] For boundary regions, a two-stage strategy is adopted, using a horizontal-vertical separation computation architecture to reduce time complexity: The first stage constructs a monotonic queue in the horizontal direction: the system scans the synthesized elevation raster row by row, maintaining a double-ended queue for each row. This queue stores tuples of the form (column index, elevation value), and internally maintains strict ascending monotonicity according to the elevation values. When the sliding window moves to the right and a new cell enters the right boundary of the window, the algorithm removes historical records with elevation values ​​not less than the new cell from the tail of the queue, ensuring that the front of the queue always corresponds to the minimum value within the current window. Simultaneously, it checks whether the column index of the head element has slid out of the left boundary of the window; if expired, it is immediately popped from the head of the queue. When the window center aligns with the cell to be processed, the elevation value of the head element is the minimum value of its horizontal neighborhood (excluding the center), and this result is written to the corresponding position in the intermediate buffer matrix.

[0049] The output at this stage is an intermediate buffer matrix. , as the input for the second stage.

[0050] The second stage is based on an intermediate buffer matrix in the vertical direction. Construct a monotonic queue and repeat similar monotonic queue operations along the column direction. However, the core task is not only to find the minimum value in the column direction, but also to use the minimum value information of the row that has been completed in the horizontal stage to indirectly achieve the constraint of strictly excluding the center cell within the complete 5×5 window by maintaining the minimum values ​​of the strips in the four directions of top, bottom, left and right and taking their minimum values.

[0051] The output at this stage is the final denoised raster. Each cell value All meet This means that the data must come from the neighborhood, not the center. The second stage reduces the time complexity from O(n×m×k×k) to O(n×m); it also skips the center cell and maps NoData or NaN to positive infinity to ignore invalid cells.

[0052] For large-scale raster data (single file > 1G), a streaming chunking mechanism is used: such as Figure 4 As shown, the grid is divided into several (Default 1024×1024 pixels), each Expand outward Pixels (formed by the radius of the sliding window) Region; During the first stage of processing, only the data in this row needs to be loaded, each Horizontal calculations are performed independently; during the second stage of processing, each... Data from the top and bottom rows needs to be loaded to perform vertical calculations.

[0053] This step can smooth out abnormal elevation values ​​in raster data, improve the quality of 3D models, and reduce time complexity through a monotonic queue algorithm, thus significantly improving processing efficiency.

[0054] Step S122: Perform coordinate transformation and output the 3D model file; This step performs a two-step reprojection on the final raster, generates a triangular mesh according to the sampling step size, and outputs a 3D model file in ENU local coordinates. The two-step reprojection includes: first transforming the raster from the source coordinate system to the CGCS2000 geographic coordinate system, and then transforming it from CGCS2000 to the target coordinate system (WGS84 by default).

[0055] ENU local coordinates are calculated using the LLA→ECEF→ENU rotation and translation matrix. By using a preset center point as the origin, numerical instability caused by large coordinates can be eliminated. When outputting the 3D model file, WKT and GeoTransform of CRS are written as custom attributes, and a .prj file is generated to support the reversible recovery of geographic coordinate semantics from local coordinates.

[0056] In this step, while ensuring the accuracy and numerical stability of coordinate system transformation, the raster data is converted into a 3D model format. ENU local coordinates eliminate the impact of large coordinate values ​​on the numerical stability of 3D tools, and metadata encapsulation preserves the original georeferenced information.

[0057] This invention provides Embodiment 2, which provides a method for outputting an FBX 3D model: 1) Obtain a Shapefile containing planar features and slope features, and generate a slope elevation raster file through step S110; 2) Perform focus statistics denoising (5×5 neighborhood, excluding the central minimum value) on the plane elevation raster and slope elevation raster directly output from the Shapefile file to generate the final raster file; 3) Perform double-step reprojection (CGCS2000→WGS84) to generate a triangular mesh according to the sampling step size; 4) Calculate the local coordinates of ENU with the center point of the grid as the origin; 5) Output FBX file, along with CRS WKT and GeoTransform metadata, and also output .prj sidecar file.

[0058] like Figure 5 As shown, the output FBX 3D model file contains a terrain triangular mesh, which can be used directly in 3D visualization tools. The FBX 3D model has correct spatial reference information and supports bidirectional conversion between geographic coordinates and local coordinates.

[0059] In summary, this invention employs a unique combination of technologies including slope identification, topology construction, CSR storage, boundary constraint point construction, and continuity constraint solving to achieve automated calculation of slope elevation. It extracts 3D slope information from vector data without manual intervention, significantly improving the efficiency of 3D terrain modeling. Furthermore, it obtains boundary points through topological adjacency relationships and calculates elevations using plane fitting methods, ensuring geometric consistency and spatial accuracy of the calculation results. The application of the CSR storage format supports efficient adjacency queries, suitable for large-scale data processing scenarios. Boundary continuity constraints eliminate steps and gaps at the intersection of slopes and planes, improving the quality of the 3D model. On the other hand, a two-stage monotonic queue sliding window algorithm is used for denoising during the construction of the 3D terrain model, reducing the time complexity of focus point statistics and significantly improving the processing efficiency of large-scale raster data. The monotonic queue algorithm ensures the correctness of the minimum value of the sliding window while avoiding redundant calculations. The invalid value mapping mechanism ensures the robustness of the processing results.

[0060] The above-disclosed embodiments are merely a few specific examples of the present invention. However, the present invention is not limited thereto, and any variations that can be conceived by those skilled in the art should fall within the protection scope of the present invention.

Claims

1. A method for constructing a slope elevation model, characterized in that, Includes the following steps: Obtain vector data containing planar features and slope features; wherein the planar features have elevation attribute values, while the slope features lack elevation attribute values; Determine the adjacency relationship between slope features and planar features; The adjacency relationships are structured to generate the CSR structure; A set of constraint points is constructed based on the boundary geometry between each slope feature and its adjacent plane features. The set of constraint points includes intersection endpoints or envelope complements. The elevation values ​​of the constraint points are the elevation attribute values ​​of the corresponding adjacent plane features. The slope elevation model is solved based on continuity constraints. The slope elevation model is a mathematical expression describing the elevation distribution within the slope elements. The slope elevation model includes a planar model, a curved surface model, or a piecewise model. Generating a slope elevation raster file includes: traversing the cell center points within the envelope of the slope features, calculating the elevation based on the slope elevation model, writing the cell center points falling within the slope features into the raster buffer, and outputting the slope elevation raster file.

2. The method for constructing a slope elevation model according to claim 1, characterized in that, The adjacency relationships include: adjacent, contiguous, containment, and non-adjacent; Among them, "adjacent" means that the slope and the plane have one or more common points, and "connected" means that the slope and the plane have one or more common edges. The adjacency relationship is confirmed through a two-stage screening strategy. The two-stage screening strategy refers to: first, determining whether the two facets intersect based on their envelopes; then, calculating the geometric predicate to determine whether the two facets share edges and whether they contain each other.

3. The method for constructing a slope elevation model according to claim 2, characterized in that, The two-stage screening strategy includes a first stage and a second stage; The first stage involves rough screening of the envelope, including: determining whether the spatial envelopes of the slope feature and the planar feature intersect; wherein, the envelope of the slope feature is represented as... The envelope of a planar feature is The rule for determining the intersection of two objects is: only if... , , and When intersecting; The second stage involves geometric predicate determination, which includes: for element pairs that have been coarsely screened and determined to be related in the first stage, if the conditions of geometric predicate are met, the actual adjacency relationship can be confirmed.

4. The method for constructing a slope elevation model according to claim 3, characterized in that, The geometric predicates include: adjacency, containment, and intersection; The term "adjacency" refers to two elements whose shared edge segment length is greater than a threshold. When determining adjacency, boundary segments are extracted, and the shared edge length is calculated. ,when Adjacency determination is performed at that time; The inclusion refers to the slope feature envelope being included by the planar feature; when determining inclusion, when Completely located Inner and and If they do not intersect, they are considered to be inclusive and adjacent. The term "intersection" refers to the intersection area of ​​two objects being greater than a threshold.

5. The method for constructing a slope elevation model according to claim 1, characterized in that, The CSR structure includes an offset array. and adjacency index array ; The length of the offset array is N+1, and the length of the adjacency index array is M. Storage number The adjacency relationship of individual slope features The starting index in This refers to the number of adjacent planes of the slope feature.

6. The method for constructing a slope elevation model according to claim 1, characterized in that, The endpoints of the intersection line are primary constraint points; these primary constraint points must meet the requirements for solving the slope elevation model. The requirements for solving the slope elevation model include: the number of non-collinear first-level constraint points is greater than or equal to three; If the first-level constraint point does not meet the requirements, the point supplementation mechanism is triggered; The point supplementation mechanism refers to: uniformly sampling according to the envelope corner points or boundaries of the slope features to supplement points, generating secondary constraint points, and assigning the elevation attribute value of the nearest neighboring plane feature to the elevation value of the supplemented point.

7. The method for constructing a slope elevation model according to claim 1, characterized in that, The continuity constraints can be implemented in two ways: hard constraint and penalty term. The hard constraint method refers to using shared boundary constraint points as hard constraints in the solution process. The penalty term refers to adding a boundary elevation deviation penalty term to the least squares objective function to minimize the elevation gap at the shared boundary.

8. The method for constructing a slope elevation model according to claim 1, characterized in that, In the process of solving the slope elevation model, when a slope feature is adjacent to multiple plane features and their elevation attribute values ​​conflict, the constraint points of different adjacent plane features are assigned weights according to the shared boundary length, distance or data reliability to participate in the solution. This includes using robust estimation to remove outlier constraint points; When robust estimation fails, the fallback is to determine the slope model based on the primary adjacent plane features or to use regularization terms for stable solution.

9. A method for generating a three-dimensional terrain model, characterized in that, Based on the slope elevation model as described in claims 1 to 8, the implementation includes the following steps: Raster merging and denoising processing includes: merging plane elevation rasters and slope elevation rasters to obtain a composite raster; performing focal statistical denoising on the composite raster; and calculating the minimum value excluding the center pixel within a 5×5 or 3×3 neighborhood as the output pixel value. During denoising, a two-stage strategy is used for boundary regions. This two-stage strategy includes a first stage and a second stage. The first stage involves constructing a monotonic queue in the horizontal direction to extract the minimum value from the horizontal neighborhood and outputting an intermediate buffer matrix. The second stage refers to the stage based on the intermediate buffer matrix. Perform column-direction sliding window minimum filtering, fuse the four-way strip minimums, and output the final denoised raster. ; After performing a two-step reprojection on the raster, a triangular mesh is generated according to the sampling step size, and the 3D model file is output in ENU local coordinates.

10. The method for generating a three-dimensional terrain model according to claim 9, characterized in that, The denoising process employs a streaming block processing mechanism for large-scale raster data, including dividing the raster into several... Each Expand outward Pixel formation Region; During the first stage of processing, load the data for this row, each Horizontal calculations are performed independently; during the second stage of processing, each... Data from the top and bottom rows needs to be loaded to perform vertical calculations.