Gradient map generation method, system, terminal and medium

By performing linear interpolation and simplification on the slope map boundary, the jagged edge problem of the slope map is solved, achieving higher accuracy and continuity in slope map generation, which is suitable for multi-region stitching.

CN121437791BActive Publication Date: 2026-05-29ZHEJIANG INST OF SURVEYING & MAPPING SCI & TECH
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG INST OF SURVEYING & MAPPING SCI & TECH
Filing Date
2025-12-30
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing slope map generation methods, after raster data is converted into vector surfaces, the edges of the slope map are jagged and lack smooth transition, resulting in poor accuracy and continuity, and unsatisfactory presentation.

Method used

By performing linear interpolation and simplification on the initial boundary, a smooth interpolation boundary is generated, and slope regions are divided based on the interpolation boundary, thereby improving the boundary accuracy and smoothness.

Benefits of technology

The generated slope map has smooth, jagged edges, high accuracy, and excellent presentation, making it suitable for seamless stitching of slope maps over a large area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121437791B_ABST
    Figure CN121437791B_ABST
Patent Text Reader

Abstract

The application provides a slope map generation method, system, terminal and medium; wherein the slope map generation method comprises: obtaining elevation raster data based on the spatial range of a target area; calculating the slope value of each pixel based on the elevation raster data, and dividing into each slope level to generate each initial slope area; obtaining the initial boundary of each initial slope area; performing an interpolation operation on each initial boundary to generate corresponding each interpolation line, and simplifying each interpolation line to form each interpolation boundary; dividing each slope area based on each interpolation boundary to generate the slope map corresponding to the target area. By interpolating each initial boundary, obtaining each interpolation line, and forming smooth each interpolation boundary after simplification, each slope area is divided based on each interpolation boundary, so that the generated slope map has smooth boundary of each slope area, good continuity, and high precision, and the display effect of the slope map is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of information management technology, and relates to a slope map generation technology, and particularly to a slope map generation method, system, terminal and medium. Background Technology

[0002] A slope map is a map based on a digital elevation model (DEM) that is created by calculating and extracting slope values ​​and spatially visualizing them to represent the degree of inclination of the earth's surface.

[0003] The generation method for slope maps typically involves first converting raster data into vector surfaces, then classifying the slope and merging pixels at the same slope level to divide the area into different slope grades, thus forming the slope map. However, since raster data is composed of pixels, when merging pixels at the same slope level, the boundary lines are drawn along the pixel edges, such as... Figure 1 As shown, jagged edges are often produced in each slope gradation area, causing the slope map to only show terrain changes at the pixel level, lacking smooth transitions, affecting accuracy and continuity, and thus resulting in poor slope map presentation. Summary of the Invention

[0004] In view of the shortcomings of the prior art, the purpose of this application is to provide a slope map generation method, system, terminal and medium to solve the problem that existing slope map generation methods often produce jagged edges, lack smooth transitions and have poor presentation effects.

[0005] To achieve the above and other related objectives, the present invention first provides a slope map generation method, the method comprising: acquiring corresponding elevation raster data based on the spatial range of a target area; calculating the slope value corresponding to each pixel based on the elevation raster data, and dividing each pixel into slope levels based on the slope value to generate initial slope regions; acquiring the initial boundaries of each initial slope region; performing interpolation operations on each initial boundary to generate corresponding interpolation lines, and simplifying each interpolation line to form interpolation boundaries; and dividing each slope region based on each interpolation boundary to generate a slope map corresponding to the target area.

[0006] In one embodiment of the present invention, based on the spatial range of the target region, an extended spatial range is obtained, and based on the extended spatial range, the corresponding elevation raster data is extracted; after generating each interpolation line, the method further includes: based on the spatial range of the target region, obtaining the boundaries of each region; based on each region boundary, obtaining each edge point of each interpolation line on each region boundary; based on each edge point, segmenting the corresponding interpolation line, and using each edge point as an endpoint of the segmented interpolation line.

[0007] In one embodiment of the present invention, for any initial boundary, the interpolation operation includes: obtaining level boundary points between all adjacent pixels based on the slope level of the pixels on both sides of the initial boundary; each level boundary point is used to characterize the boundary point between two adjacent slope levels; and connecting the boundary points characterizing the same slope level sequentially to obtain each interpolation line.

[0008] In one embodiment of the present invention, for any two adjacent pixels on both sides of the initial boundary, the method for obtaining each level boundary point includes: obtaining a level difference based on the slope level corresponding to the two adjacent pixels; obtaining the number of level boundary points based on the level difference; connecting the center points of the two adjacent pixels to obtain a first line segment, and based on the number of level boundary points, making each level boundary point evenly distributed on the first line segment to obtain each level boundary point.

[0009] In one embodiment of the present invention, for any pixel, the slope value calculation method includes: obtaining the elevation values ​​of the pixel and its eight adjacent pixels based on the elevation raster data; calculating a first increment of the pixel in the first direction based on the elevation values ​​of the pixel and the six pixels on both sides in the first direction; calculating a second increment of the pixel in the second direction based on the elevation values ​​of the pixel and the six pixels on both sides in the second direction; and calculating the slope value of the pixel based on the square root of the sum of the squares of the first increment and the second increment.

[0010] In one embodiment of the present invention, each pixel is divided into nine slope levels based on the slope value; wherein, when the slope value is in the range of [0°, 2°], the slope level is level 1; when the slope value is in the range of (2°, 6°], the slope level is level 2; when the slope value is in the range of (6°, 15°], the slope level is level 3; when the slope value is in the range of (15°, 25°], the slope level is level 4; when the slope value is in the range of (25°, 30°], the slope level is level 5; when the slope value is in the range of (30°, 35°], the slope level is level 6; when the slope value is in the range of (35°, 40°], the slope level is level 7; when the slope value is in the range of (40°, 45°], the slope level is level 8; and when the slope value is in the range of (45°, 90°), the slope level is level 9. At that time, the slope level was level 9.

[0011] In one embodiment of the present invention, the simplification process includes: smoothing process and generalization process.

[0012] Secondly, this application provides a slope map generation system, including a grading module, an interpolation module, and a slope map generation module; the grading module is used to acquire elevation raster data of a target area, calculate the slope value corresponding to each pixel, divide the area into slope levels based on the slope value, and perform a merging operation on each pixel to form initial slope regions; the interpolation module is used to acquire the initial boundaries of each initial slope region; perform linear interpolation on each initial boundary to generate corresponding interpolation lines, and simplify each interpolation line to form interpolation boundaries; the slope map generation module is used to divide each slope region based on each interpolation boundary to generate a slope map corresponding to the target area.

[0013] Thirdly, this application provides a terminal, including: a processor and a memory, wherein the memory and the processor are communicatively connected;

[0014] The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory so that the terminal performs the slope map generation method as described above.

[0015] Fourthly, this application provides a computer storage medium storing a computer program that, when executed by a processor, implements the slope map generation method as described above.

[0016] As described above, the slope map generation method, system, terminal, and medium of this application accurately re-divide the boundaries of each slope region by performing linear interpolation on each initial boundary, obtaining smoother and more accurate interpolation lines, and further improving the smoothness of the slope region boundaries through simplified processing, thereby effectively improving the display effect of the slope map and having high industrial application value. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of a slope map generated by an existing method.

[0018] Figure 2 The diagram shown is a flowchart illustrating a slope map generation method according to an embodiment of this application.

[0019] Figure 3 The diagram shown is a flowchart illustrating a slope value calculation method as described in an embodiment of this application.

[0020] Figure 4 The image shown is a schematic diagram illustrating the pixel distribution of elevation raster data as described in an embodiment of this application.

[0021] Figure 5 This diagram illustrates a scenario of pixel merging at the same level as described in an embodiment of this application.

[0022] Figure 6 The diagram shown is a flowchart illustrating an interpolation operation as described in an embodiment of this application.

[0023] Figure 7 The diagram shown is a schematic representation of an interpolation line as described in an embodiment of this application.

[0024] Figure 8 The diagram shown is a flowchart illustrating a method for obtaining level boundary points as described in an embodiment of this application.

[0025] Figure 9 This is a schematic diagram illustrating another interpolation line configuration as described in an embodiment of this application.

[0026] Figure 10 The image shown is a schematic diagram of a slope map generated according to an embodiment of this application.

[0027] Figure 11 The diagram shown is a schematic representation of the boundary conditions of a slope map of two regions generated according to an embodiment of this application.

[0028] Figure 12 The diagram shown is a flowchart illustrating an interpolation line splicing method according to an embodiment of this application.

[0029] Figure 13 This is a schematic diagram showing the boundary conditions of another type of slope map of two regions generated by an embodiment of this application.

[0030] Figure 14 The diagram shown is a structural schematic of a slope map generation system according to an embodiment of this application.

[0031] Figure 15 The diagram shown is a structural schematic of a terminal as described in an embodiment of this application.

[0032] Explanation of reference numerals in the attached figures

[0033] 41: Hierarchical module; 42: Interpolation module; 43: Slope map generation module; 50: Terminal; 51: Processor; 52: Memory; 521: Operating system; 522: Application program; 53: User interface; 54: Network interface; 55: Bus system. Detailed Implementation

[0034] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0035] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0036] Existing methods for generating slope maps typically involve first converting raster data into vector surfaces, then classifying slopes and merging areas of the same grade to divide the region into slope maps. However, slope maps generated using this method often exhibit jagged edges at the region boundaries. (See [link to previous section]). Figure 1 This results in a poor presentation of the slope map, with both low accuracy and poor continuity.

[0037] To address the technical problems existing in the prior art, the following embodiments of this application provide a slope map generation method, system, terminal, and medium. By interpolating each initial boundary, interpolation lines are obtained, and after simplification processing, smooth interpolation boundaries are formed. Slope regions are divided based on each interpolation boundary, thereby making the generated slope map have smooth boundaries of each slope region, good continuity, and high accuracy, thus improving the display effect of the slope map.

[0038] The technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0039] like Figure 2 As shown, this embodiment provides a method for generating slope maps, including:

[0040] S100: Based on the spatial range of the target area, obtain the corresponding elevation raster data; based on the elevation raster data, calculate the slope value corresponding to each pixel, and divide each pixel into slope levels based on the slope value to generate each initial slope area.

[0041] The elevation raster data represents the elevation status of the land surface within the spatial range corresponding to the target area. Specifically, the land surface height is calculated based on multi-angle remote sensing images to form the elevation raster data. Those skilled in the art should know the specific acquisition methods and execution principles of elevation raster data, which will not be specifically explained in this embodiment. For example, the elevation raster data is 5-meter grid DEM (Digital Elevation Model) data.

[0042] Each pixel represents the smallest unit on the slope map. It's important to note that the slope map is displayed as a multi-level tile structure; therefore, the size of a single pixel is actually the size of the tile covering the smallest geographic area. In other words, the size of a single pixel is the size of the highest-level single tile in the slope map. For example, the size of a single pixel is equal to the size of a single grid cell in the elevation raster data; that is, the size of the highest-level tile in the generated slope map is equal to the size of a single grid cell in the elevation raster data.

[0043] In some alternative implementations, existing geographic information system applications are used to calculate the slope value of each pixel from the elevation raster data. For example, the Slope tool in ArcGIS Pro is used to calculate the slope value of each pixel from the DEM data.

[0044] In other alternative implementations, such as Figure 3 As shown, for any pixel, the slope value is calculated as follows:

[0045] S101, based on elevation raster data, obtain the elevation values ​​of the pixel and its eight adjacent pixels.

[0046] Specifically, for any pixel, the elevation values ​​of the pixel and its eight neighboring pixels in the corresponding grid in the elevation raster data are extracted and used as the elevation values ​​of the pixel and its eight neighboring pixels.

[0047] For example, such as Figure 4 As shown, to calculate the slope value of pixel e, the elevation values ​​of nine pixels a, b, c, d, e, f, g, h, and i are extracted from the elevation raster data.

[0048] S102, based on the elevation values ​​of the pixel and the six pixels on either side of it in the first direction, calculate the first increment of the pixel in the first direction; and based on the elevation values ​​of the pixel and the six pixels on either side of it in the second direction, calculate the second increment of the pixel in the second direction.

[0049] Wherein, the first direction and the second direction are two mutually perpendicular directions. For example, as shown... Figure 4 As shown, the first direction is the horizontal direction, that is... Figure 4 The direction of 'def' is the first direction, and the second direction is the perpendicular direction, i.e. Figure 4 The direction of beh. Based on this, the six pixels on both sides of pixel e in the first direction are pixels a, c, d, f, g, i, and the six pixels on both sides of pixel e in the second direction are pixels a, b, c, g, h, i.

[0050] Furthermore, the first increment of pixel e in the horizontal direction is calculated based on pixels a, c, d, f, g, i, and the elevation value of pixel e. Specifically, the formula for calculating the first increment is:

[0051]

[0052] in, The first increment of pixel e in the horizontal direction. The elevation value representing pixel a The elevation value representing pixel c, The elevation value of pixel d. The elevation value of pixel f. The elevation value of pixel g is represented. The elevation value of pixel i. It represents the width of a single pixel in the horizontal direction.

[0053] Similarly, the second increment of pixel e in the vertical direction is calculated based on pixels a, b, c, g, h, i, and the elevation value of pixel e. Specifically, the formula for calculating the second increment is:

[0054]

[0055] in, The second increment representing pixel e in the vertical direction. The elevation value representing pixel a The elevation value of pixel b. The elevation value representing pixel c, The elevation value of pixel g is represented. The elevation value of pixel h. The elevation value of pixel i. It represents the width of a single pixel in the vertical direction.

[0056] S103, calculate the slope value of the pixel based on the square root of the sum of the squares of the first and second increments.

[0057] Specifically, the formula for calculating the slope value is:

[0058]

[0059] in, The slope value that represents the pixel.

[0060] Furthermore, it should be noted that the slope value calculated by the above formula... The unit of slope is radians, but in practical applications, the unit of slope value usually needs to be converted to degrees. Based on this, the slope value can be characterized as:

[0061]

[0062] in, The slope value representing a pixel, in degrees. for The calculation result is accurate to five decimal places.

[0063] Based on this, the slope value corresponding to each pixel can be calculated.

[0064] Furthermore, each pixel is divided into different slope levels based on the slope value, and adjacent pixels of the same level are merged to form initial slope regions.

[0065] For example, each pixel is divided into nine slope levels based on its slope value. Specifically, slope level 1 is when the slope value is in the range of [0°, 2°], slope level 2 is when the slope value is in the range of (2°, 6°], slope level 3 is when the slope value is in the range of (6°, 15°], slope level 4 is when the slope value is in the range of (15°, 25°], slope level 5 is when the slope value is in the range of (25°, 30°], slope level 6 is when the slope value is in the range of (30°, 35°], slope level 7 is when the slope value is in the range of (35°, 40°], slope level 8 is when the slope value is in the range of (40°, 45°], and slope level 9 is when the slope value is in the range of (45°, 90°].

[0066] Furthermore, such as Figure 5 As shown, adjacent pixels at the same level are merged, that is, pixels at the same level that have a contact boundary are divided into the same level to form initial slope regions.

[0067] Furthermore, to improve processing efficiency for large data volumes, this embodiment also uses SDE (Spatial Database Engine) to create a dedicated database environment for storing and managing spatial data in the PostgreSQL database. This environment stores elevation raster data in the database and employs a multi-core parallel computing mode for calculation and pixel merging to improve data processing speed, reduce data processing time, and increase the efficiency of slope map generation.

[0068] S200: Obtain the initial boundaries of each initial slope region; perform interpolation operations on each initial boundary to generate the corresponding interpolation lines.

[0069] The initial boundaries are the boundary lines between the initial slope regions. For example... Figure 5 As shown, the solid lines in the right-hand image represent the initial boundaries.

[0070] Interpolation is performed on each initial boundary to generate corresponding interpolation lines. That is, based on the slope level of the pixels on both sides of each initial boundary, the boundary of the slope region is accurately redefined to improve the accuracy of the slope region boundary and make the boundary smoother.

[0071] Specifically, such as Figure 6 As shown, the interpolation operation is performed for any initial boundary, including:

[0072] S210: Based on the slope level of the pixels on both sides of the initial boundary, obtain the boundary points of each level between all adjacent pixels.

[0073] The boundary points of each level are used to characterize the boundary between two adjacent slope levels.

[0074] Specifically, since slope changes are generally continuous, for any two adjacent pixels on either side of the initial boundary, the slope on the side where they touch has a change spanning slope levels. By interpolation, the boundary points spanning slope levels between these two adjacent pixels are determined, i.e., the level boundary points. Connecting other boundary points yields an interpolation line as the new boundary. For example, linear interpolation is used to determine the level boundary points between two adjacent pixels.

[0075] Furthermore, to facilitate understanding by those skilled in the art of obtaining the boundary points of each level in this embodiment, the following will use the method of... Figure 7 The following is a detailed explanation using the example of obtaining the boundary points of each level by performing linear interpolation on the initial boundary A.

[0076] Specifically, for any two adjacent pixels on either side of the initial boundary A, such as Figure 8 As shown, the methods for obtaining the boundary points of each level include:

[0077] S211, based on the slope level corresponding to the two adjacent pixels, obtain the level difference.

[0078] The level difference is the difference in slope level between two adjacent pixels.

[0079] For example, such as Figure 7 The three pixels j, k, and l shown are as follows: pixel j and pixel k are adjacent, pixel j has a slope level of 9 and pixel k has a slope level of 8, so the level difference is 1; pixel j and pixel l are adjacent, pixel j has a slope level of 9 and pixel l has a slope level of 7, so the level difference is 2; and so on.

[0080] S212, based on the level difference, obtain the number of level boundary points.

[0081] Specifically, the number of level dividing points is the same as the level difference.

[0082] For example, there is one level boundary between pixel j and pixel k, and two level boundary between pixel j and pixel l.

[0083] S213, connect the center points of the two adjacent pixels to obtain a first line segment, and based on the number of level boundary points, make the level boundary points evenly distributed on the first line segment to obtain the level boundary points.

[0084] It should be noted that since the slope change is generally continuous, the slope change is also continuous along the line connecting the center points of two adjacent pixels, i.e., on the first line segment. Based on this, a linear interpolation method is used to obtain the boundary points for each level. This means that the first line segment is evenly divided into multiple segments, and the endpoints of each segment are the boundary points for each level. The number of segments in the first line segment is one more than the number of level boundary points.

[0085] For example, such as Figure 7 As shown, connect the center points of pixel j and pixel k to obtain the first line segment B, and divide the first line segment B into two line segments of the same length. Use the endpoint C of the two line segments as the level boundary point between pixel j and pixel k, which is the 9th level and the 8th level. Connect the center points of pixel j and pixel l to obtain the first line segment D, and divide the first line segment D into three line segments of the same length. Use the endpoint E and endpoint F of the three line segments as the level boundary point between pixel j and pixel l, where endpoint E is the level boundary point between the 9th level and the 8th level, and endpoint F is the level boundary point between the 8th level and the 7th level.

[0086] Based on the above method, by traversing all adjacent pixels on both sides of the initial boundary A, all level boundary points on both sides of the initial boundary can be obtained. For details, please refer to... Figure 7 The red and blue dots shown are all the level boundaries on both sides of the initial boundary A. The red dots are the level boundaries between level 9 and level 8, and the blue dots are the level boundaries between level 8 and level 7.

[0087] S220, connect the boundary points representing two slope classes in sequence to obtain the interpolation lines.

[0088] For example, such as Figure 9 As shown in the figure, the red and blue dots are level boundary points. The red dots are the level boundary between level 9 and level 8, and the blue dots are the level boundary between level 8 and level 7. Based on this, an interpolation line is formed by connecting all the red dots to serve as the boundary between level 9 and level 8, and an interpolation line is formed by connecting all the blue dots to serve as the boundary between level 8 and level 7.

[0089] Furthermore, the execution method for sequentially connecting the level boundary points includes: randomly setting a point as the initial point, and connecting at least one level boundary point within a preset distance, using the connected level boundary point as the newest initial point, and repeatedly connecting at least one level boundary point within the preset distance until the initial point cannot find any unconnected connectable level boundary points within the preset distance, at which point the connection stops. It should be noted that the value of the preset distance can be set by those skilled in the art according to actual conditions, and this embodiment does not impose specific limitations. For example, the preset distance is 5 meters.

[0090] For example, such as Figure 9 As shown, black represents the initial boundary, red interpolation lines are the boundary between level 9 and level 8, and blue interpolation lines are the boundary between level 8 and level 7. Clearly, using interpolation lines as boundaries, compared to the initial boundary, not only provides higher accuracy but also smoother lines, thus effectively improving the presentation of the generated slope map.

[0091] It should be noted that, in order to further improve the smoothness of the boundaries and enhance the presentation of the slope map, the interpolation lines are simplified to form the interpolation boundaries.

[0092] In some optional implementations, the simplification process includes smoothing and generalization. Smoothing eliminates sharp angles on the interpolation line, while generalization reduces redundant nodes to make the generated interpolation boundary smoother. Furthermore, a tolerance threshold is set during generalization to limit the distance between the interpolation line after reducing redundant nodes and the interpolation line before generalization within the tolerance threshold, ensuring boundary accuracy. For example, the tolerance threshold is 1 meter, meaning the maximum offset distance between the interpolation line after generalization and the interpolation line before generalization does not exceed 1 meter. It should be noted that those skilled in the art should understand the specific implementation methods and principles of smoothing and generalization, which will not be specifically explained in this embodiment.

[0093] S300 divides the slope regions based on each interpolation boundary to generate a slope map corresponding to the target region.

[0094] For example, the area enclosed by the interpolation boundaries of level 9 and level 8 is defined as the slope area of ​​level 9, the area enclosed by the interpolation boundaries of level 9 and level 8 and the interpolation boundaries of level 8 and level 7 is defined as the slope area of ​​level 8, the area enclosed by the interpolation boundaries of level 8 and level 7 and the interpolation boundaries of level 7 and level 6 is defined as the slope area of ​​level 7, and so on.

[0095] Further, please see Figure 10 The image displayed is a slope map obtained based on the slope map generation method of this embodiment, relative to... Figure 1Compared with existing technologies, the slope map generated in this embodiment has smooth and jagged boundaries, presents a better effect, and has higher accuracy.

[0096] It should be noted that for generating slope maps over a large area, it is usually necessary to divide the map into multiple regions for processing to improve efficiency. For example, each region typically does not exceed 2,000 square kilometers. For instance, for generating slope maps within a provincial region, it is usually divided into multiple city-level regions, and the slope maps of multiple city-level regions are obtained and stitched together to form the slope map of the provincial region.

[0097] However, because the interpolation lines generated in each region need to undergo smoothing and generalization to improve the presentation, these processes modify the nodes of the interpolation lines. This causes changes in the intersection points of the interpolation lines with the boundaries of each region, potentially leading to misalignment of the interpolation boundaries when stitching together slope maps from different regions. Figure 11 As shown, the slope map boundary of two regions is displayed. However, the slope regions at the boundary are not perfectly aligned, and the connection problem is obvious.

[0098] Therefore, to improve the stitching effect of slope maps in different regions, in this embodiment, when extracting elevation raster data in step S100, an extended spatial range is obtained based on the spatial range of the target region, and the elevation raster data corresponding to the extended spatial range is extracted for subsequent processing. It should be noted that because the extended spatial range extends beyond the boundary of the target region's spatial range, the interpolation lines subsequently obtained based on the elevation raster data also exceed the spatial range of the target region, thus assisting in achieving seamless connection between slope maps and other regions.

[0099] The outer expansion space range is the range of a preset number of pixel rows extended outward from the boundary of the target area space range. For example, the outer expansion space range is the range of 10 pixel rows extended outward from the boundary of the target area space range.

[0100] Furthermore, to achieve seamless integration between slope maps of different regions, the intersection points of the interpolation lines on the boundary of the target region need to remain unchanged after smoothing and generalization. Based on this, as follows... Figure 12 As shown, in this embodiment, after generating each interpolation line and before performing simplification processing, the following steps are also included:

[0101] S230: Obtain the region boundary based on the spatial range of the target region.

[0102] Among them, the region boundary is used to characterize the boundary of the target region.

[0103] S240, based on the region boundary, obtain the intersection points of each interpolation line on the region boundary.

[0104] The location of each junction point is the intersection of each interpolation line with the region boundary.

[0105] S250, based on each edge point, divides the corresponding interpolation line, and uses each edge point as an endpoint of the divided interpolation line.

[0106] Specifically, each intersection point is used as the endpoint of the interpolation line, that is, the intersection of each interpolation line with the region boundary is used as the fixed endpoint to ensure that it remains unchanged in the subsequent smoothing and generalization processes, thereby avoiding changes in the position of the interpolation boundary on the region boundary after simplification, so as to achieve seamless connection with the slope map of other regions.

[0107] Furthermore, since the range of the elevation raster data extracted in this embodiment is larger than the target area, the range of the subsequently acquired slope map is also larger than the target area. Based on this, in this embodiment, after dividing each slope region into slope regions and generating a slope map in step S300, the slope map is cropped based on the spatial range of the target area to generate a slope map corresponding to the target area.

[0108] like Figure 13 As shown, this illustrates the boundary stitching of two slope maps generated by the slope map generation method of this embodiment, relative to... Figure 11 In the slope diagrams in this embodiment, the slope areas of the two slope diagrams are well aligned, with no obvious seams, and the connection is good.

[0109] like Figure 14 As shown, the slope map generation system provided in this embodiment includes a grading module 41, an interpolation module 42, and a slope map generation module 43.

[0110] The grading module 41 is used to acquire the elevation raster data of the target area, calculate the slope value corresponding to each pixel, divide it into slope levels based on the slope value, and perform a merging operation on each pixel to form each initial slope area.

[0111] The interpolation module 42 is used to obtain the initial boundaries of each initial slope region; to perform linear interpolation operations on each initial boundary to generate corresponding interpolation lines; and to simplify each interpolation line to form each interpolation boundary.

[0112] The slope map generation module 43 is used to divide the slope regions based on each interpolation boundary in order to generate the slope map corresponding to the target region.

[0113] Based on the same technical concept, the slope map generation method provided in this embodiment of the invention can be implemented on the terminal side or the server side.

[0114] like Figure 15The diagram illustrates an optional hardware structure of a terminal according to an embodiment of the present invention. The terminal 50 can be a mobile phone, computer device, tablet device, personal digital processing device, factory back-end processing device, etc. The terminal 50 includes at least one processor 51, a memory 52, at least one network interface 54, and a user interface 53. The various components in the device are coupled together via a bus system 55. It is understood that the bus system 55 is used to realize communication between these components. In addition to a data bus, the bus system 55 also includes a power bus, a control bus, and a status signal bus.

[0115] The user interface 53 may include a monitor, keyboard, mouse, trackball, clicker, button, touchpad, or touch screen.

[0116] It is understood that memory 52 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM) or programmable read-only memory (PROM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memory characterized in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable categories of memory.

[0117] In this embodiment of the invention, the memory 52 is used to store various types of data to support the operation of the terminal. Examples of this data include: any executable program for operation on the terminal 50, such as the operating system 521 and application programs 522; the operating system 521 contains various system programs, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks. Application programs 522 may contain various applications, such as media players, browsers, etc., for implementing various application services. The slope map generation method provided in this embodiment of the invention can be included in application program 522.

[0118] The methods disclosed in the above embodiments of the present invention can be applied to processor 51, or implemented by processor 51. Processor 51 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 51 or by instructions in the form of software. The processor mentioned above may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 51 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present invention. Processor 51 may be a microprocessor or any conventional processor, etc. The steps of the accessory optimization method provided in the embodiments of the present invention can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in a memory. The processor reads the information in the memory and combines it with its hardware to complete the steps of the aforementioned method.

[0119] In an exemplary embodiment, terminal 50 may be used by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), or complex programmable logic devices (CPLDs) to execute the aforementioned method.

[0120] This invention also provides a computer-readable storage medium storing a computer program that, when invoked by a processor, implements the slope map generation method provided by this invention.

[0121] Computer-readable storage media can be tangible devices capable of holding and storing instructions used by an instruction execution device. Computer-readable storage media can be, for example, (but not limited to) electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, and mechanical encoding devices.

[0122] The computer-readable program represented herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network, to an external computer or external storage device. A network adapter card or network interface in each computing / processing device receives computer-readable program instructions from the network and forwards these instructions to the computer-readable storage medium in the respective computing / processing device.

[0123] In summary, this application performs linear interpolation on each initial boundary, accurately re-divides the boundaries of the slope region based on the pixel slope level on both sides of each initial boundary, and obtains each interpolation line to improve the accuracy of the slope region boundaries and make the boundaries smoother. As a result, the generated slope map has smooth and high-precision boundaries of each slope region, and has a good display effect.

[0124] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.

[0125] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A method for generating a slope map, comprising: Based on the spatial range of the target area, the outer spatial range is obtained, and based on the outer spatial range, the corresponding elevation raster data is extracted; Based on the elevation raster data, the slope value corresponding to each pixel is calculated, and each pixel is divided into slope levels based on the slope value to generate each initial slope region. Obtain the initial boundaries of each initial slope region; perform interpolation operations on each initial boundary to generate corresponding interpolation lines, and simplify each interpolation line to form interpolation boundaries; After generating each interpolation line and before performing simplification processing, the method further includes: obtaining the boundaries of each region based on the spatial range of the target region; obtaining the connection points of each interpolation line on each region boundary based on each region boundary; dividing the corresponding interpolation line based on each connection point, and using each connection point as an endpoint of the divided interpolation line. Based on the interpolation boundaries, each slope region is divided to generate a slope map corresponding to the target region. For any of the initial boundaries, the interpolation operation includes: obtaining the level boundary points between all adjacent pixels based on the slope level of the pixels on both sides of the initial boundary; each level boundary point is used to characterize the boundary point between two adjacent slope levels; and connecting the boundary points that characterize the same slope level in sequence to obtain each interpolation line. For any two adjacent pixels on both sides of the initial boundary, the method for obtaining each level boundary point includes: obtaining a level difference based on the slope level corresponding to the two adjacent pixels; obtaining the number of level boundary points based on the level difference; connecting the center points of the two adjacent pixels to obtain a first line segment, and based on the number of level boundary points, making each level boundary point evenly distributed on the first line segment to obtain each level boundary point.

2. The method according to claim 1, characterized in that, For any pixel, the slope value is calculated as follows: Based on the elevation raster data, obtain the elevation values ​​of the pixel and its eight adjacent pixels; Based on the elevation values ​​of the pixel and the six pixels on either side of it in the first direction, a first increment of the pixel in the first direction is calculated; and based on the elevation values ​​of the pixel and the six pixels on either side of it in the second direction, a second increment of the pixel in the second direction is calculated. The slope value of the pixel is calculated based on the square root of the sum of the squares of the first and second increments; the formula for calculating the slope value is: ; in, The slope value that characterizes the pixel; The first increment characterizing the pixel; The second increment characterizes the pixel.

3. The method according to claim 1, characterized in that, Based on the slope value, each pixel is divided into nine slope levels; wherein, when the slope value is in [0°, 2°], the slope level is level 1; when the slope value is in (2°, 6°], the slope level is level 2; when the slope value is in (6°, 15°], the slope level is level 3; when the slope value is in (15°, 25°], the slope level is level 4; when the slope value is in (25°, 30°], the slope level is level 5; when the slope value is in (30°, 35°], the slope level is level 6; when the slope value is in (35°, 40°], the slope level is level 7; when the slope value is in (40°, 45°], the slope level is level 8; and when the slope value is in (45°, 90°], the slope level is level 9.

4. The method according to claim 1, characterized in that, The simplification process includes: smoothing and generalization.

5. A slope map generation system, characterized in that, It includes a grading module, an interpolation module, and a slope map generation module; The hierarchical module is used to acquire elevation raster data of the target area, calculate the slope value corresponding to each pixel, divide the area into slope levels based on the slope value, and perform a merging operation on each pixel to form each initial slope area; wherein, based on the spatial range of the target area, an outer spatial range is acquired, and based on the outer spatial range, the corresponding elevation raster data is extracted. The interpolation module is used to obtain the initial boundaries of each initial slope region; perform linear interpolation on each initial boundary to generate corresponding interpolation lines; and simplify each interpolation line to form interpolation boundaries. After generating each interpolation line and before performing simplification processing, the method further includes: obtaining the boundaries of each region based on the spatial range of the target region; obtaining the connection points of each interpolation line on each region boundary based on each region boundary; dividing the corresponding interpolation line based on each connection point, and using each connection point as an endpoint of the divided interpolation line. The slope map generation module is used to divide each slope region based on each interpolation boundary to generate a slope map corresponding to the target region. For any of the initial boundaries, the interpolation operation includes: obtaining the level boundary points between all adjacent pixels based on the slope level of the pixels on both sides of the initial boundary; each level boundary point is used to characterize the boundary point between two adjacent slope levels; and connecting the boundary points that characterize the same slope level in sequence to obtain each interpolation line. For any two adjacent pixels on both sides of the initial boundary, the method for obtaining each level boundary point includes: obtaining a level difference based on the slope level corresponding to the two adjacent pixels; obtaining the number of level boundary points based on the level difference; connecting the center points of the two adjacent pixels to obtain a first line segment, and based on the number of level boundary points, making each level boundary point evenly distributed on the first line segment to obtain each level boundary point.

6. A terminal, characterized in that, include: A processor and a memory, wherein the memory and the processor are communicatively connected; The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to cause the terminal to perform the slope map generation method as described in any one of claims 1-4.

7. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the slope map generation method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Method and device for extracting gradient information of farmland planar pattern spots

    CN111583359A

  • Water body monitoring method and device based on live-action three-dimensional terrain

    CN114998530A

  • Ground parcel line close-to-ground rendering method and system and computer readable storage medium

    CN120182455A