Slope direction calculation and visualization system based on digital elevation model

Through the slope calculation and visualization system based on the digital elevation model, the slope direction is automatically generated by automatic generation of two-dimensional and three-dimensional images, solving the problem of inefficiency of traditional methods, achieving high-precision and flexible visualization effects, meeting the diverse needs of users, and improving the display effect of terrain.

CN120279205APending Publication Date: 2025-07-08GUANGZHOU S P I DESIGN CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510336046.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

Traditional slope calculation methods are complex and inefficient. The existing automated calculation methods still have room for improvement in accuracy, efficiency and visualization effects. The existing visualization tools lack flexibility and are difficult to meet users' diverse needs for graphic display styles.

Method used

It provides a slope calculation and visualization system based on digital elevation model, including an input data processing module, a slope calculation module, a two-dimensional visualization module and a three-dimensional visualization module. By collecting geographical parameters and basic parameters, it automatically generates two-dimensional and three-dimensional images of slope, uses the central differential method to calculate the slope angle, perform angle correction and color mapping, and creates a three-dimensional terrain image with Matplotlib's 3D drawing function.

Benefits of technology

It realizes automatic generation of slope images based on user needs, improves calculation accuracy and efficiency, enhances visual effects, meets users' diverse needs for graphic styles, and enhances the three-dimensionality and reality of the terrain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279205A_ABST
    Figure CN120279205A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of three-dimensional visualization, and provides a slope direction calculation and visualization system based on a digital elevation model, which comprises an input data processing module, a slope direction calculation module, a two-dimensional visualization module and a three-dimensional visualization module. According to the method, the geographic parameters and the basic parameters are collected and the two-dimensional image and the three-dimensional image of the slope direction are automatically generated, so that a user can conveniently adjust the image display effect according to requirements, the diversified requirements of the user on graphic styles are met, and the construction efficiency of the slope direction image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of three-dimensional visualization, and particularly to a slope aspect calculation and visualization system based on a digital elevation model. Background Art

[0002] Geographic Information System is abbreviated as GIS. In GIS, slope aspect is an important parameter describing the slope orientation at a certain position on the earth's surface.

[0003] Traditional slope aspect calculation methods are complex and inefficient, and existing automated calculation methods still have room for improvement in terms of accuracy, efficiency, and visualization effect. In addition, existing visualization tools often lack flexibility and are difficult to meet the diverse needs of users for graphic display styles. Traditional topographic data display mostly uses two-dimensional maps or contour maps, and these methods have limitations in expressing terrain undulations and slope aspect characteristics. Existing three-dimensional visualization methods often have problems such as low data processing efficiency and poor visualization effect when dealing with complex topographic data. Summary of the Invention

[0004] In order to overcome the deficiencies of the prior art, the purpose of the present invention is to provide a slope aspect calculation and visualization system based on a digital elevation model, which can automatically generate two-dimensional and three-dimensional images of slope aspect according to user requirements.

[0005] To achieve the above purpose, the present invention provides the following solutions:

[0006] A slope aspect calculation and visualization system based on a digital elevation model, comprising:

[0007] An input data processing module for collecting geographical parameters and basic parameters;

[0008] A slope aspect calculation module for calculating angle data according to the collected geographical parameters and the basic parameters, and preprocessing and correcting the angle data to obtain angle correction data;

[0009] A two-dimensional visualization module for performing two-dimensional visualization processing on the angle correction data to obtain a visualized slope aspect map;

[0010] A three-dimensional visualization module for performing three-dimensional visualization processing on the angle correction data to obtain a three-dimensional terrain image.

[0011] Preferably, the implementation process of the input data processing module includes:

[0012] Reading a DEM file provided by the user to obtain the geographical parameters;

[0013] Receiving the basic parameters input by the user.

[0014] Preferably, the geographical parameters include: elevation data, projection information, and geographical transformation information; the basic parameters include: aspect map output path, aspect division type, color mapping table, transparency parameter, vector layer file, azimuth angle, annotation language, coordinate axis display status, grid step size, and hillshade rendering requirements.

[0015] Preferably, the implementation process of the aspect calculation module includes:

[0016] Calculate the horizontal derivatives and vertical derivatives of the raster cells in the x and y directions using the central difference method based on the elevation data, and calculate the aspect angle of the raster cells using the arctangent function to obtain the angle data;

[0017] Determine the data less than 0 degrees, greater than 90 degrees, and between 0 and 90 degrees in the angle data as the first type of data, the second type of data, and the third type of data respectively, adjust the first type of data to the difference from 90 degrees, adjust the second type of data to the difference from 450 degrees, and adjust the third type of data to the difference from 90 degrees to obtain the preprocessed angle data;

[0018] Perform counterclockwise deflection correction on the preprocessed angle data using the azimuth angle to obtain the angle correction data;

[0019] Mark the no-data areas in the DEM file as a preset specific value in the angle correction data to obtain the processed angle correction data, and write the angle correction data and the geographical parameters into a raster data file created using the GDAL library.

[0020] Preferably, the implementation process of the 2D visualization module includes:

[0021] Perform color mapping, transparency processing, and hillshade rendering on the angle correction data according to the color mapping table and the transparency parameter to obtain a visualization image;

[0022] Set the vector boundary, annotation language, compass, and scale for the visualization image, and determine whether to display the coordinate axes for the visualization image according to the coordinate axis display requirements to obtain the visualized aspect map;

[0023] Save the visualized aspect map in the file format and file resolution specified by the user.

[0024] Preferably, the implementation process of the 3D visualization module includes:

[0025] Calculate the terrain according to the geographical transformation information to obtain a coordinate grid;

[0026] Determine the labels of different slope aspect categories in the coordinate grid according to the slope aspect division type to obtain slope aspect labels;

[0027] Determine the face color corresponding to each slope aspect label according to the color mapping table;

[0028] Create the three-dimensional terrain image using the 3D plotting function of Matplotlib according to the coordinate grid, and determine the overall color data of the three-dimensional terrain image according to the angle correction data and the slope aspect labels to obtain the three-dimensional terrain image with the color setting completed;

[0029] Determine the step size, display range, transparency, and color legend of the three-dimensional terrain image according to the basic parameters, and determine whether to display the coordinate axes for the three-dimensional terrain image to obtain the processed three-dimensional terrain image.

[0030] Preferably, the file format is any one of PNG and SVG.

[0031] The present invention discloses the following technical effects:

[0032] The present invention provides a slope aspect calculation and visualization system based on a digital elevation model. By collecting geographical parameters and basic parameters and automatically generating two-dimensional and three-dimensional images of the slope aspect, it solves the defects that existing visualization tools lack flexibility and are difficult to meet the diverse needs of users for graphic display styles, and realizes the function that users can adjust the image display effect according to their needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required to be used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0034] Figure 1 Schematic diagram of the slope aspect calculation and visualization system based on a digital elevation model provided by an embodiment of the present invention;

[0035] Figure 2 Schematic diagram of the two-dimensional schematic diagram generation setting interface provided by an embodiment of the present invention;

[0036] Figure 3 Schematic diagram of the mountain shadow rendering effect provided by an embodiment of the present invention;

[0037] Figure 4 Schematic diagram of the visualized slope aspect map provided by an embodiment of the present invention;

[0038] Figure 5The 3D schematic diagram generation setting interface provided by the embodiments of the present invention;

[0039] Figure 6 The 3D terrain image schematic diagram provided by the embodiments of the present invention. Detailed implementation manners

[0040] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0041] The purpose of the present invention is to provide a slope aspect calculation and visualization system based on a digital elevation model, which realizes the automatic generation of two-dimensional and three-dimensional images of slope aspects according to user requirements.

[0042] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners.

[0043] Figure 1 The schematic diagram of the slope aspect calculation and visualization system based on the digital elevation model provided by the embodiments of the present invention, as Figure 1 shown, the present invention provides a slope aspect calculation and visualization system based on a digital elevation model, including:

[0044] An input data processing module, configured to collect geographical parameters and basic parameters;

[0045] A slope aspect calculation module, configured to calculate angle data according to the collected geographical parameters and basic parameters, and perform preprocessing and correction on the angle data to obtain angle correction data;

[0046] A two-dimensional visualization module, configured to perform two-dimensional visualization processing on the angle correction data to obtain a visualized slope aspect map;

[0047] A three-dimensional visualization module, configured to perform three-dimensional visualization processing on the angle correction data to obtain a three-dimensional terrain image.

[0048] Further, the implementation process of the input data processing module includes:

[0049] Reading the DEM file provided by the user to obtain geographical parameters;

[0050] Receiving the basic parameters input by the user.

[0051] Preferably, the geographical parameters include: elevation data, projection information, and geographical transformation information; the basic parameters include: the output path of the aspect map, the aspect division type, the color mapping table, the transparency parameter, the vector layer file, the azimuth angle, the annotation language, the axis display status, the grid step size, and the mountain shadow rendering requirement.

[0052] Specifically, the implementation process of the aspect calculation module includes:

[0053] Calculate the horizontal derivative and vertical derivative of the raster cell in the x and y directions using the central difference method based on the elevation data, and calculate the aspect angle of the raster cell using the arctangent function to obtain the angle data;

[0054] Determine the data less than 0 degrees, greater than 90 degrees, and between 0 and 90 degrees in the angle data as the first type of data, the second type of data, and the third type of data respectively, adjust the first type of data to the difference from 90 degrees, adjust the second type of data to the difference from 450 degrees, and adjust the third type of data to the difference from 90 degrees to obtain the preprocessed angle data;

[0055] Perform a counterclockwise deflection correction on the preprocessed angle data using the azimuth angle to obtain the angle correction data;

[0056] Mark the no-data area in the DEM file as a preset specific value in the angle correction data to obtain the processed angle correction data, and write the angle correction data into the raster data file created using the GDAL library.

[0057] Furthermore, the implementation process of the 2D visualization module includes:

[0058] Perform color mapping, transparency processing, and mountain shadow rendering on the angle correction data according to the color mapping table and transparency parameter to obtain a visualization image;

[0059] Set the vector boundary, annotation language, compass, and scale for the visualization image, and determine whether to display the axes of the visualization image according to the axis display requirement to obtain a visualized aspect map;

[0060] Save the visualized aspect map in the file format and file resolution specified by the user.

[0061] Furthermore, the implementation process of the 3D visualization module includes:

[0062] Calculate the terrain according to the geographical transformation information to obtain a coordinate grid;

[0063] Determine the labels of different aspect categories in the coordinate grid according to the aspect division type to obtain aspect labels;

[0064] Determine the face color corresponding to each of the slope aspect labels according to the color mapping table;

[0065] Create the three-dimensional terrain image using the 3D plotting function of Matplotlib based on the coordinate grid, and determine the overall color data of the three-dimensional terrain image according to the angle correction data and the slope aspect labels, obtaining the three-dimensional terrain image with the color setting completed;

[0066] Determine the step size, display range, the transparency, and the color legend of the three-dimensional terrain image according to the basic parameters, and determine whether to display the coordinate axes for the three-dimensional terrain image, obtaining the processed three-dimensional terrain image.

[0067] Optionally, the file format is any one of PNG and SVG.

[0068] Specifically, input data processing. Read DEM data: The system reads the DEM file provided by the user, obtains its elevation data, projection information, and geographic transformation information; read the DEM data as a NumPy array and process the no-data value (NoData). User parameter input: Receive parameters input by the user, such as the output path of the slope aspect map, the slope aspect division type (8 orientations or 4 orientations), the color mapping table (cmap), the transparency (alpha), the vector layer file (shp_file), the azimuth angle (azimuth), whether to display the coordinate axes (axis), etc.

[0069] Furthermore, slope aspect calculation:

[0070] 1) Calculate the slope aspect:

[0071] Use the central difference method to calculate the slopes of the raster cells in the x and y directions.

[0072] Use the arctangent function to calculate the slope aspect angle, and adjust the angle range as needed.

[0073] Perform special processing for specific conditions to avoid calculation errors.

[0074] 2) Direction correction: Perform a counterclockwise deflection correction on the calculated slope aspect according to the input azimuth angle (azimuth).

[0075] 3) Mask processing: Mark the no-data areas in the original DEM data as a specific value (-999) in the slope aspect result.

[0076] 4) Result output:

[0077] Use the GDAL library to create a new raster data file and write the corrected slope aspect data into the file.

[0078] Set the geographic transformation information, projection information, and no-data value.

[0079] Specifically, for 2D visualization processing:

[0080] Color mapping and transparency processing: Visualize the slope aspect data according to the color mapping table and transparency parameters provided by the user.

[0081] Vector layer overlay: Support overlay analysis of the vector boundary of the region.

[0082] Add a compass and scale: Add a compass and scale to the graph, provide spatial reference information, and rotate the compass direction according to the azimuth angle set by the user.

[0083] Axis display: Control the display of the axes of the graph according to the user's requirement of whether to display the axes.

[0084] Output file generation: Save the visualized slope aspect map in the format specified by the user (such as PNG, SVG, etc.), and support setting the resolution (dpi) of the output file.

[0085] Furthermore, for 3D visualization processing:

[0086] Read DEM and slope aspect data: Use the GDAL library to read the data of the DEM file and slope aspect file, and process invalid data.

[0087] Calculate coordinates: Calculate the geographic coordinates of each pixel according to the geographic transformation information.

[0088] Classify slope aspects: Classify the terrain into different slope aspect categories and set corresponding labels.

[0089] Set color mapping: Set color mapping for different slope aspect categories.

[0090] Create a 3D image: Use the 3D plotting function of Matplotlib to create a 3D terrain image, and set the face color according to the slope aspect classification.

[0091] Set image parameters: Set parameters such as the step size, display range, transparency, and whether to display the axes of the 3D image according to the user's requirements.

[0092] Add a legend: Add a legend to explain the correspondence between the color and slope aspect according to the slope aspect classification and color mapping.

[0093] Display the image: Finally, display the 3D terrain image.

[0094] Specifically, each function is described in detail below:

[0095] 1) Calculate the terrain slope aspect data. Implementation steps:

[0096] S11: Read DEM data:

[0097] Open the DEM file using the GDAL library.

[0098] Read the size (number of columns and rows), geotransform information, and projection information of the DEM.

[0099] Read the DEM data into an array and set the invalid values (NoData) to NaN.

[0100] S12: Calculate gradient:

[0101] Calculate the gradients in the x and y directions of the DEM data for subsequent slope aspect calculation.

[0102] S13: Calculate slope aspect:

[0103] Use the arctangent function to calculate the slope aspect angle and adjust its range.

[0104] Perform azimuth correction on the calculated slope aspect data to ensure adjustment relative to the specified azimuth.

[0105] S14: Mask processing:

[0106] Set the invalid values in the DEM to -999 in the slope aspect data.

[0107] S15: Write to output file:

[0108] Use the GDAL library to create a new GTiff file and write the calculated slope aspect data to the file.

[0109] 2) Plot the slope aspect map (refer to Figure 2 ). Implementation steps:

[0110] S21: Read data:

[0111] If the user selects the mountain shadow rendering degree, read the DEM data to generate the terrain shadow map.

[0112] Read the slope aspect data for visualization processing.

[0113] S22: Generate terrain shadow map:

[0114] Refer to Figure 3 , use the LightSource module of Matplotlib to generate the shadow image of the terrain to enhance the three-dimensional sense of the terrain.

[0115] S23: Color mapping and classification:

[0116] Classify the slope aspect data according to aspecttype and map it to different categories.

[0117] Set up the color mapping to map different categories to different colors.

[0118] S24: Create a legend:

[0119] Generate a legend based on the classification results to show the slope aspect directions represented by different colors.

[0120] S25: Add georeference elements:

[0121] Add a scale to provide a reference for geodetic measurements.

[0122] Add a compass to indicate the geographic direction.

[0123] S26: Overlay vector files:

[0124] If the vector file path is provided, read and overlay it on the slope aspect map to enhance the comprehensive information of the map.

[0125] S27: Save the graph:

[0126] Reference Figure 4 , save the generated graph as an image file, supporting the setting of resolution and transparency.

[0127] 3) Generate a 3D view of the terrain (reference Figure 5 ). Implementation steps:

[0128] S31: Read data:

[0129] Read DEM data to prepare for generating a 3D terrain view.

[0130] Read slope aspect data to prepare for color mapping.

[0131] S32: Calculate the coordinate grid:

[0132] Calculate the coordinate grid of the terrain according to the geotransformation information of the DEM for 3D plotting.

[0133] S33: Color mapping and classification:

[0134] Classify the slope aspect data according to aspecttype and map it to different categories.

[0135] Set up the color mapping to map different categories to different colors.

[0136] S34: Generate a 3D view:

[0137] Use the 3D plotting function of Matplotlib to create a terrain surface.

[0138] Set the angle, transparency, and color mapping of the view to enhance the display effect of the terrain.

[0139] S35: Add legends and labels:

[0140] Generate legends according to the classification results to show the slope aspect directions represented by different colors.

[0141] Set the title and axis labels to enhance the readability of the graph.

[0142] S36: Set the view range:

[0143] Set the view range as needed (such as the bottom and top heights) to ensure the clarity of the terrain display.

[0144] S37: Display and save the graph:

[0145] Refer to Figure 6 , and display the generated 3D graph.

[0146] Provide the function to save the graph, supporting the setting of resolution and transparency.

[0147] The beneficial effects of the present invention are as follows:

[0148] (1) Improve calculation accuracy: Adopt an accurate elevation gradient calculation method and the arctangent function to ensure the accurate calculation of the slope aspect angle.

[0149] (2) Enhance visualization effect: Provide functions such as a flexible color mapping table, transparency setting, hill shading rendering, vector layer overlay, annotation language, compass, etc., to meet the diverse needs of users for graph styles.

[0150] (3) Improve calculation efficiency: Automatically process large-scale DEM data, significantly improving the calculation efficiency.

[0151] (4) Strong three-dimensional realism: Display terrain data through three-dimensional images, enhancing the three-dimensional sense and realism of the terrain.

[0152] (5) Obvious slope aspect characteristics: Accurately reflect the slope aspect characteristics of the terrain through color mapping and classification, helping users with terrain analysis.

[0153] (6) Adjustable parameters: Provide a rich set of parameter setting options, allowing users to adjust the image display effect according to their needs.

[0154] (7) Strong applicability: Support multiple DEM formats and projection methods, and can be widely applied to fields such as terrain analysis, ecological research, and urban planning.

[0155] In the present specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other.

[0156] Specific examples are used herein to illustrate the principles and implementation manners of the present invention. The description of the above embodiments is only for helping to understand the method and its core idea of the present invention. At the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation on the present invention.

Claims

1. A slope aspect calculation and visualization system based on a digital elevation model, characterized in that, Including: An input data processing module, configured to collect geographic parameters and basic parameters; An aspect calculation module, configured to calculate angle data based on the collected geographic parameters and the basic parameters, and perform preprocessing and correction on the angle data to obtain angle correction data; A 2D visualization module, configured to perform 2D visualization processing on the angle correction data to obtain a visualized aspect map; A 3D visualization module, configured to perform 3D visualization processing on the angle correction data to obtain a 3D terrain image.

2. The slope aspect calculation and visualization system based on digital elevation model according to claim 1, characterized in that, The implementation process of the input data processing module includes: Reading a DEM file provided by a user to obtain the geographic parameters; Receiving the basic parameters input by the user.

3. A slope aspect calculation and visualization system based on a digital elevation model according to claim 2, characterized in that, The geographic parameters include: elevation data, projection information, and geographic transformation information; the basic parameters include: aspect map output path, aspect division type, color mapping table, transparency parameter, vector layer file, azimuth angle, annotation language, axis display status, grid step size, and mountain shadow rendering requirement.

4. The slope direction calculation and visualization system based on digital elevation model according to claim 3, characterized in that, The implementation process of the aspect calculation module includes: Calculating the horizontal derivative and vertical derivative of a raster cell in the x and y directions according to the elevation data by using the central difference method, and calculating the aspect angle of the raster cell by using the arctangent function to obtain the angle data; Determining the data less than 0 degrees, greater than 90 degrees, and between 0 and 90 degrees in the angle data as the first type of data, the second type of data, and the third type of data respectively, adjusting the first type of data to the difference from 90 degrees, adjusting the second type of data to the difference from 450 degrees, and adjusting the third type of data to the difference from 90 degrees to obtain the preprocessed angle data; Performing counterclockwise deflection correction on the preprocessed angle data by using the azimuth angle to obtain the angle correction data; Marking the no-data area in the DEM file as a preset specific value in the angle correction data to obtain the processed angle correction data, and writing the angle correction data and the geographic parameters into a raster data file created by using the GDAL library.

5. A slope aspect calculation and visualization system based on a digital elevation model according to claim 3, characterized in that The implementation process of the 2D visualization module includes: Performing color mapping, transparency processing, and mountain shadow rendering on the angle correction data according to the color mapping table and the transparency parameter to obtain a visualized image; Performing vector boundary, annotation language, compass, and scale setting on the visualized image, and determining whether to display the axes of the visualized image according to the axis display requirement to obtain the visualized aspect map; Saving the visualized aspect map in a file format and file resolution specified by the user.

6. The slope direction calculation and visualization system based on digital elevation model according to claim 3, characterized in that, The implementation process of the 3D visualization module includes: Calculating the terrain according to the geographic transformation information to obtain a coordinate grid; Determining the labels of different aspect categories in the coordinate grid according to the aspect division type to obtain aspect labels; Determining the face color corresponding to each aspect label according to the color mapping table; Create the three-dimensional terrain image using the 3D plotting function of Matplotlib according to the coordinate grid, and determine the overall color data of the three-dimensional terrain image based on the angle correction data and the slope aspect labels, so as to obtain the three-dimensional terrain image with the color setting completed; Determine the step size, display range, the transparency, and the color legend of the three-dimensional terrain image according to the basic parameters, and determine whether to display the coordinate axes for the three-dimensional terrain image, so as to obtain the processed three-dimensional terrain image.

7. A slope aspect calculation and visualization system based on a digital elevation model according to claim 5, wherein, The file format is any one of PNG and SVG.

Citation Information

Patent Citations

  • Web-based photovoltaic module arrangement area extraction method

    CN118313129A

  • Soil test data intelligent display method and system based on three-dimensional terrain model

    CN119293115A

  • Method and apparatus for generating digital terrain model data of electronic maps

    WO2016116045A1