Volume shadow based dem visibility analysis method and system
By transforming DEM view-through analysis into a volumetric shading problem, and employing a regularized triangular mesh model and a scanline early exit mechanism, the problems of error and low efficiency in DEM view-through analysis are solved, achieving efficient and accurate DEM view-through analysis.
Patent Information
- Application Number
- CN202511572642.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-10-30
AI Technical Summary
Existing DEM line-of-sight analysis algorithms exhibit significant errors in occlusion points when dealing with terrain slopes and line-of-sight angles that are very small, and their computational efficiency is low.
The DEM viewpoint analysis problem is transformed into a volume shadow problem where the viewpoint equals the light source. By leveraging the interpolation characteristics of DEM data and the GIS platform for terrain, a regularized triangular mesh model is adopted. The connection relationship is dynamically obtained through coordinate deduction, simplifying the calculation and introducing an early exit mechanism for scan lines to optimize the calculation path.
It achieves accurate DEM through-view analysis, with a computation speed close to that of approximation algorithms, reduces memory usage, improves the efficiency of large-scale terrain analysis, can handle complex terrain features, and reduces redundant calculations.
Smart Images

Figure CN121033333B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of visual domain analysis of digital elevation model, and particularly relates to a DEM visual domain analysis method and system based on volume shadow. BACKGROUND
[0002] DEM (Digital Elevation Model) is a kind of solid ground model which represents the ground elevation in the form of a set of ordered numerical arrays, and is a branch of Digital Terrain Model (DTM). Generally, DTM is a spatial distribution of linear and nonlinear combinations of various geomorphic factors including elevation, such as slope, aspect, and slope change rate, etc. DEM is a zero-order simple single digital geomorphic model, and other geomorphic characteristics such as slope, aspect, and slope change rate can be derived based on DEM.
[0003] There are various methods to establish DEM. From the data source and collection method, there are: (1) directly from ground measurement, such as using GPS, total station, field measurement, etc.; according to aerial or space images, through photogrammetric approach to obtain, such as stereocomparator observation and aerial triangulation, analytical mapping, digital photogrammetry, etc.; (3) from existing topographic map, such as grid reading method, digitizer hand tracking and scanner semi-automatic collection and then generating DEM through interpolation method, etc. There are many DEM interpolation methods, mainly including block interpolation, partial interpolation and single point surface interpolation. The commonly used algorithm is to establish a triangular irregular network (TIN) through contour lines and elevation points. Then DEM is built through linear and bilinear interpolation based on TIN.
[0004] Since DEM describes the ground elevation information, it has a wide range of applications in surveying and mapping, hydrology, meteorology, geomorphology, geology, soil, engineering construction, communication, meteorology, military and other fields of national economy and national defense construction as well as human and natural sciences. For example, in engineering construction, it can be used for earthwork calculation, visual analysis, etc.; in flood control and disaster reduction, DEM is the basis for hydrological analysis such as catchment analysis, water system network analysis, rainfall analysis, flood storage calculation, inundation analysis, etc.; in wireless communication, it can be used for base station analysis of cellular phones, etc.
[0005] The existing DEM visual domain analysis algorithm is divided into accurate algorithm and approximate algorithm. Among them:
[0006] The accurate algorithm, such as R3, calculates the influence of each grid line through which the line of sight passes on the visual, which is high in accuracy but large in calculation amount and low in efficiency.
[0007] Approximation algorithms such as R2, XDraw and the like have fast calculation speed, but errors are inevitable due to the fact that all grid lines affecting the visibility are not considered during the calculation.
[0008] In addition, the visibility algorithm based on PDERL spatial reference line newly appeared in recent years realizes the precision comparable to R3 and the operation speed close to that of the approximation algorithm.
[0009] The above algorithms are all based on DEM grid and regard the terrain as a ladder, and cannot consider the case that the GIS platform produces an inclined surface during the interpolation processing of the terrain, especially in the case that the angle between the terrain slope and the line of sight is very small, and the shielding point will have obvious error. SUMMARY
[0010] In order to make up for the above shortcomings, the present application provides a DEM visibility analysis method and system based on volume shadow, aiming at improving the problem in the prior art that the terrain is regarded as a ladder based on DEM grid, and the case that the GIS platform produces an inclined surface during the interpolation processing of the terrain cannot be considered, especially in the case that the angle between the terrain slope and the line of sight is very small, and the shielding point will have obvious error.
[0011] In a first aspect, the present application provides the following technical scheme, a DEM visibility analysis method based on volume shadow, comprising the following steps:
[0012] S1, obtaining digital elevation model (DEM) data and a user inputted view point parameter, and constructing a regular triangulation model based on the DEM data;
[0013] S2, calculating the sun and shade attributes of each triangular face based on the view point parameter, and determining the shielding edge according to the sun and shade attributes of the adjacent triangular faces and the horizontal distance to the view point;
[0014] S3, precalculating the position slope of each grid in the analysis area based on the DEM data and the view point parameter, and generating a terrain slope field;
[0015] S4, determining the shielding area defined by each shielding edge and the view point;
[0016] S5, generating a plurality of scanning lines in the shielding area, and covering the shielding area row by row or column by column;
[0017] S6, calculating the terrain slope of each point and the critical slope of the shielding edge on each scanning line, judging the visibility of each point based on the slope comparison result, and terminating the subsequent scanning of the shielding area in advance when the entire scanning line meets the visibility condition;
[0018] S7, integrating the visibility judgment results of all shielding edges, and generating a final visibility analysis graph.
[0019] By adopting the above technical scheme: the DEM viewshed analysis problem is converted into a volume shadow problem with a viewpoint equal to a light source, the interpolation processing of the terrain by the DEM data and the GIS platform is neat and standard, the calculation related to the volume shadow is simplified, the operation speed of the approximate algorithm is approached, meanwhile, the slope generated by the interpolation processing of the terrain can be considered, the regular triangular mesh model is adopted, the connection relationship can be dynamically obtained by coordinate calculation, the huge topological connection table does not need to be stored explicitly, the memory occupation is significantly reduced, meanwhile, the model and the pre-calculated geometric data can be repeatedly used in the multi-viewpoint analysis of the same area, so that the data reading and model construction do not need to be repeatedly performed when the multi-viewpoint analysis or the viewpoint moving analysis is performed, the efficiency of the regional-level analysis is improved, the early exit mechanism based on the scanning line is introduced in the visibility judgment process, when it is detected that all the points on a scanning line satisfy the visibility condition, the subsequent scanning line calculation in the shielding area is automatically skipped, the spatial continuity feature of the terrain visibility is effectively utilized, the calculation path is automatically optimized for the continuous visible area, under the premise of ensuring the complete accuracy of the result, the redundant calculation is significantly reduced, so that the algorithm has a better time complexity when processing large-scale terrain.
[0020] Preferably, the S1 specifically comprises:
[0021] The DEM grid cells are triangulated in the northwest and southeast directions to generate two triangular faces;
[0022] The northwest corner of each grid is taken as a starting point, the triangular faces and the spatial relationship of the edges are numbered and recorded according to a preset rule;
[0023] The connection relationship of the triangular faces and the edges is dynamically obtained in the calculation process based on the spatial relationship, and a connection relationship table does not need to be pre-calculated and stored.
[0024] Preferably, the S2 specifically comprises:
[0025] The center point and the normal vector of each triangular face are calculated;
[0026] According to the dot product result of the vector from the viewpoint to the center point of the triangular face and the normal vector, it is judged that the triangular face is a shadow face or a sun face;
[0027] All the edges are traversed, if the triangular faces on both sides of an edge are a shadow face and a sun face respectively, and the horizontal distance from the shadow face to the viewpoint is greater than that from the sun face to the viewpoint, the edge is determined as a shielding edge.
[0028] Preferably, the S3 specifically comprises:
[0029] Based on the elevation value of each grid in the DEM and the elevation of the viewpoint, the relative height difference between each grid and the viewpoint is calculated;
[0030] The position slope of each grid is calculated according to the horizontal distance between each grid and the viewpoint;
[0031] The position slope is stored as a two-dimensional matrix consistent with the size of the DEM.
[0032] Preferably, the generating scanning lines in S5 specifically comprises:
[0033] Connecting the two endpoints of the occlusion edge to the viewpoint respectively and extending to the boundary of the analysis area;
[0034] Generating scanning lines in the horizontal or vertical direction by linear interpolation between the two extended lines to cover the occlusion area.
[0035] Preferably, the judging visibility and early termination in S6 specifically comprises:
[0036] Comparing the terrain slope of each point on the scanning line with the critical slope obtained by interpolation based on the occlusion edge;
[0037] If the terrain slope of the point is greater than or equal to the critical slope, the point is determined to be visible, otherwise it is not visible;
[0038] If all points on a scanning line are determined to be visible, skip the remaining scanning lines after the scanning line in the occlusion area.
[0039] In the second aspect, the present application provides the following technical solutions, a DEM visibility analysis system based on volume shadow, the system comprises:
[0040] A data acquisition and model construction module for acquiring digital elevation model (DEM) data and user input viewpoint parameters, and constructing a regular triangulation model based on the DEM data;
[0041] A shadow and sun attribute and occlusion edge determination module for calculating the shadow and sun attribute of each triangle based on the viewpoint parameters, and determining the occlusion edge according to the shadow and sun attribute of adjacent triangles and the horizontal distance to the viewpoint;
[0042] A terrain slope field pre-computation module for pre-computing the position slope of each grid in the analysis area based on the DEM data and the viewpoint parameters, and generating a terrain slope field;
[0043] An occlusion area determination module for determining the occlusion area defined by the connection between each occlusion edge and the viewpoint for each occlusion edge;
[0044] A scanning line generation module for generating a plurality of scanning lines in the occlusion area to cover the occlusion area row by row or column by column;
[0045] A visibility judging module is configured to calculate the terrain slope and the critical slope of the occlusion edge of each point on each scan line, judge the visibility of each point based on the slope comparison result, and terminate the subsequent scanning of the occlusion region in advance when the entire scan line meets the visibility condition;
[0046] A result integration module is configured to integrate the visibility judgment results of all occlusion edges to generate a final viewshed analysis diagram.
[0047] The present application has the following advantages:
[0048] 1. In the present application, the DEM viewshed analysis problem is converted into a volume shadow problem with a viewpoint equal to a light source, the interpolation processing of DEM data and GIS platform for terrain is neat and standard, the calculation related to volume shadow is simplified, the precision of the accurate algorithm is realized, the operation speed close to the approximate algorithm is achieved, and the slope generated by the terrain interpolation processing can be considered.
[0049] 2. In the present application, the regularized triangular mesh model is adopted, the connection relationship can be dynamically obtained through coordinate calculation, the large topological connection table does not need to be stored explicitly, the memory occupation is significantly reduced, and the model and the pre-calculated geometric data can be reused in multi-viewpoint analysis of the same area, so that data reading and model construction do not need to be repeatedly performed during multi-viewpoint analysis or viewpoint moving analysis, and the efficiency of regional-level analysis is improved.
[0050] 3. In the present application, the early exit mechanism based on the scan line is introduced in the visibility judgment process, when the system detects that all points on a scan line meet the visibility condition, the subsequent scan line calculation in the occlusion region is automatically skipped, the spatial continuity feature of terrain visibility is effectively utilized, the calculation path is automatically optimized for the continuous visible region, the redundant calculation is significantly reduced under the premise of ensuring the complete accuracy of the result, and the algorithm has a better time complexity when processing large-scale terrain.
[0051] 4. In the present application, the occlusion analysis is performed based on the geometric characteristics of the triangular facet, does not depend on the strict regularity of the grid, can effectively process the terrain with complex features such as recesses and protrusions, and can still maintain stable edge extraction and visibility judgment ability when there are local elevation abnormalities in the data. BRIEF DESCRIPTION OF DRAWINGS
[0052] Figure 1 A flowchart of the DEM viewshed analysis method based on volume shadow proposed in the present application;
[0053] Figure 2 A schematic diagram of the terrain triangular division rule proposed in the present application;
[0054] Figure 3A schematic diagram of a topological relationship of a regular triangulation network proposed by the present application;
[0055] Figure 4 A schematic diagram of a shielding area definition proposed by the present application;
[0056] Figure 5 A schematic diagram of a scan line generation proposed by the present application;
[0057] Figure 6 A schematic diagram of a viewshed analysis result proposed by the present application;
[0058] Figure 7 A schematic diagram of a DEM viewshed analysis system architecture based on volume shadow proposed by the present application. DETAILED DESCRIPTION
[0059] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0060] Embodiment one:
[0061] In the first embodiment of the present application, the present application provides a DEM viewshed analysis method based on volume shadow, as shown in the following steps: Figure 1
[0062] S1, obtaining digital elevation model DEM data and user input viewpoint parameters, and constructing a regular triangulation network model based on the DEM data;
[0063] Further, the step of constructing a regular triangulation network model in S1 specifically includes:
[0064] Triangularly dividing the DEM grid cells in the northwest and southeast directions to generate two triangular faces;
[0065] Taking the northwest corner of each grid as the starting point, numbering and recording the spatial relationship between the triangular faces and edges according to a preset rule;
[0066] Based on the spatial relationship, the connection relationship between the triangular faces and edges is dynamically obtained in the calculation process, without the need to pre-calculate and store the connection relationship table.
[0067] Specifically, first, read the grid data of the digital elevation model DEM and the user input viewpoint parameters , and obtain the width and height of the analysis area, then triangularly divide each grid cell in the DEM, and the rule is as shown in the following Figure 2 As shown, the division rule is: each rectangular cell composed of four adjacent elevation points is divided into two triangular patches along the diagonal from northwest to southeast, which generates a total of 4 triangular patches, each of which is composed of three pixel vertices (x, y, z), and the geometric center (x, y, z) and unit normal vector (nx, ny, nz) of each patch are pre-calculated and recorded, the calculation formula is as follows:
[0068]
[0069]
[0070] As shown in the accompanying drawings, let the pixel coordinates of the starting point (northwest corner) of the patch be (x, y), and the two patches are numbered according to the rule: the patch in the northeast direction is (x, y+1), and the patch in the southwest direction is (x+1, y), and the pre-calculated data (center point, normal vector, etc.) of all patches are stored in a logically three-dimensional matrix (or equivalent data structure) so as to be directly accessed by indexing, and since the division rule is fixed, the topological connection relationship between the triangular faces and the edges can be directly dynamically calculated by coordinates, for example, the two faces adjacent to the edge must be and, so that there is no need to pre-calculate and store the connection relationship table of the entire network at the initialization time, and the geometric data of the triangular patches recorded in this process can be reused when performing the visibility analysis for multiple viewpoints of the same terrain, avoiding repeated triangular division and normal vector calculation, significantly improving the efficiency and memory usage in the data preparation stage, and providing convenience for multi-viewpoint analysis. Figure 3 Through the fixed division and numbering rule, the very large triangular patch adjacency relationship table does not need to be explicitly stored, which significantly reduces the memory occupation. At the same time, the geometric properties (center point, normal vector) of all triangular faces are pre-calculated and stored, combined with dynamic topological calculation, so that the model becomes a high-efficiency data basis, and the triangular mesh model of the same region can be reused by subsequent multi-viewpoint analysis, and when performing multi-viewpoint analysis or viewpoint moving analysis, there is no need to repeatedly perform data reading, grid division and geometric calculation, which greatly improves the efficiency of regional-level analysis.
[0071] S2, calculate the yin and yang properties of each triangular face based on the viewpoint parameters, and determine the occlusion edge according to the yin and yang properties of adjacent triangular faces and the horizontal distance to the viewpoint;
[0072]
[0073] Furthermore, determining the occlusion edge in S2 specifically includes:
[0074] Calculate the center point and normal vector of each triangular face;
[0075] Based on the dot product of the vector between the viewpoint and the center point of the triangle and the normal vector, determine whether the triangle is a shaded or sunny face.
[0076] Traverse all edges. If the triangular faces on both sides of an edge are the shaded and sunny faces respectively, and the horizontal distance from the shaded face to the viewpoint is greater than that from the sunny face, then the edge is determined to be an occluded edge.
[0077] Specifically, based on the regular triangular mesh model constructed in S1 and the viewpoint parameters input by the user. The system iterates through each triangular facet in the model to calculate its yin-yang attributes, looping through the ordinates. From 0 to x-axis From 0 to And process the two triangular faces corresponding to each starting point in turn. and ;
[0078] (1) Calculate the yin and yang sides:
[0079] For each triangular facet, its geometric center is pre-calculated in S1. and unit normal vector Calculate the viewpoint vector With normal vector dot product:
[0080] ;
[0081] like If the triangle faces away from the viewpoint, it is considered a shaded face, meaning it faces away from the viewpoint. Conversely, if it faces away from the viewpoint, it is considered a sunny face, meaning it faces the viewpoint directly.
[0082] (2) Calculate the occlusion edge:
[0083] While determining the yin-yang attributes of the triangular facets, the system checks the pixel-level properties. Starting from three predefined edges (e.g., edges numbered 0, 1, and 2), based on the fixed connection relationships established in S1, dynamically obtain the two triangular faces adjacent to each edge. For example, edge... Two adjacent faces are and .
[0084] For each edge, the following two conditions must be met simultaneously to determine if it is a shading edge:
[0085] From the center point of the yin plane to the viewpoint The horizontal distance must be greater than the distance from the center point of the sunlit side to the viewpoint. The horizontal distance. (Horizontal distance calculation ignores elevation and only uses plane coordinates:) ;in, and These represent the x and y coordinates of the geometric center point of the triangular facet on the two-dimensional plane (i.e., the x and y values after it is projected onto the xy plane). and These represent the x and y coordinates of the viewpoint parameters on the two-dimensional plane (i.e., the x and y values after the viewpoint is projected onto the xy plane).
[0086] An edge is officially identified as an occluded edge only when both of the above conditions are met. The system then records the spatial identifier of the edge (such as the starting coordinates and edge number) and the three-dimensional coordinates of its two endpoints for use in subsequent steps.
[0087] The method determines yin and yang attributes by calculating dot product, which requires little computation and provides clear judgment. By combining dynamically acquired adjacency relationships with horizontal distance comparison, it can filter out truly effective shading edges. These edges are the parts on the terrain outline that actually block the view. This avoids the indiscriminate and time-consuming calculation of all terrain areas in subsequent steps. Instead, it concentrates computational resources on processing these key shadow boundaries. The method is based on a triangular face model for judgment and takes into account the slope generated after the GIS platform interpolates the terrain, thus overcoming the inherent defects of the traditional grid ladder model.
[0088] S3. Based on DEM data and viewpoint parameters, pre-calculate and analyze the position slope of each grid in the region to generate a terrain slope field;
[0089] Furthermore, the pre-calculated terrain slope field in S3 specifically includes:
[0090] Based on the elevation values of each grid in the DEM and the viewpoint elevation, calculate the relative elevation difference between each grid and the viewpoint;
[0091] The position slope of each grid is calculated by combining the horizontal distance between each grid and the viewpoint;
[0092] The position slope is stored as a two-dimensional matrix with the same dimensions as the DEM.
[0093] Specifically, the system iterates through every grid pixel in the Digital Elevation Model (DEM). It takes the x, y, and z values of each DEM grid pixel and calculates its slope T. This slope T is defined by the following formula:
[0094] ;
[0095] The slope values T of all grid points are recorded in a two-dimensional matrix MT of size h×w. The structure of this two-dimensional matrix is as follows:
[0096] ;
[0097] In this matrix, the element T(x,y) corresponds to the slope value calculated from the grid pixel at coordinates (x,y) in the DEM. This matrix constitutes a complete terrain slope field, providing core data for determining the visibility of each point in subsequent steps.
[0098] S4. For each occlusion edge, determine the occlusion area defined by the line connecting it to the viewpoint;
[0099] As attached Figure 4 (Schematic diagram of the shading area) As shown, for each shading edge determined in step S2 It is necessary to accurately locate the occlusion area defined by the viewpoint and the viewpoint. Respectively with the endpoints and Connect the two lines and extend them to the boundary of the analysis region to obtain the intersection point. and Therefore, from point By connecting them sequentially, a quadrilateral (or triangular) region is defined on the horizontal plane, which is the potential occlusion area corresponding to the occlusion edge. This area is the precise calculation range for subsequent line-by-line scanning and visibility analysis.
[0100] S5. Generate several scan lines within the occluded area and cover the occluded area row by row or column by column;
[0101] Furthermore, the generation of scan lines in S5 specifically includes:
[0102] Connect the two endpoints of the occlusion edge to the viewpoint and extend the lines to the boundary of the analysis region.
[0103] Horizontal or vertical scan lines are generated between the two extended lines using linear interpolation to cover the obscured area.
[0104] Specifically, to ensure the system covers the occlusion area determined in step S4, a series of scan lines need to be generated. Let the two endpoints of an occlusion edge be... and The intersection points of the line connecting it to the viewpoint and extending it to the boundary of the analysis region are respectively and .
[0105] The system first determines whether to generate horizontal or vertical scan lines.
[0106] Horizontal scan line generation:
[0107] Premise: When the straight line and Used when neither line is horizontal.
[0108] step:
[0109] a. on the straight line Up, from point Start towards point Direction is obtained pixel by pixel through linear interpolation. .
[0110] b. For each point , with its ordinate Substitute the known quantity into the line... Given the parametric equations, calculate the corresponding points. The calculation formula is as follows:
[0111] ;
[0112] ;
[0113] c. Connection point and points This constitutes a horizontal scan line, and the calculation result is as follows: Figure 5 As shown:
[0114] Vertical scan line generation:
[0115] Premise: When the straight line or If the line is horizontal, then use a vertical scan line instead.
[0116] step:
[0117] a. on the straight line Up, from point Start towards point Direction is obtained pixel by pixel through linear interpolation. .
[0118] b. For each point , with its x-coordinate Substituting the known quantity into the line... Given the parametric equations, calculate the corresponding points. The calculation formula is as follows:
[0119] ;
[0120] ;
[0121] c. Connection point and points This forms a vertical scan line.
[0122] Using the methods described above, the system can be enabled by... , , , Within the defined quadrilateral occlusion area, a set of dense and parallel scan lines are generated to ensure that the area is covered without omission, thus preparing for subsequent point-by-point visibility analysis.
[0123] S6. Calculate the terrain slope and critical slope of the occlusion edge at each point on each scan line, judge the visibility of each point based on the slope comparison results, and terminate the subsequent scanning of the occlusion area in advance when the visibility conditions are met for the entire scan line.
[0124] Furthermore, the determination of visibility and early termination in S6 specifically includes:
[0125] For each point on the scan line, its terrain slope is compared with the critical slope obtained by interpolation based on the occlusion edge;
[0126] If the terrain slope at a point is greater than or equal to the critical slope, then the point is considered visible; otherwise, it is not visible.
[0127] If all points on a scan line are determined to be visible, then the remaining scan lines within the occluded area that are located after that scan line are skipped.
[0128] Specifically, such as Figure 5 As shown, a point-by-point visibility analysis was performed on the scan lines, with the scanning order following the principle of from near to far. Each pixel on From its terrain slope With critical shading slope Comparison, By masking the slope of the edge endpoints and Linear interpolation is obtained when the horizontal scan line is... Vertical scan line The judgment rule is: if Then point If a pixel is visible, it is considered visible; otherwise, it is not. When processing the current scan line, each pixel on the scan line must be calculated sequentially. The entire scan line is considered visible only if all pixels on the current scan line are determined to be visible, and all subsequent scan lines located after the current scan line within the occluded area are immediately skipped, thereby optimizing the calculation process.
[0129] S7. Integrate the visibility judgment results of all occluded edges to generate the final viewport analysis map;
[0130] Specifically, steps S4 to S6 are executed cyclically to process all occlusion edges marked in step S2. To improve efficiency, before processing the next occlusion edge, it is checked whether its two endpoints have been determined to be invisible by the previous processing. If so, the edge can be skipped directly. Finally, the visibility judgment results of all pixels are integrated into a final result matrix of the same size as the DEM. This matrix can be directly used to generate a viewport analysis map, which intuitively shows the terrain range that can be observed from a specified viewpoint, as shown in the attached final result map. Figure 6 As shown, the results of the field of view analysis are presented graphically. The viewpoint, occlusion edge, visible area and invisible area are usually distinguished by different colors (such as blue, yellow, green and red) to intuitively show the analysis results. Blue represents the viewpoint, yellow is the occlusion edge, green represents the visible area and red represents the invisible area.
[0131] Example 2:
[0132] Existing DEM view-through analysis algorithms are divided into exact and approximate algorithms. Both algorithms are based on the DEM grid and treat the terrain as steps, failing to account for slopes created by GIS platform interpolation. This is especially problematic when the terrain slope and the angle between the viewpoint and the slope are very small, leading to significant errors in occlusion points. To address these issues, this invention provides a DEM view-through analysis system based on volumetric shading, the structure of which is as follows: Figure 7 As shown. The specific implementation process of the system is as follows: The system includes:
[0133] The data acquisition and model building module is used to acquire digital elevation model (DEM) data and viewpoint parameters input by the user, and to build a regular triangulation model based on the DEM data.
[0134] The Yin-Yang attribute and occlusion edge determination module is used to calculate the Yin-Yang attribute of each triangular face based on the viewpoint parameters, and determine the occlusion edge according to the Yin-Yang attribute of adjacent triangular faces and the horizontal distance to the viewpoint.
[0135] The terrain slope field pre-calculation module is used to pre-calculate the position slope of each grid in the analysis area based on the DEM data and viewpoint parameters, and generate a terrain slope field.
[0136] The occlusion area determination module is used to determine the occlusion area defined by the line connecting each of the occlusion edges and the viewpoint.
[0137] A scan line generation module is used to generate a number of scan lines within the occlusion area, covering the occlusion area row by row or column by column;
[0138] The visibility judgment module is used to calculate the terrain slope and the critical slope of the occlusion edge of each point on each scan line, judge the visibility of each point based on the slope comparison results, and terminate the subsequent scanning of the occlusion area in advance when the visibility conditions are met for the entire scan line.
[0139] The results integration module integrates the visibility judgment results of all occluded edges to generate the final viewport analysis map.
[0140] Specifically, the data acquisition and model building module is responsible for parsing the input DEM raster data and viewpoint parameters, performing regular triangulation construction, and generating a set of triangular facets with clear topological relationships. The yin-yang attribute and occlusion edge determination module performs vector operations based on viewpoint coordinates, calculates the dot product of the normal vector of each triangular facet and the viewpoint vector, divides the yin-yang faces according to the dot product result, and identifies edge segments that meet the occlusion conditions by traversing shared edges.
[0141] The terrain slope field pre-calculation module employs a batch calculation strategy. Based on DEM elevation data and viewpoint location, it calculates the position slope of each raster relative to the viewpoint, constructing a slope matrix of the same size as the DEM. The shading region determination module performs geometric calculations for each shading edge, connecting the edge endpoints to the viewpoint and extending the line to the analysis boundary, defining potential shading regions in quadrilaterals or triangles on a two-dimensional plane.
[0142] Within a defined occlusion area, the scan line generation module generates a set of parallel scan lines using a linear interpolation algorithm based on the boundary line equation, ensuring complete coverage of the target area. The visibility assessment module performs point-by-point analysis along the scan line sequence, determining the visibility status of each point by comparing the pre-calculated terrain slope with the critical slope based on occlusion edge interpolation. An early termination mechanism is activated when the entire scan line is detected to meet the visibility conditions.
[0143] The results integration module aggregates all local visibility judgment results, generates a complete field-of-view matrix, and outputs a visual analysis map through the rendering engine, using color to distinguish the state of different regions, thus completing the entire analysis process.
[0144] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A DEM view-through analysis method based on volumetric shading, characterized in that, Includes the following steps: S1. Obtain digital elevation model (DEM) data and viewpoint parameters input by the user, and construct a regular triangular network model based on the DEM data; S2. Calculate the yin-yang attributes of each triangular face based on the viewpoint parameters, and determine the occlusion edge according to the yin-yang attributes of adjacent triangular faces and the horizontal distance to the viewpoint. S3. Based on the DEM data and viewpoint parameters, pre-calculate the position slope of each grid in the analysis area to generate a terrain slope field; S4. For each of the aforementioned occlusion edges, determine the occlusion area defined by the line connecting it to the viewpoint; S5. Generate several scan lines within the shaded area and cover the shaded area row by row or column by column; S6. Calculate the terrain slope and critical slope of the occlusion edge at each point on each scan line, judge the visibility of each point based on the slope comparison results, and terminate the subsequent scanning of the occlusion area in advance when the visibility conditions are met for the entire scan line. S7. Integrate the visibility judgment results of all occluded edges to generate the final viewport analysis map.
2. The DEM view-through analysis method based on volumetric shading according to claim 1, characterized in that, The construction of the regular triangulation model in S1 specifically includes: The DEM grid cells are triangulated along the northwest and southeast directions to generate two triangular faces. Starting from the northwest corner of each grid, number and record the spatial relationship between the triangular faces and the edges according to the preset rules; Based on the spatial relationship, the connection relationship between the triangle face and the edge is dynamically obtained during the calculation process, without the need to pre-calculate and store the connection relationship table.
3. The DEM view-through analysis method based on volumetric shading according to claim 1, characterized in that, Determining the occlusion edge in S2 specifically includes: Calculate the center point and normal vector of each triangular face; Based on the dot product of the vector between the viewpoint and the center point of the triangle and the normal vector, determine whether the triangle is a shaded or sunny face. Traverse all edges. If the triangular faces on both sides of an edge are the shaded and sunny faces respectively, and the horizontal distance from the shaded face to the viewpoint is greater than that from the sunny face, then the edge is determined to be an occluded edge.
4. The DEM view-through analysis method based on volumetric shading according to claim 1, characterized in that, The pre-calculated terrain slope field in S3 specifically includes: Based on the elevation values of each grid in the DEM and the viewpoint elevation, calculate the relative elevation difference between each grid and the viewpoint; The position slope of each grid is calculated by combining the horizontal distance between each grid and the viewpoint; The position slope is stored as a two-dimensional matrix with the same dimensions as the DEM.
5. The DEM view-through analysis method based on volumetric shading according to claim 1, characterized in that, The generation of scan lines in S5 specifically includes: Connect the two endpoints of the occlusion edge to the viewpoint and extend the lines to the boundary of the analysis region. A horizontal or vertical scan line is generated between the two extended lines by linear interpolation to cover the masked area.
6. The DEM view-through analysis method based on volumetric shading according to claim 1, characterized in that, The determination of visibility and early termination in S6 specifically includes: For each point on the scan line, its terrain slope is compared with the critical slope obtained by interpolation based on the occlusion edge; If the terrain slope at a point is greater than or equal to the critical slope, then the point is considered visible; otherwise, it is not visible. If all points on a scan line are determined to be visible, then the remaining scan lines within the occluded area that are located after that scan line are skipped.
7. A DEM view-through analysis system based on volumetric shading, characterized in that, The system for the DEM view-through analysis method based on volumetric shading as described in any one of claims 1-6 comprises: The data acquisition and model building module is used to acquire digital elevation model (DEM) data and viewpoint parameters input by the user, and to build a regular triangulation model based on the DEM data. The Yin-Yang attribute and occlusion edge determination module is used to calculate the Yin-Yang attribute of each triangular face based on the viewpoint parameters, and determine the occlusion edge according to the Yin-Yang attribute of adjacent triangular faces and the horizontal distance to the viewpoint. The terrain slope field pre-calculation module is used to pre-calculate the position slope of each grid in the analysis area based on the DEM data and viewpoint parameters, and generate a terrain slope field. The occlusion area determination module is used to determine the occlusion area defined by the line connecting each of the occlusion edges and the viewpoint. A scan line generation module is used to generate a number of scan lines within the occlusion area, covering the occlusion area row by row or column by column; The visibility judgment module is used to calculate the terrain slope and the critical slope of the occlusion edge of each point on each scan line, judge the visibility of each point based on the slope comparison results, and terminate the subsequent scanning of the occlusion area in advance when the visibility conditions are met for the entire scan line. The results integration module integrates the visibility judgment results of all occluded edges to generate the final viewport analysis map.
Citation Information
Patent Citations
Visibility analysis rendering method base on principle of stencil shadow
CN102663807A
Method for calculating radar detection range under terrain shielding based on digital elevation model
CN118746802A