Dynamic efficient construction method for large-scale data contour line and color filling map
Through dynamic grid splitting and multi-threaded processing, combined with the local priority principle, rapid contour and color filling map construction of large-scale data is achieved, which solves the problems of insufficient speed and accuracy in traditional methods and improves the efficiency and effect of real-time visualization of natural environment data.
Patent Information
- Application Number
- CN202510784811.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-23
AI Technical Summary
In large-scale data visualization, traditional methods cannot effectively combine contour lines and color fill maps, and the processing speed and accuracy are insufficient, especially in the case of large-scale data, which affects the visualization effect and efficiency.
The method of dynamic grid splitting, multi-threaded parallel processing, fast color filling and fast isoline recognition is adopted. The color scale array is created through multi-threading, the grid is dynamically divided, and the principle of local processing priority is combined to achieve fast closure judgment and color filling.
It significantly improves the processing and visualization speed of large-scale data, ensures the accuracy and aesthetics of graphics, reduces computing resource usage, and is suitable for real-time visualization of natural environment data.
Smart Images

Figure CN120689462A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of geographic information system data visualization, and in particular to a dynamic and efficient construction method for large-scale data contour lines and color-filled maps. Background Art
[0002] In geographic information system data visualization, the distribution of data over a large area usually needs to be realized through contour maps and color fill maps. In the traditional data visualization process, a fixed grid division is generally used, and data interpolation and contour division are performed on this basis. When faced with large-scale data, if the grid division is fine and the amount of interpolated data is large, the system operation time will be very long, so it can only be implemented by pre-generating layers in the background. However, if the grid division is coarse, the accuracy and effect of data presentation will be greatly reduced, seriously affecting subsequent analysis and research work. For natural environment data, the data changes in most areas are relatively stable. Therefore, a dynamic and adaptive contour line generation and color filling method is needed to meet the requirements of presentation speed and accuracy at the same time.
[0003] Currently, similar invention patents mainly include a visualization method and system for large-scale vector data based on Cesium (CN119311909A), a grid contour line drawing method based on the marine Internet of Things (CN108776999B), and a visualization analysis method for raster text precipitation data (CN109902120A). However, the above patents have the following problems. First, the color filling map and the contour line map cannot overlap well, which affects the visualization effect; second, the judgment method for data filling and grid division is complicated, which will seriously affect the visualization speed when the data volume is large; finally, the judgment of contour line closure, color filling and contour line drawing need to be performed after all data have been processed, and all data need to be searched and judged. In the case of large-scale data, the visualization speed is very unsatisfactory.
[0004] Therefore, how to provide a dynamic and efficient method for constructing large-scale data contour lines and color filling maps is an urgent problem that needs to be solved by those skilled in the art. Summary of the Invention
[0005] One purpose of the present invention is to propose a dynamic and efficient method for constructing large-scale data contour lines and color-filled maps. The present invention is particularly suitable for real-time visualization scenarios of natural environment data. The method adopts dynamic grid splitting, rapid color filling, rapid contour line identification and closure judgment, etc., which maximizes the speed of processing and visualization.
[0006] A method for dynamically and efficiently constructing large-scale data contour lines and color-filled maps according to an embodiment of the present invention includes the following steps:
[0007] S1. Obtain the required number of color levels and create corresponding color level arrays in parallel using multithreading. Each array stores data points of the corresponding color level. If the data in the array cannot be closed, a new array is created to store the newly added data of the same color level.
[0008] S2. Divide the spatial area into an initial grid with n rows and m columns. Fill each grid vertex with the weighted average value. If the difference between any two vertex data exceeds one color level, divide the grid into 4k (k is a positive integer) sub-grids and fill the newly added vertices with the average value of the neighboring points. Iterate until the split is completed.
[0009] S3. Determine the color level distribution of the mesh vertices that have stopped splitting. If there are only two color levels, and the one with the larger number corresponds to at least two points, fill in the color corresponding to the smaller number; otherwise, fill in the color corresponding to the larger number;
[0010] S4. Write the unwritten vertex data into the corresponding color level array, form a line segment with the previous data point, and determine whether it intersects with any line segment in the adjacent color level array. If so, delete the previous data point and create a new array to write the current data; otherwise, write directly into the original array;
[0011] S5. If a data point is deleted, calculate its distance to the starting point of the array. If it is less than the set threshold, close it. If it is not closed and enters the third array creation process, close the array by interpolation.
[0012] S6. Extract the data in the closed array to draw contour lines, complete color filling and output the map results.
[0013] Optionally, the S1 specifically includes:
[0014] S11. According to the legend setting of the color fill map to be generated, obtain the corresponding number of color levels and initialize the color level array with the same number;
[0015] S12, using a multi-threaded approach to create all color level arrays in parallel, independently allocating the array memory structure in each thread and completing initialization;
[0016] S13. During the initial grid data filling process, determine the color level to which the value of the current data point belongs, and write it to the end of the array corresponding to the color level;
[0017] S14. If any existing array corresponding to the color level to which the current data point belongs cannot form a closed contour line or cannot meet the continuous path requirement, a new independent array is created for the color level, and the current data point is written as the starting data point of the new array.
[0018] Optionally, the S2 specifically includes:
[0019] S21. Divide the target data space into an initial grid of n rows and m columns. The grid size can be customized according to the application scenario and the division range is 0.5 to 1 degree of longitude and latitude. Fill the four vertices of each initial grid with data values using a weighted average method to form an initial basic grid data structure.
[0020] S22. Starting from the upper left corner, traverse all initial meshes row by row, compare the data values of the four vertices of each basic mesh in pairs, and determine whether the data value difference between any two vertices exceeds one color level. If so, trigger splitting;
[0021] S23, dividing the base mesh that meets the splitting condition into 4k (k is a positive integer) sub-meshes of equal size, and filling the newly generated vertices in each sub-mesh with the data average of its adjacent known vertices. After filling, the sub-mesh is again judged whether it meets the splitting condition. If so, the sub-mesh division and filling process is continued until the difference in vertex data values of all sub-meshes does not exceed one color level;
[0022] S24. When all grid splitting operations are completed, traverse all data points that have not been written into the basic grid, determine the corresponding color level number according to its data value, and write it into the corresponding color level array.
[0023] Optionally, the S3 specifically includes:
[0024] S31, after all basic meshes stop splitting, mark each mesh as being in a stable state, extract the corresponding data values of the four vertices of each stable mesh in sequence, and determine the color scale number to which each vertex belongs based on the data values;
[0025] S32, determining whether the four vertices of the grid contain only two color scale numbers. If so, counting the number of data points corresponding to each color scale number, wherein the color scale number with a higher value corresponds to the color scale of the data point with a higher value, and the color scale number with a lower value corresponds to the color scale of the data point with a lower value;
[0026] S33. When the number of data points corresponding to the higher color level number in the above two color levels is not less than two, the grid is filled with the color corresponding to the lower color level number; otherwise, the grid is filled with the color corresponding to the higher color level number. After the colors of all grids are determined, the color fill layer is rendered according to the predetermined color for all stable grids.
[0027] Optionally, the S4 specifically includes:
[0028] S41. For gateway data that has not been written into the array, determine the color scale serial number corresponding to the serial number, and write the color scale serial number corresponding to the serial number in sequence;
[0029] S42, when writing a new data point, constructing a line segment with the previous data point in the memory, and establishing a line segment equation model for the line segment;
[0030] S43, for all established line segments in the previous color scale warehouse and the next color scale warehouse of the endpoint color scale number, calculate the line segment solution one by one, and use the support cross multiplication method to perform intersection detection on the current line segment to determine whether it forms a geometric intersection with any line segment in the above color scale warehouse;
[0031] S44. If an intersection is detected, delete the previous data point in the current queue, create a new queue for the color level number, and write the current data point into the new queue as the starting point; if no intersection is detected, write the current data point into the original queue, and at the same time, load the subsequent data points of the same color sequence into the original queue and the new queue in turn, and continue to repeat the line segment construction and intersection detection to ensure the continuity and non-intersection of the queue data segments.
[0032] Optionally, the S5 specifically includes:
[0033] S51. When a new data point written into a color scale array is deleted due to the intersection detection result, the closure judgment process is immediately triggered to extract the coordinates of the array starting point and the current data point, and calculate the longitude and latitude distance between the two points;
[0034] S52, comparing the latitude and longitude distance with a preset closing threshold. If the distance is less than or equal to the threshold, the color scale array is determined to be closed. The closing threshold is a fixed value of 0.01 latitude and longitude. If the data type being processed is wind field distribution data or ocean current velocity data, the closing threshold is set to 0.005 latitude and longitude.
[0035] S53. If the coordinate distance is greater than the closing threshold and the color scale has entered the creation process of the third array, interpolation processing is performed on the array, a connection path is established between the starting point and the current data point according to the spatial sequence, and interpolation points are generated using linear interpolation or cubic spline interpolation methods. After the interpolation is completed, all interpolation points are added to the end of the array in sequence, and the array is set to a closed state.
[0036] Optionally, the S6 specifically includes:
[0037] S61, extracting all color-scale array data that have been marked as closed in the closure judgment, and sorting the closed data segments according to the color-scale numbers, as the data basis for drawing the contour lines;
[0038] S62, according to the order of vertex data recorded in each closed color scale array, and in accordance with the color level corresponding to its color scale number, draw closed contour lines one by one on the geographic information system map, wherein the contour lines are formed by connecting the data points in the array in sequence, and a controllable curve smoothing algorithm is used in the drawing process to ensure the continuity of the contour line boundaries and the integrity of the graphics;
[0039] S63. After all the contour lines are drawn, the color filling process is started, and a unified layer rendering operation is performed on all stable state grids. According to the aforementioned color judgment rules, the color corresponding to the color level number is filled into its coverage area, and the layer integration processing is performed in combination with the drawn contour line contours to generate a complete geographic information system rendering map, and the map is output as the final visualization result.
[0040] The beneficial effects of the present invention are:
[0041] (1) Multi-threading technology is used to create color-level arrays in parallel, making full use of the concurrent computing capabilities of multi-core processors, significantly shortening the array initialization and data writing time. At the same time, a multi-threading mechanism is also introduced in the data traversal and intersection detection process, effectively improving the overall efficiency of large-scale data processing, and is suitable for the rapid visualization of continuous data of natural environments;
[0042] (2) Through the dynamic grid splitting strategy, fine-grained grid division is triggered in areas with large data value changes to enhance the accuracy of local contour lines; while coarse grid division is maintained in areas with stable data changes to avoid unnecessary calculation operations, thereby effectively reducing the overall calculation load while ensuring the accuracy of graphic expression;
[0043] (3) In the process of executing grid color filling, based on the combination relationship of the color level numbers corresponding to the four vertices of the grid, a clear color determination rule is adopted and the color filling logic is unified to ensure the natural transition of color bands and clear layer boundaries during image rendering, thereby improving the overall readability and visual aesthetics of the map;
[0044] (4) The entire process from grid splitting, color array updating to contour line closure judgment follows the principle of local processing priority, avoiding repeated traversal or centralized processing of global data in any step, effectively reducing the system's occupation of computing resources and memory space during operation, and ensuring the algorithm's response speed and scalability under large data volume conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0046] Figure 1This is a flowchart of a method for dynamically and efficiently constructing large-scale data contour lines and color-filled maps proposed by the present invention;
[0047] Figure 2 A flowchart of a grid splitting and contour line generation method for a dynamic and efficient construction method of large-scale data contour lines and color filling maps proposed by the present invention;
[0048] Figure 3 The present invention provides a flowchart of a color scale array updating method for a dynamic and efficient construction method of large-scale data contour lines and color filling maps. DETAILED DESCRIPTION
[0049] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.
[0050] refer to Figure 1-3 , a dynamic and efficient method for constructing large-scale data contour lines and color filling maps, including the following steps:
[0051] S1. Obtain the required number of color levels and create corresponding color level arrays in parallel using multithreading. Each array stores data points of the corresponding color level. If the data in the array cannot be closed, a new array is created to store the newly added data of the same color level.
[0052] S2. Divide the spatial area into an initial grid with n rows and m columns. Fill each grid vertex with the weighted average value. If the difference between any two vertex data exceeds one color level, divide the grid into 4k (k is a positive integer) sub-grids and fill the newly added vertices with the average value of the neighboring points. Iterate until the split is completed.
[0053] S3. Determine the color level distribution of the mesh vertices that have stopped splitting. If there are only two color levels, and the one with the larger number corresponds to at least two points, fill in the color corresponding to the smaller number; otherwise, fill in the color corresponding to the larger number;
[0054] S4. Write the unwritten vertex data into the corresponding color level array, form a line segment with the previous data point, and determine whether it intersects with any line segment in the adjacent color level array. If so, delete the previous data point and create a new array to write the current data; otherwise, write directly into the original array;
[0055] S5. If a data point is deleted, calculate its distance to the starting point of the array. If it is less than the set threshold, close it. If it is not closed and enters the third array creation process, close the array by interpolation.
[0056] S6. Extract the data in the closed array to draw contour lines, complete color filling and output the map results.
[0057] In this embodiment, S1 specifically includes:
[0058] S11. According to the legend setting of the color fill map to be generated, obtain the corresponding number of color levels and initialize the color level array with the same number;
[0059] S12, using a multi-threaded approach to create all color level arrays in parallel, independently allocating the array memory structure in each thread and completing initialization;
[0060] S13. During the initial grid data filling process, determine the color level to which the value of the current data point belongs, and write it to the end of the array corresponding to the color level;
[0061] S14. If any existing array corresponding to the color level to which the current data point belongs cannot form a closed contour line or cannot meet the continuous path requirement, a new independent array is created for the color level, and the current data point is written as the starting data point of the new array.
[0062] This implementation method uses a multi-threaded approach to create color level arrays in parallel according to the number of color levels, thereby achieving structured grouped storage of data of different color levels and improving the computational concurrency during array initialization and writing. By introducing a color level array splitting mechanism during data writing, when an array fails to meet the contour closure condition, a new array is automatically created to independently store subsequent data, thus ensuring the integrity and geometric consistency of the contour line data structure. The overall process avoids the blocking delay caused by serial writing, significantly reducing the writing time and improving the system response efficiency in the real-time processing of large-scale environmental data.
[0063] In this embodiment, S2 specifically includes:
[0064] S21. Divide the target data space into an initial grid of n rows and m columns. The grid size can be customized according to the application scenario and the division range is 0.5 to 1 degree of longitude and latitude. Fill the four vertices of each initial grid with data values using a weighted average method to form an initial basic grid data structure.
[0065] S22. Starting from the upper left corner, traverse all initial meshes row by row, compare the data values of the four vertices of each basic mesh in pairs, and determine whether the data value difference between any two vertices exceeds one color level. If so, trigger splitting;
[0066] S23, dividing the base mesh that meets the splitting condition into 4k (k is a positive integer) sub-meshes of equal size, and filling the newly generated vertices in each sub-mesh with the data average of its adjacent known vertices. After filling, the sub-mesh is again judged whether it meets the splitting condition. If so, the sub-mesh division and filling process is continued until the difference in vertex data values of all sub-meshes does not exceed one color level;
[0067] S24. When all grid splitting operations are completed, traverse all data points that have not been written into the basic grid, determine the corresponding color level number according to its data value, and write it into the corresponding color level array.
[0068] This implementation method divides the target spatial area into initial grids according to the recommended granularity and uses weighted averaging to fill in vertex data, providing basic numerical conditions for subsequent splitting judgments. During the traversal process, by setting whether the vertex data difference exceeds one color level as the splitting trigger condition, a dynamic processing mechanism for automatically refining the grid in areas with significant data changes is implemented. At the same time, the data values of the newly added grid vertices are quickly calculated using the average of adjacent points to ensure data continuity and computational stability during the grid splitting process. Finally, by recursively performing difference judgment and splitting operations on each basic grid until the termination condition is met, a multi-level spatial data expression model that takes into account both accuracy and efficiency is constructed.
[0069] In this embodiment, S3 specifically includes:
[0070] S31, after all basic meshes stop splitting, mark each mesh as being in a stable state, extract the corresponding data values of the four vertices of each stable mesh in sequence, and determine the color scale number to which each vertex belongs based on the data values;
[0071] S32, determining whether the four vertices of the grid contain only two color scale numbers. If so, counting the number of data points corresponding to each color scale number, wherein the color scale number with a higher value corresponds to the color scale of the data point with a higher value, and the color scale number with a lower value corresponds to the color scale of the data point with a lower value;
[0072] S33. When the number of data points corresponding to the higher color level number in the above two color levels is not less than two, the grid is filled with the color corresponding to the lower color level number; otherwise, the grid is filled with the color corresponding to the higher color level number. After the colors of all grids are determined, the color fill layer is rendered according to the predetermined color for all stable grids.
[0073] This implementation establishes a decision basis for color filling by identifying a stable mesh after mesh splitting is terminated, and extracting and counting the color level numbers corresponding to its four vertex data; by judging the quantitative relationship between the two color level numbers in the vertices, a clear color selection rule is set, so that each mesh can determine a unique color filling result based on structural conditions when it has two color level numbers; this rule avoids the problems of fuzzy color judgment and unclear boundary rendering in traditional methods, and enhances the visual recognition effect of isovalued areas while ensuring the color continuity of the layer, effectively improving the accuracy and graphic aesthetics of the final visualization output.
[0074] In this embodiment, the S4 specifically includes:
[0075] S41. For gateway data that has not been written into the array, determine the color scale serial number corresponding to the serial number, and write the color scale serial number corresponding to the serial number in sequence;
[0076] S42, when writing a new data point, constructing a line segment with the previous data point in the memory, and establishing a line segment equation model for the line segment;
[0077] S43, for all established line segments in the previous color scale warehouse and the next color scale warehouse of the endpoint color scale number, calculate the line segment solution one by one, and use the support cross multiplication method to perform intersection detection on the current line segment to determine whether it forms a geometric intersection with any line segment in the above color scale warehouse;
[0078] S44. If an intersection is detected, delete the previous data point in the current queue, create a new queue for the color level number, and write the current data point into the new queue as the starting point; if no intersection is detected, write the current data point into the original queue, and at the same time, load the subsequent data points of the same color sequence into the original queue and the new queue in turn, and continue to repeat the line segment construction and intersection detection to ensure the continuity and non-intersection of the queue data segments.
[0079] This implementation effectively determines the continuity and closure of the contour line geometric structure by constructing a line segment with the previous data point when writing a new data point into the color scale array, and using vector cross multiplication to determine its intersection relationship with all line segments in the adjacent color scale array. When an intersection is detected, the previous data point in the current array is deleted and a new array is created to write the current point, ensuring that the color scale data can still maintain correct structural separation in the presence of topological conflicts. At the same time, subsequent data points continue to perform writing and detection operations in the original array and the new array respectively, establishing a data grouping mechanism based on dynamic adjustment of structural relationships, effectively preventing the contour line paths from crossing, overlapping or breaking, and improving the final drawing quality and data consistency.
[0080] In this embodiment, the S5 specifically includes:
[0081] S51. When a new data point written into a color scale array is deleted due to the intersection detection result, the closure judgment process is immediately triggered to extract the coordinates of the array starting point and the current data point, and calculate the longitude and latitude distance between the two points;
[0082] S52, comparing the latitude and longitude distance with a preset closing threshold. If the distance is less than or equal to the threshold, the color scale array is determined to be closed. The closing threshold is a fixed value of 0.01 latitude and longitude. If the data type being processed is wind field distribution data or ocean current velocity data, the closing threshold is set to 0.005 latitude and longitude.
[0083] S53. If the coordinate distance is greater than the closing threshold and the color scale has entered the creation process of the third array, interpolation processing is performed on the array, a connection path is established between the starting point and the current data point according to the spatial sequence, and interpolation points are generated using linear interpolation or cubic spline interpolation methods. After the interpolation is completed, all interpolation points are added to the end of the array in sequence, and the array is set to a closed state.
[0084] This implementation achieves a precise judgment mechanism for the closure status of contour lines by immediately extracting the coordinates of a new data point and the array starting point after the new data point is deleted from the color scale array, calculating the longitude and latitude distance between the two, and comparing it with the set closure threshold. The set closure threshold is controllable and can adapt to data types with different spatial precision requirements. When the array has entered the third creation instance and is still not closed, the closure path is supplemented by interpolation, and linear interpolation or cubic spline interpolation methods are selected according to the data change characteristics to ensure the smoothness and continuity of the interpolation result. This processing process does not require global recalculation and can complete the closure of contour lines locally, effectively improving the local response efficiency and graphics drawing integrity during large-scale data processing.
[0085] In this embodiment, S6 specifically includes:
[0086] S61, extracting all color-scale array data that have been marked as closed in the closure judgment, and sorting the closed data segments according to the color-scale numbers, as the data basis for drawing the contour lines;
[0087] S62, according to the order of vertex data recorded in each closed color scale array, and in accordance with the color level corresponding to its color scale number, draw closed contour lines one by one on the geographic information system map, wherein the contour lines are formed by connecting the data points in the array in sequence, and a controllable curve smoothing algorithm is used in the drawing process to ensure the continuity of the contour line boundaries and the integrity of the graphics;
[0088] S63. After all the contour lines are drawn, the color filling process is started, and a unified layer rendering operation is performed on all stable state grids. According to the aforementioned color judgment rules, the color corresponding to the color level number is filled into its coverage area, and the layer integration processing is performed in combination with the drawn contour line contours to generate a complete geographic information system rendering map, and the map is output as the final visualization result.
[0089] This implementation method extracts color array data marked as closed and draws contour lines one by one on the geographic information system map according to the color level number sequence, thereby realizing a closed-loop graphics generation process automatically driven by the data structure. During the drawing process, closed line segments are constructed by connecting the data points in the array in sequence, and a curve smoothing algorithm can be used to improve boundary continuity and visual quality. After the contour lines are drawn, the color judgment rules are further combined to perform a unified layer filling operation on all stable state grids to ensure that the contour line boundaries and color areas accurately correspond to each other, and the complete rendered map layers are uniformly output. While maintaining spatial positioning consistency, this process significantly improves the layer integration efficiency and the expression accuracy of the final visualization results, and is suitable for dynamic rendering tasks in real-time spatial data visualization platforms.
[0090] Example 1:
[0091] In order to verify the feasibility of the present invention in implementation, the present invention is applied to a meteorological visualization platform construction project of a national environmental monitoring center, which requires real-time visualization of multi-dimensional meteorological data such as temperature, wind speed and relative humidity covering the entire country. The original data is uploaded synchronously from multiple data sources such as ground monitoring stations, remote sensing satellites, and automatic weather stations at a frequency of once per hour. The number of data points processed at a single time ranges from 10,000 to 200,000, involving a spatial resolution of 0.1° longitude and latitude, and a range spanning the entire continental region. In the original visualization system, the platform uses the traditional fixed grid division method, combined with full interpolation and post-processing methods to generate layers. This solution cannot meet the increasing requirements of computing efficiency and interactive response. The system often encounters problems such as slow loading, image dislocation, and non-closed contour line boundaries, which seriously affect the user experience.
[0092] After introducing the "dynamic and efficient construction method of large-scale data contour lines and color filling maps" provided by the present invention, the system architecture has been upgraded as follows: First, after each data reception, the system creates multiple color level arrays in parallel based on the currently set number of color levels. Each array independently records the data points under the corresponding color level, and the use of a multi-threaded processing architecture significantly improves the data initialization speed. Then, in the initial grid division stage, the recommended 0.5°×0.5° longitude and latitude granularity is used to perform a basic division of the national area, and dynamic grid four-division is performed as needed. High-density sub-grids are formed in local areas where data changes drastically, while large grid structures are retained in areas where data distribution is flat, thereby realizing dynamic allocation of spatial computing resources. In the color filling link, by analyzing the color level numbers and quantitative relationships of the four vertices of each stable grid, color filling operations are performed according to clear rules to ensure clear layer boundaries and accurate visual expression.
[0093] The system simultaneously deploys a dual algorithm comparison mechanism for both the traditional method and the method of the present invention. The platform uses scripts to call each batch of data to run two sets of algorithms and record core performance indicators. The following is a performance data comparison table during the actual measurement process:
[0094] Table 1 GIS visualization performance comparison table
[0095]
[0096] As shown in the table, traditional methods exhibit near-linear growth in processing time and memory usage with increasing data volume. Processing times can reach over 200 seconds for 200,000 data points, making them virtually non-interactive. However, the proposed method, through multi-threaded array management and a localized grid splitting strategy, effectively controls computational complexity, maintaining processing time below 20% of traditional methods and reducing memory usage by over 40%. For example, with 100,000 data points, the traditional method takes 95.1 seconds to generate contour lines and coloring maps, while the proposed method completes the same operation in just 19.8 seconds, achieving a nearly fivefold improvement in response speed.
[0097] Feedback from the user side shows that after adopting the solution of the present invention, the layer loading delay is significantly shortened, and the color-filled area and the contour line boundary are seamlessly fitted, eliminating the problems of color dislocation and contour cracks in the original solution; at the same time, users can zoom in on any local area as needed and re-trigger layer generation, and the system can quickly perform data loading, array construction, and graphics rendering locally, fully reflecting the adaptability and performance advantages of the present invention in high-frequency interactive visualization scenarios.
[0098] This embodiment demonstrates the engineering value and feasibility of the present invention through practical application, and has the following beneficial effects in real-time large-scale spatial data visualization: First, through multi-threaded parallel array creation and processing, the preprocessing time is effectively compressed and the system throughput efficiency is improved; second, through dynamic grid splitting technology, the grid density is automatically controlled according to the data gradient, taking into account both graphics accuracy and computing resource savings; third, through clear vertex color level judgment and coloring rules, the layer boundary rendering accuracy and image continuity are improved; fourth, through the local processing priority mechanism and interpolation closure strategy, global reconstruction operations are avoided, memory overhead is significantly reduced, and the overall system availability and response stability are improved.
[0099] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A dynamic and efficient method for constructing large-scale data contour lines and color filling maps, characterized in that: The steps include: S1. Obtain the required number of color levels and create corresponding color level arrays in parallel using multithreading. Each array stores data points of the corresponding color level. If the data in the array cannot be closed, a new array is created to store the newly added data of the same color level. S2. Divide the spatial area into an initial grid with n rows and m columns. Fill each grid vertex with the weighted average value. If the difference between any two vertex data exceeds one color level, divide the grid into 4k (k is a positive integer) sub-grids and fill the newly added vertices with the average value of the neighboring points. Iterate until the split is completed. S3. Determine the color level distribution of the mesh vertices that have stopped splitting. If there are only two color levels, and the one with the larger number corresponds to at least two points, fill in the color corresponding to the smaller number; otherwise, fill in the color corresponding to the larger number; S4. Write the unwritten vertex data into the corresponding color level array, form a line segment with the previous data point, and determine whether it intersects with any line segment in the adjacent color level array. If so, delete the previous data point and create a new array to write the current data; otherwise, write directly into the original array; S5. If a data point is deleted, calculate its distance to the starting point of the array. If it is less than the set threshold, close it. If it is not closed and enters the third array creation process, close the array by interpolation. S6. Extract the data in the closed array to draw contour lines, complete color filling and output the map results.
2. A method for dynamically and efficiently constructing large-scale data contour lines and color-filled maps according to claim 1, characterized in that: Said S1 specifically includes: S11. According to the legend setting of the color fill map to be generated, obtain the corresponding number of color levels and initialize the color level array with the same number; S12, using a multi-threaded approach to create all color level arrays in parallel, independently allocating the array memory structure in each thread and completing initialization; S13. During the initial grid data filling process, determine the color level to which the value of the current data point belongs, and write it to the end of the array corresponding to the color level; S14. If any existing array corresponding to the color level to which the current data point belongs cannot form a closed contour line or cannot meet the continuous path requirement, a new independent array is created for the color level, and the current data point is written as the starting data point of the new array.
3. The method for dynamically and efficiently constructing large-scale data contour lines and color-filled maps according to claim 1, characterized in that: The S2 specifically includes: S21. Divide the target data space into an initial grid of n rows and m columns. The grid size can be customized according to the application scenario and the division range is 0.5 to 1 degree of longitude and latitude. Fill the four vertices of each initial grid with data values using a weighted average method to form an initial basic grid data structure. S22. Starting from the upper left corner, traverse all initial meshes row by row, compare the data values of the four vertices of each basic mesh in pairs, and determine whether the data value difference between any two vertices exceeds one color level. If so, trigger splitting; S23, dividing the base mesh that meets the splitting condition into 4k (k is a positive integer) sub-meshes of equal size, and filling the newly generated vertices in each sub-mesh with the data average of its adjacent known vertices. After filling, the sub-mesh is again judged whether it meets the splitting condition. If so, the sub-mesh division and filling process is continued until the difference in vertex data values of all sub-meshes does not exceed one color level; S24. When all grid splitting operations are completed, traverse all data points that have not been written into the basic grid, determine the corresponding color level number according to its data value, and write it into the corresponding color level array.
4. The method for dynamically and efficiently constructing large-scale data contour lines and color-filled maps according to claim 1, characterized in that: The S3 specifically includes: S31, after all basic meshes stop splitting, mark each mesh as being in a stable state, extract the corresponding data values of the four vertices of each stable mesh in sequence, and determine the color scale number to which each vertex belongs based on the data values; S32, determining whether the four vertices of the grid contain only two color scale numbers. If so, counting the number of data points corresponding to each color scale number, wherein the color scale number with a higher value corresponds to the color scale of the data point with a higher value, and the color scale number with a lower value corresponds to the color scale of the data point with a lower value; S33. When the number of data points corresponding to the higher color level number in the above two color levels is not less than two, the grid is filled with the color corresponding to the lower color level number; otherwise, the grid is filled with the color corresponding to the higher color level number. After the colors of all grids are determined, the color fill layer is rendered according to the predetermined color for all stable grids.
5. The method for dynamically and efficiently constructing large-scale data contour lines and color-filled maps according to claim 1, characterized in that: The S4 specifically includes: S41. For gateway data that has not been written into the array, determine the color scale serial number corresponding to the serial number, and write the color scale serial number corresponding to the serial number in sequence; S42, when writing a new data point, constructing a line segment with the previous data point in the memory, and establishing a line segment equation model for the line segment; S43, for all established line segments in the previous color scale warehouse and the next color scale warehouse of the endpoint color scale number, calculate the line segment solution one by one, and use the support cross multiplication method to perform intersection detection on the current line segment to determine whether it forms a geometric intersection with any line segment in the above color scale warehouse; S44. If an intersection is detected, delete the previous data point in the current queue, create a new queue for the color level number, and write the current data point into the new queue as the starting point; if no intersection is detected, write the current data point into the original queue, and at the same time, load the subsequent data points of the same color sequence into the original queue and the new queue in turn, and continue to repeat the line segment construction and intersection detection to ensure the continuity and non-intersection of the queue data segments.
6. The method for dynamically and efficiently constructing large-scale data contour lines and color-filled maps according to claim 1, characterized in that: The S5 specifically includes: S51. When a new data point written into a color scale array is deleted due to the intersection detection result, the closure judgment process is immediately triggered to extract the coordinates of the array starting point and the current data point, and calculate the longitude and latitude distance between the two points; S52, comparing the latitude and longitude distance with a preset closing threshold. If the distance is less than or equal to the threshold, the color scale array is determined to be closed. The closing threshold is a fixed value of 0.01 latitude and longitude. If the data type being processed is wind field distribution data or ocean current velocity data, the closing threshold is set to 0.005 latitude and longitude. S53. If the coordinate distance is greater than the closing threshold and the color scale has entered the creation process of the third array, interpolation processing is performed on the array, a connection path is established between the starting point and the current data point according to the spatial sequence, and interpolation points are generated using linear interpolation or cubic spline interpolation methods. After the interpolation is completed, all interpolation points are added to the end of the array in sequence, and the array is set to a closed state.
7. The method for dynamically and efficiently constructing large-scale data contour lines and color-filled maps according to claim 1, characterized in that: The S6 specifically includes: S61, extracting all color-scale array data that have been marked as closed in the closure judgment, and sorting the closed data segments according to the color-scale numbers, as the data basis for drawing the contour lines; S62, according to the order of vertex data recorded in each closed color scale array, and in accordance with the color level corresponding to its color scale number, draw closed contour lines one by one on the geographic information system map, wherein the contour lines are formed by connecting the data points in the array in sequence, and a controllable curve smoothing algorithm is used in the drawing process to ensure the continuity of the contour line boundaries and the integrity of the graphics; S63. After all the contour lines are drawn, the color filling process is started, and a unified layer rendering operation is performed on all stable state grids. According to the aforementioned color judgment rules, the color corresponding to the color level number is filled into its coverage area, and the layer integration processing is performed in combination with the drawn contour line contours to generate a complete geographic information system rendering map, and the map is output as the final visualization result.
Citation Information
Patent Citations
A method for drawing grid contour lines based on marine Internet of Things
CN108776999B
A visual analysis method for raster text precipitation data
CN109902120A
Visualization method and system of large-scale vector data based on Cesium
CN119311909A