Curved surface trend intelligent optimization method and implementation tool
Through the intelligent optimization method of surface trends, the relationship between contour lines and grid topology in the geographic information system is solved, and the problems of limited accuracy and complex operation in the existing technology are solved, thereby achieving higher accuracy and faster data processing.
Patent Information
- Application Number
- CN202411553203.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art has limited accuracy and complex operation when dealing with the relationship between contour lines and grid topology in geographic information systems, especially in complex terrain and large-scale data processing scenarios, resulting in increased data distortion and processing complexity.
The intelligent optimization method of surface trends is adopted, including importing contour lines and basic mesh data from the data source, identifying the intersection points between contour lines and mesh through spatial geometry algorithms, applying a nonlinear interpolation algorithm for accurate calculations, and using an optimization algorithm to identify and correct topological contradictions to generate the final topological structure.
It improves the relationship accuracy of contour lines and grid intersection points and regional boundaries, reduces the need for manual adjustment, is suitable for large-scale terrain analysis and resource evaluation, and significantly improves the system response speed.
Smart Images

Figure CN119516135A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data exchange, and in particular to a surface trend intelligent optimization method and an implementation tool. Background Art
[0002] In geographic information systems, isolines (such as contour lines and isotherms) are usually used to represent the connecting lines of points with the same value in space, and spatial surfaces are used to represent the change of data trends. The existing technology has deficiencies in accuracy and operation complexity. Especially in complex terrain and large-scale data processing scenarios, complex data processing is often required to obtain reasonable trends and high-precision graphics.
[0003] However, when dealing with the topological relationship between contour lines and grids, traditional methods often use linear interpolation technology for data analysis and processing, which requires a lot of computation and the reconstruction process of contour lines and grids has limited accuracy, resulting in inaccurate spatial analysis results and prone to data distortion. When dealing with complex contour line data, users need to make a lot of manual adjustments, which increases the complexity and workload of data processing. In view of this, we propose a surface trend intelligent optimization method and implementation tool. Summary of the invention
[0004] The purpose of the present invention is to provide a surface trend intelligent optimization method and implementation tools to solve the problems raised in the above background technology.
[0005] In order to solve the above technical problems, one of the purposes of the present invention is to provide a surface trend intelligent optimization method, comprising the following steps:
[0006] S1. Importing the contour data and basic grid data of the terrain from the data source. The contour data is represented in vector form, which is a series of coordinate sequences of points, each point representing a position on the contour line. The basic grid data is represented as a set of vertex coordinates of rectangles and polygons, which are used to construct the spatial framework of the terrain.
[0007] S2, based on the spatial geometry algorithm, identify the area where the contour line passes through the grid, calculate the intersection of each contour line with the grid nodes and edges, generate a set of preliminary topological models, and preliminarily construct the topological relationship between the two;
[0008] S3, accurately calculating the position of the contour line in the grid by applying a nonlinear interpolation algorithm to determine the intersection point between the contour line and the grid;
[0009] S4. Use optimization algorithms to identify topological contradictions in abnormal areas, automatically generate editing suggestions based on topological relationships, and automatically process the correction and adjustment of topological structures;
[0010] S5. After interpolation and topology optimization, the final topology structure is generated, the complete topological relationship between the contour lines and the grid is output, and the format of the final topological data is output.
[0011] Preferably, generating a topology model in S2 comprises the following steps:
[0012] Through a contour line and a network, the contour line is composed of multiple points and the grid is composed of vertices. The intersection between each line segment on the contour line and each edge of the grid is numerically calculated, and all the calculated intersections are classified. The classification includes the intersection of the contour line and the grid and the intersection of the contour line and the grid node. The topological relationship between the contour line and the grid is preliminarily represented, which is used to record which grid edges each contour line segment intersects with and the specific location of the intersection.
[0013] Preferably, the nonlinear interpolation algorithm in S3 comprises the following steps:
[0014] Receive which grid edges each contour line segment intersects with and the specific location of the intersection. Read the grid data containing elevation information, parameterize the points on the contour lines, and the parameter value of each point represents the cumulative distance from the starting point to the point. Under the condition of having second-order continuous derivatives on the entire definition domain, fit and establish multiple spline interpolation to form a system of equations, solve the equations in matrix form, obtain the intersection of the contour lines and line segments, and use the intersection algorithm of the line segment and the curve to check whether it intersects with a certain segment of the contour line. If so, output the specific location of the intersection.
[0015] Preferably, the optimization algorithm in S4 includes a Gaussian filter grid smoothing algorithm and an image gradient-based fault shrinkage algorithm;
[0016] The Gaussian filter grid smoothing algorithm is used to smooth the contour data and the basic grid data to reconstruct the intersection and solve the intersection misalignment;
[0017] The image gradient-based fault shrinking algorithm is used to identify edges and faults in an image by calculating the gradient information of the image, and perform shrinking processing to reconstruct the boundary and solve the topological discontinuity.
[0018] Preferably, the Gaussian filtering grid smoothing algorithm comprises the following steps:
[0019] Import the contour data and base grid data, and convert the contour data into image format, where each pixel value represents the height of the point;
[0020] Run the Gaussian filter grid smoothing algorithm: select the appropriate standard deviation according to the required filtering effect, and determine the size of the convolution kernel. For each position in the convolution kernel, calculate the corresponding Gaussian weight, and in order to ensure that the pixel value after convolution is still within a reasonable range, normalize the Gaussian kernel so that the sum of all its weights is 1. For each pixel in the image, calculate the weighted average value in its neighborhood, increase the weight value of the center point, and reduce the weight value far away from the center point, retaining the main features of the image while smoothing out small noise.
[0021] Preferably, after the contour data and the basic grid data are smoothed, the image gradient-based fault shrinkage algorithm comprises the following steps:
[0022] Three gradient filters are used to calculate the derivative of image gradients. The gradient filters include Sobel filter, Scharr filter and Laplacian filter.
[0023] Use the Sobel filter to calculate the gradient of the image in the x and y directions, use the Scharr filter to solve the gradient angle in the case of a 3x3 convolution kernel, and use the Laplacian filter to calculate the second-order derivative of the image;
[0024] Combine the gradients in the x and y directions, calculate the gradient magnitude, and use a threshold to convert the gradient magnitude into a binary image, extract the edges, detect the contours in the image, approximate the contours, calculate the contour area and perimeter, and indent as needed.
[0025] Preferably, generating the final topological structure in S5 comprises the following steps:
[0026] Set the influence radius, control strength and constraint radius parameters, call out the intersection and boundary of the reconstructed contour line and grid, reconstruct the contour line data and basic grid data, and receive the specific location of the intersection output by the nonlinear interpolation algorithm;
[0027] The reconstructed contour data, basic grid data and specific intersection locations form the final topological structure.
[0028] The second object of the present invention is to provide a surface trend intelligent optimization implementation tool, including any one of the surface trend intelligent optimization methods described above, including a data model module, a business operation module and a view interaction module;
[0029] The data model module is used to define the data source in S1 as the structure of input data and output data, including contour data and basic grid data.
[0030] The business operation module is used to load contour data and basic grid data, and establish a topological relationship through S2.
[0031] The view interaction module is used to realize the visual display window of data and the user interaction interface.
[0032] Compared with the prior art, the present invention has the following beneficial effects:
[0033] 1. By applying a nonlinear interpolation algorithm, the position of the contour lines in the grid is accurately calculated to determine the intersection points between the contour lines and the grid. Compared with the traditional linear interpolation algorithm, a more complex nonlinear interpolation technology is used, which can more accurately handle the changes in the bends of the contour lines and ensure that the relationship between the intersection points of the contour lines and the grid and the regional boundaries is more consistent with the actual terrain data.
[0034] 2. Use optimization algorithms to identify topological contradictions in abnormal areas, automatically generate editing suggestions based on topological relationships, and automatically handle the correction and adjustment of topological structures. Users do not need to perform complicated manual operations, and small-scale adjustments are automatically completed, reducing human intervention and ensuring the rationality and consistency of the intersection of grids and contour lines. At the same time, it can quickly process large-scale data and significantly improve the system response speed, making it suitable for large-scale terrain analysis and resource assessment scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is an overall flow chart of Example 1;
[0036] Figure 2 This is an overall principle block diagram of Example 1. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] In geographic information systems, isolines (such as contour lines and isotherms) are usually used to represent the connecting lines of points with the same value in space, and spatial surfaces are used to represent the changes in data trends. The existing technology has deficiencies in accuracy and operation complexity. Especially in complex terrain and large-scale data processing scenarios, complex data processing is often required to obtain reasonable trends and high-precision graphics, such as Figure 1-2 As shown, one of the purposes of the present invention is to provide a surface trend intelligent optimization method, comprising the following steps:
[0039] S1. Importing the contour data and basic grid data of the terrain from the data source. The contour data is represented in vector form, which is a series of coordinate sequences of points, each point representing a position on the contour line. The basic grid data is represented as a set of vertex coordinates of rectangles and polygons, which are used to construct the spatial framework of the terrain.
[0040] S2, based on the spatial geometry algorithm, identify the area where the contour line passes through the grid, calculate the intersection of each contour line with the grid nodes and edges, generate a set of preliminary topological models, and preliminarily construct the topological relationship between the two;
[0041] S3. By applying nonlinear interpolation algorithms, the positions of contour lines in the grid are accurately calculated to determine the intersection points between contour lines and the grid. Compared with the traditional linear interpolation algorithm, a more complex nonlinear interpolation technology is used, which can more accurately handle the changes in the bends of contour lines and ensure that the relationship between the intersection points of contour lines and grids and the regional boundaries is more consistent with the actual terrain data;
[0042] S4. Use optimization algorithms to identify topological contradictions in abnormal areas (such as misaligned intersections or topological discontinuities), automatically generate editing suggestions based on topological relationships, and automatically handle the correction and adjustment of topological structures. Users do not need to perform complicated manual operations, and small-scale adjustments can be automatically completed. For example, the system will identify possible abnormal areas and prompt users to confirm or automatically repair them, so as to reduce manual intervention and ensure the rationality and consistency of the intersection points of the grid and contour lines.
[0043] S5. After interpolation and topological optimization, the final topological structure is generated, and the complete topological relationship between the contour lines and the grid is output. This topological structure ensures the accuracy of the terrain data and greatly reduces the errors that may occur during editing and processing. The final topological data format is output for use by GIS platforms, 3D modeling tools, and terrain analysis software. The generated high-precision contour lines and grid topological relationships can be used for further terrain analysis, resource assessment, and environmental simulation, ensuring the accuracy and consistency of the analysis results.
[0044] Specifically, generating a topology model in S2 includes the following steps:
[0045] Through a contour line and a network, the contour line is composed of multiple points, and the grid is composed of vertices. The intersection points between each line segment on the contour line and each edge of the grid are inserted to calculate the numerical value, and all the calculated intersection points are classified. The classification includes the intersection points between the contour line and the grid and the intersection points between the contour line and the grid node. Among them, the intersection points of the contour line and the grid record the intersection points of each contour line and the grid and its corresponding grid edge, and the intersection points of the contour line and the grid node record the intersection points of each contour line and the grid node, which preliminarily represents the topological relationship between the contour line and the grid, and is used to record which grid edges each contour line segment intersects with, as well as the specific location of the intersection point, providing a basis for subsequent interpolation and optimization;
[0046] Specifically, when judging whether there is an intersection between each line segment on the contour line and each edge of the grid, suppose we have a contour line L and a grid M, and the contour line L consists of a series of points P m (x m ,y n ), the mesh G consists of vertices V m (x m ,y m ), for each line segment P on the contour line i P i+1 and each edge V of the mesh n V k , their intersection is calculated by solving the parametric equation of the line segment, line segment P i P i+1 It can be expressed as: P = P m +t(P m+1 -P m ), 0≤t≤1; line segment V n V k It can be expressed as: Q = V n +s(V k -V n ), 0≤s≤1, combine the two parametric equations P=Q, and insert the values to get two independent equations, and get t and s. If 0≤t≤1, and 0≤s≤1, then the two line segments have an intersection point, and the intersection point coordinates I=P m +t(P m+1 -P m ), which is beneficial for the subsequent classification of all calculated intersection points according to the contour lines and grid edges to which they belong.
[0047] Furthermore, the nonlinear interpolation algorithm in S3 includes the following steps:
[0048] Receive which grid edges each contour line segment intersects with and the specific location of the intersection. Read the grid data containing elevation information, parameterize the points on the contour lines, and the parameter value of each point represents the cumulative distance from the starting point to the point. Under the condition of having second-order continuous derivatives on the entire definition domain, fit and establish multiple spline interpolation to form a system of equations, solve the equations in matrix form, obtain the intersection of the contour lines and line segments, use the intersection algorithm of line segments and curves to check whether it intersects with a certain section of the contour lines. If so, output the specific location of the intersection. Spline interpolation can better fit irregular terrain data and improve the accuracy of intersections.
[0049] It is worth noting that, in order to ensure data accuracy, the optimization algorithm in S4 includes a Gaussian filter grid smoothing algorithm and a fault shrinkage algorithm based on image gradient;
[0050] The Gaussian filter grid smoothing algorithm is used to smooth the contour data and the basic grid data to reconstruct the intersection and solve the intersection misalignment;
[0051] The image gradient-based fault shrinking algorithm is used to identify edges and faults in an image by calculating the gradient information of the image, and perform shrinking processing to reconstruct the boundary and solve the topological discontinuity.
[0052] Specifically, in order to effectively reduce the noise caused by measurement errors or other factors, make the contour lines smoother, and thus improve the accuracy and efficiency of subsequent processing, the Gaussian filter grid smoothing algorithm includes the following steps:
[0053] Import the contour data and base grid data, and convert the contour data into image format, where each pixel value represents the height of the point;
[0054] Run the Gaussian filter grid smoothing algorithm: select the appropriate standard deviation according to the required filtering effect, and determine the size of the convolution kernel. Common convolution kernel sizes are 3x3, 5x5, etc. For each position in the convolution kernel, calculate the corresponding Gaussian weight, and in order to ensure that the pixel value after convolution is still within a reasonable range, normalize the Gaussian kernel so that the sum of all its weights is 1. For each pixel in the image, calculate the weighted average value in its neighborhood, increase the weight value of the center point, and reduce the weight value far away from the center point, retaining the main features of the image while smoothing out small noise;
[0055] Assume that for each position (x, y) in the convolution kernel, the corresponding Gaussian weight G(x, y) is calculated. For example, we have a 3x3 Gaussian convolution kernel with a standard deviation of σ = 1. The Gaussian kernel weight is calculated and normalized. According to the mathematical formula of Gaussian filtering:
[0056]
[0057] Among them, x and y are the offsets relative to the current pixel, σ is the standard deviation of the Gaussian distribution, which determines the width and smoothness of the filter. The weight of each position is calculated: G(-1, -1), G(0, -1), G(1, -1), G(-1, 0), G(0, 0), G(1, 0), G(-1, 1), G(0, 1), G(1, 1), and the normalized Gaussian kernel is used. Calculate the normalized result and calculate the weighted average value in the neighborhood of each pixel (i, j) in the image, which can effectively smooth the terrain data, reduce noise, and improve data quality and processing efficiency.
[0058] In addition, after the contour data and the basic grid data are smoothed, the image gradient-based fault shrinkage algorithm includes the following steps:
[0059] Three gradient filters are used to calculate the gradient of the image. Gradient filters include Sobel filter, Scharr filter and Laplacian filter. Sobel filter: combines Gaussian smoothing and differential operation, and has good noise resistance. You can specify the direction of derivation by setting `xorder` and `yorder`, and use `ksize` to specify the size of the convolution kernel. Scharr filter: The effect is better than Sobel filter in the case of 3x3 convolution kernel, especially when solving the gradient angle. Laplacian filter: uses the second-order derivative form, which is suitable for detecting local changes in the image;
[0060] Use the Sobel filter to calculate the gradient of the image in the x and y directions, use the Scharr filter to solve the gradient angle in the case of a 3x3 convolution kernel, and use the Laplacian filter to calculate the second-order derivative of the image;
[0061] Combine the gradients in the x and y directions, calculate the gradient amplitude, use the threshold to convert the gradient amplitude into a binary image, extract the edges, and use OpenCV's `findContours` function to accurately detect the contours in the image. Use the `cv2.approxPolyDP` function to approximate the contours, and use the `cv2.contourArea` and `cv2.arcLength` functions to calculate the contour area and perimeter. Perform indentation as needed to reduce the impact of faults on subsequent analysis. This method can effectively process smoothed contour data and basic grid data, and improve the accuracy and reliability of geological structure analysis.
[0062] The final topology structure is generated in S5, including the following steps:
[0063] Set the influence radius, control strength and constraint radius parameters, call out the intersection and boundary of the reconstructed contour line and grid, reconstruct the contour line data and basic grid data, and receive the specific location of the intersection output by the nonlinear interpolation algorithm;
[0064] The reconstructed contour data, basic grid data and specific intersection positions form the final topological structure, and the complete topological relationship between contour lines and grids for surface trends is optimized. It can handle complex contour lines and grid data with multiple interactions to ensure the continuity and consistency of the results.
[0065] The second object of the present invention is to provide a surface trend intelligent optimization implementation tool, which is applied to any one of the above items and includes a data model module, a business operation module and a view interaction module;
[0066] The data model module is used to define the data source in S1 as the structure of input data and output data, including contour data and basic grid data.
[0067] The business operation module is used to load contour data and basic grid data, establish topological relationships through S2, and can also set contour lines, fault lines, boundary lines, control points, data optimization, data cleaning, output data, and operation records.
[0068] The view interaction module is used to realize the visual display window of data and the user interaction interface, including initializing the scene view, data rendering, responding to user mouse and keyboard events, etc., and includes grid node switches, contour line switches, fault switches, control point switches, transparency settings, control strength settings, etc.
[0069] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. The surface trend intelligent optimization method is characterized by: The steps include: S1. Importing the contour data and basic grid data of the terrain from the data source. The contour data is represented in vector form, which is a series of coordinate sequences of points, each point representing a position on the contour line. The basic grid data is represented as a set of vertex coordinates of rectangles and polygons, which are used to construct the spatial framework of the terrain. S2, based on the spatial geometry algorithm, identify the area where the contour line passes through the grid, calculate the intersection of each contour line with the grid nodes and edges, generate a set of preliminary topological models, and preliminarily construct the topological relationship between the two; S3, accurately calculating the position of the contour line in the grid by applying a nonlinear interpolation algorithm to determine the intersection point between the contour line and the grid; S4. Use optimization algorithms to identify topological contradictions in abnormal areas, automatically generate editing suggestions based on topological relationships, and automatically process the correction and adjustment of topological structures; S5. After interpolation and topology optimization, the final topology structure is generated, the complete topological relationship between the contour lines and the grid is output, and the format of the final topological data is output.
2. The surface trend intelligent optimization method according to claim 1, characterized in that: The topology model is generated in S2, including the following steps: Through a contour line and a network, the contour line is composed of multiple points and the grid is composed of vertices. The intersection between each line segment on the contour line and each edge of the grid is numerically calculated, and all the calculated intersections are classified. The classification includes the intersection of the contour line and the grid and the intersection of the contour line and the grid node. The topological relationship between the contour line and the grid is preliminarily represented, which is used to record which grid edges each contour line segment intersects with and the specific location of the intersection.
3. The surface trend intelligent optimization method according to claim 2, characterized in that: The nonlinear interpolation algorithm in S3 comprises the following steps: Receive which grid edges each contour line segment intersects with and the specific location of the intersection. Read the grid data containing elevation information, parameterize the points on the contour lines, and the parameter value of each point represents the cumulative distance from the starting point to the point. Under the condition of having second-order continuous derivatives on the entire definition domain, fit and establish multiple spline interpolation to form a system of equations, solve the equations in matrix form, obtain the intersection of the contour lines and line segments, and use the intersection algorithm of the line segment and the curve to check whether it intersects with a certain segment of the contour line. If so, output the specific location of the intersection.
4. The surface trend intelligent optimization method according to claim 3 is characterized by: The optimization algorithm in S4 includes a Gaussian filter grid smoothing algorithm and a fault shrinking algorithm based on image gradient; The Gaussian filter grid smoothing algorithm is used to smooth the contour data and the basic grid data to reconstruct the intersection and solve the intersection misalignment; The image gradient-based fault shrinking algorithm is used to identify edges and faults in an image by calculating the gradient information of the image, and perform shrinking processing to reconstruct the boundary and solve the topological discontinuity.
5. The surface trend intelligent optimization method according to claim 4, characterized in that: The Gaussian filtering grid smoothing algorithm comprises the following steps: Import the contour data and base grid data, and convert the contour data into image format, where each pixel value represents the height of the point; Run the Gaussian filter grid smoothing algorithm: select the appropriate standard deviation according to the required filtering effect, and determine the size of the convolution kernel. For each position in the convolution kernel, calculate the corresponding Gaussian weight, and in order to ensure that the pixel value after convolution is still within a reasonable range, normalize the Gaussian kernel so that the sum of all its weights is 1. For each pixel in the image, calculate the weighted average value in its neighborhood, increase the weight value of the center point, and reduce the weight value far away from the center point, retaining the main features of the image while smoothing out small noise.
6. The surface trend intelligent optimization method according to claim 5, characterized in that: After smoothing the contour data and the basic grid data, the image gradient-based fault shrinkage algorithm includes the following steps: Three gradient filters are used to calculate the derivative of image gradients. The gradient filters include Sobel filter, Scharr filter and Laplacian filter. Use the Sobel filter to calculate the gradient of the image in the x and y directions, use the Scharr filter to solve the gradient angle in the case of a 3x3 convolution kernel, and use the Laplacian filter to calculate the second-order derivative of the image; Combine the gradients in the x and y directions, calculate the gradient magnitude, and use a threshold to convert the gradient magnitude into a binary image, extract the edges, detect the contours in the image, approximate the contours, calculate the contour area and perimeter, and indent as needed.
7. The surface trend intelligent optimization method according to claim 7, characterized in that: The final topology structure is generated in S5, including the following steps: Set the influence radius, control strength and constraint radius parameters, call out the intersection and boundary of the reconstructed contour line and grid, reconstruct the contour line data and basic grid data, and receive the specific location of the intersection output by the nonlinear interpolation algorithm; The reconstructed contour data, basic grid data and specific intersection locations form the final topological structure.
8. A surface trend intelligent optimization implementation tool, applied to the surface trend intelligent optimization method according to any one of claims 1 to 7, characterized in that: Includes data model module, business operation module and view interaction module; The data model module is used to define the data source in S1 as the structure of input data and output data, including contour data and basic grid data. The business operation module is used to load contour data and basic grid data, and establish a topological relationship through S2. The view interaction module is used to realize the visual display window of data and the user interaction interface.