A method and system for grid-based representation of geospatial data
The geospatial data grid partitioning method optimized by recursive partitioning and reinforcement learning solves the problems of low grid partitioning efficiency and redundant storage in existing technologies, realizes automated processing of efficient storage and fast computation, and improves the data processing efficiency of geographic information systems.
Patent Information
- Application Number
- CN202510987801.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2045-07-17
AI Technical Summary
Existing technologies in geographic information systems suffer from several problems: lack of correlation between grid division and graphic regularity; exponential growth of redundant grid generation with graphic complexity; reliance on manual intervention for geometric validity determination; lack of automated processing of topological anomalies; lack of statistical quantification for grid splitting thresholds; vector data rendering efficiency constrained by topological complexity; and difficulty in compatibility of unstructured data with standardized spatial indexing frameworks.
By acquiring target data and determining its validity, a minimum horizontal bounding rectangle is generated to determine the initial geographic grid. Recursive segmentation is then performed, and the grid granularity is dynamically adjusted using grid occupancy and segmentation conditions to generate the final geographic grid representation data. A reinforcement learning agent is used to optimize the segmentation decision, and a segmentation termination condition is introduced to avoid redundant storage.
It improves the storage and computation efficiency of geospatial data, realizes automated grid partitioning, enhances the standardization and efficiency of data processing, avoids redundant storage and over-partitioning, and meets the needs of real-time visualization.
Smart Images

Figure CN121029893B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of data processing and geographic information technology, and in particular to a grid-based representation method and system for geospatial data. Background Technology
[0002] There is an urgent need in the fields of Geographic Information Systems (GIS) and spatial data processing for techniques that determine the geometric validity of graphics, evaluate rules through quantification, and represent standardized grids. With the widespread application of the BeiDou grid location service system, the global discrete grid system, and standardized horizontal grids based on Mercator projection, multi-level indexing technology for spatial data has become a core paradigm for representing geographic entities. These grids maintain spatial geometric consistency through conformal projection, demonstrating significant advantages in unified data encoding, cross-scale analysis, and massive spatial retrieval.
[0003] While existing technologies such as quadtree recursive partitioning and dynamic resolution adjustment can achieve basic grid generation, their limitations are mainly reflected in three aspects: First, the correlation between grid generation and graphic regularity is lacking, leading to an exponential increase in redundant grid generation with graphic complexity. Second, geometric validity determination relies on manual intervention, lacking automated mechanisms for handling topological anomalies such as overhanging nodes and self-overlapping nodes. Third, the grid partitioning threshold lacks statistical quantification, making it difficult to balance storage efficiency and contour fidelity. Furthermore, in the application of geographic grid data, while directly displaying the original graphics can preserve geometric details, it faces serious bottlenecks in high-concurrency service scenarios: vector data rendering efficiency is limited by topological complexity, making it difficult to meet real-time visualization needs; and unstructured data is incompatible with standardized spatial indexing frameworks, restricting cross-platform data interaction capabilities. Existing methods have certain technical deficiencies in terms of automation, storage efficiency, and multi-scale adaptability. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides a grid-based representation method and system for geospatial data, thereby improving the storage and computational efficiency of geospatial data.
[0005] In a first aspect, embodiments of this application provide a grid-based representation method for geospatial data, including:
[0006] Acquire target data and determine whether the target data is valid target data, wherein the target data is geospatial data of areal features;
[0007] If the target data is valid target data, then the minimum horizontal bounding rectangle of the target data is generated according to the graphic outline of the target data;
[0008] The smallest level grid that can cover the minimum horizontal bounding rectangle is determined from the preset geographic grid hierarchy table and used as the initial geographic grid for representing the target data;
[0009] The initial geographic grid is recursively divided several times to generate various final geographic grids. During each recursive division process, it is determined whether the current geographic grid meets the preset division conditions. If it does, the current geographic grid is divided according to the next level grid to generate several secondary geographic grids, and each secondary geographic grid is recursively divided. If the current geographic grid does not meet the preset division conditions, the recursive division of the current geographic grid is stopped.
[0010] Based on the grid cell identifier of each final geographic grid, output the geographic grid representation data of the target data.
[0011] This application provides a grid-based representation method for geospatial data. It recursively divides an initial geographic grid, dynamically adjusts the grid granularity, and generates final geographic grid representation data. Several final geographic grids are used to represent the target data, mapping the graphics to discretized grid cells. This provides data support for subsequent efficient compressed storage and rapid spatial computation, improving the storage and computational efficiency of geospatial data. In the specific division process, this application determines each geographic grid based on division conditions, recursively dividing only areas requiring refinement. This avoids redundant storage of a global high-precision grid, balancing storage resources and spatial accuracy, further improving the storage efficiency of geospatial data. Furthermore, this application uses a preset geographic grid hierarchy table and division conditions to automatically divide the input target data into grids without manual intervention, improving the standardization and efficiency of geospatial data processing.
[0012] Furthermore, determining whether the target data is valid target data includes:
[0013] Calculate the area of the graphic outline of the target data;
[0014] Traverse each vertex of the graphic contour of the target data. If the first vertex and the last vertex of the graphic contour of the target data are the same, and the area of the graphic contour of the target data is not 0, then the target data is determined to be valid target data.
[0015] In this embodiment, before segmenting the target data, the validity of the target data is determined by the closure of the vertices of the graphic contour and the non-zero area, effectively filtering out non-closed polygons or zero-area graphics, reducing the waste of computational resources in subsequent processes; by automatically verifying the legality of the data, processing errors or crashes caused by invalid data can also be avoided, further improving the degree of automation in geospatial data processing and improving data processing efficiency.
[0016] In one possible implementation, determining whether the current geographic grid meets the preset segmentation conditions includes:
[0017] Calculate the percentage of the coverage area of the current geographic grid to the total area of the current geographic grid as the grid occupancy rate of the current geographic grid, where the coverage area is the area of the target data covered by the current geographic grid;
[0018] If the grid occupancy rate is less than a first preset threshold, then the current geographic grid is determined to meet the preset segmentation conditions;
[0019] If the grid occupancy rate is greater than the second preset threshold, then it is determined that the current geographic grid does not meet the preset segmentation conditions;
[0020] If the grid occupancy rate is between the first preset threshold and the second preset threshold, then based on the current storage system status data and the current geographic grid level, a third preset threshold is generated using a preset reinforcement learning agent, and the current geographic grid is judged to meet the preset segmentation conditions based on the third preset threshold and the size of the grid occupancy rate.
[0021] This application provides a method for determining segmentation conditions. By introducing a grid occupancy rate index to represent the coverage of data in a geographic grid, it determines whether the geographic grid needs further segmentation. Furthermore, this application also provides a dynamic threshold optimization method. When the grid occupancy rate is between a first preset threshold and a second preset threshold, a dynamic threshold is generated by a reinforcement learning agent based on the storage state and grid level. This improves the flexibility and adaptability of segmentation decisions, thereby enhancing the accuracy of geographic grid segmentation.
[0022] Furthermore, the second preset threshold is calculated based on several historical geospatial data of areal features, including:
[0023] Based on the graphic outline of each of the historical geospatial data, calculate the minimum horizontal bounding rectangle and the maximum horizontal inscribed rectangle of each of the historical geospatial data.
[0024] The first index of each of the historical geospatial data is calculated based on the ratio of the area of the largest horizontal inscribed rectangle to the area of the smallest horizontal bounding rectangle.
[0025] The second index of each of the historical geospatial data is calculated based on the ratio of the area of the graphic outline to the area of the minimum horizontal bounding rectangle.
[0026] The sample mean of each of the historical geospatial data within the confidence interval is calculated based on the first indicator and the second indicator, and then the second preset threshold is determined based on the sample mean.
[0027] This application provides a method for determining a second preset threshold. Based on a first index and a second index of several historical geospatial data, the method calculates the first index and the second index to reflect the geometric characteristics of each historical geospatial data. Then, based on the geometric characteristics, the method calculates the sample mean of each historical geospatial data within the confidence interval, thereby determining the second preset threshold. This avoids relying on manual experience to set the second threshold and enhances the objectivity and rationality of grid segmentation decisions.
[0028] Furthermore, the grid segmentation representation method also includes: during the recursive segmentation process, determining in real time whether the segmentation termination condition is met; if the segmentation termination condition is met, then terminating the recursive segmentation of all geographic grids, specifically:
[0029] Calculate the total storage space occupied by each geographic grid of the current target data. If the total storage space is greater than a fourth preset threshold, then terminate the recursive segmentation.
[0030] Calculate the total number of each geographic grid in the current target data. If the total number is greater than a fifth preset threshold, then terminate the recursive segmentation.
[0031] Calculate the cumulative number of recursive segments of the current target data. If the cumulative number of recursive segments is greater than a sixth preset threshold, then terminate the recursive segmentation.
[0032] This application further introduces a segmentation termination condition. By judging the segmentation termination condition in real time, the global recursive segmentation is terminated in advance. Specifically, the judgment on storage space takes into account the utilization of storage resources by each target data, avoiding excessive storage consumption by a single target data. The judgment on the total number of geographic grids and the cumulative number of recursive segmentations limits the segmentation degree of each target data, avoiding redundant storage caused by over-segmentation of target data, effectively balancing the storage efficiency and contour fidelity of target data. Furthermore, users can adjust the termination condition as needed to optimize resource allocation strategies, ensuring controllability and predictability in the data segmentation process.
[0033] Furthermore, the sixth preset threshold is calculated based on the difference between the grid occupancy rate of the initial geographic grid and the second preset threshold.
[0034] In this embodiment, a sixth preset threshold is determined by the difference between the grid occupancy rate of the initial geographic grid and the second preset threshold, so that the sixth preset threshold is different for each target data. That is, the cumulative number of recursive segments allowed for different target data is different. When the graphic outline of the target data is more complex and the grid occupancy rate of the initial geographic grid is low, more recursive segments of the target data are allowed. When the graphic outline of the target data is simpler and the grid occupancy rate of the initial geographic grid is higher, it is necessary to avoid over-segmenting the target data. This achieves targeted processing of the target data, allowing this embodiment to flexibly control the number of segments according to the actual data coverage, and improves the generalization ability of this embodiment for different datasets.
[0035] In one possible implementation, if the recursive segmentation is terminated because the total storage space is greater than a fourth preset threshold or the total number is greater than a fifth preset threshold, then several final geographic grids that are lower than a preset level and are adjacent to each other in each final geographic grid are merged into several geographic grids of a higher geographic grid level.
[0036] In this embodiment of the application, when the recursive segmentation stops due to excessive storage space occupied by the target data or excessive number of grids, the final geographic grids are further merged. By merging adjacent small grids, redundant grid units are automatically cleaned up, storage space utilization is optimized to the maximum extent, and the efficiency of subsequent queries and rendering is improved.
[0037] Secondly, embodiments of this application provide a grid segmentation representation system for geospatial data, including an acquisition module, a bounding rectangle generation module, an initial geographic grid generation module, a recursive segmentation module, and an output module;
[0038] The acquisition module is used to acquire target data and determine whether the target data is valid target data, wherein the target data is geospatial data of areal features;
[0039] The bounding rectangle generation module is used to generate the minimum horizontal bounding rectangle of the target data according to the graphic outline of the target data if the target data is valid target data.
[0040] The initial geographic grid generation module is used to determine the smallest level grid that can cover the smallest horizontal bounding rectangle from a preset geographic grid hierarchy table, as the initial geographic grid used to represent the target data;
[0041] The recursive segmentation module is used to recursively segment the initial geographic grid several times to generate various final geographic grids. During each recursive segmentation process, it is determined whether the current geographic grid meets the preset segmentation conditions. If so, the current geographic grid is segmented according to the next level of the current geographic grid to generate several secondary geographic grids, and each secondary geographic grid is recursively segmented. If the current geographic grid does not meet the preset segmentation conditions, the recursive segmentation of the current geographic grid is stopped.
[0042] The output module is used to output the geographic grid representation data of the target data according to the grid cell identifier of each final geographic grid.
[0043] In one possible implementation, determining whether the current geographic grid meets the preset segmentation conditions includes:
[0044] Calculate the percentage of the coverage area of the current geographic grid to the total area of the current geographic grid as the grid occupancy rate of the current geographic grid, where the coverage area is the area of the target data covered by the current geographic grid;
[0045] If the grid occupancy rate is less than a first preset threshold, then the current geographic grid is determined to meet the preset segmentation conditions;
[0046] If the grid occupancy rate is greater than the second preset threshold, then it is determined that the current geographic grid does not meet the preset segmentation conditions;
[0047] If the grid occupancy rate is between the first preset threshold and the second preset threshold, then based on the current storage system status data and the current geographic grid level, a third preset threshold is generated using a preset reinforcement learning agent, and the current geographic grid is judged to meet the preset segmentation conditions based on the third preset threshold and the size of the grid occupancy rate.
[0048] Furthermore, the grid segmentation representation system also includes a segmentation termination module. This module is used to determine in real-time whether the segmentation termination condition is met during the recursive segmentation process. If the segmentation termination condition is met, the recursive segmentation of all geographic grids is terminated. Specifically:
[0049] Calculate the total storage space occupied by each geographic grid of the current target data. If the total storage space is greater than a fourth preset threshold, then terminate the recursive segmentation.
[0050] Calculate the total number of each geographic grid in the current target data. If the total number is greater than a fifth preset threshold, then terminate the recursive segmentation.
[0051] Calculate the cumulative number of recursive segments of the current target data. If the cumulative number of recursive segments is greater than a sixth preset threshold, then terminate the recursive segmentation. Attached Figure Description
[0052] Figure 1 A flowchart illustrating a grid-based representation method for geospatial data provided in this application embodiment;
[0053] Figure 2 A schematic diagram of a recursive segmentation process in a grid segmentation representation method for geospatial data provided in this application embodiment;
[0054] Figure 3 This is a schematic diagram of the initial geographic grid in a grid segmentation representation method for geospatial data provided in an embodiment of this application;
[0055] Figure 4 This is a schematic diagram of the subgrids after segmentation in a grid segmentation representation method for geospatial data provided in an embodiment of this application;
[0056] Figure 5 A schematic diagram of the final segmentation result in a grid segmentation representation method for geospatial data provided in an embodiment of this application;
[0057] Figure 6 This is a schematic diagram of the maximum horizontal inscribed rectangle generated in a grid-based representation method for geospatial data provided in an embodiment of this application.
[0058] Figure 7 A schematic diagram of the maximum horizontal inscribed rectangle and the minimum horizontal bounding rectangle generated in a grid partitioning representation method for geospatial data provided in this application embodiment;
[0059] Figure 8 This is a schematic diagram of the structure of a grid-based representation system for geospatial data provided in an embodiment of this application. Detailed Implementation
[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0061] It should be noted that the step numbers in this document are only for the convenience of explaining the specific embodiments and are not intended to limit the order in which the steps are performed. In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0062] Example 1:
[0063] like Figure 1 As shown, Embodiment 1 provides a grid-based representation method for geospatial data, including steps S1-S5:
[0064] Step S1: Obtain target data and determine whether the target data is valid target data. The target data is geospatial data of areal features.
[0065] Step S2: If the target data is valid target data, then generate the minimum horizontal bounding rectangle of the target data according to the graphic outline of the target data;
[0066] Step S3: Determine the smallest level grid that can cover the smallest horizontal bounding rectangle from the preset geographic grid hierarchy table, and use it as the initial geographic grid for representing the target data;
[0067] Step S4: Perform several recursive divisions on the initial geographic grid to generate each final geographic grid; wherein, during each recursive division process, determine whether the current geographic grid meets the preset division conditions. If so, divide the current geographic grid according to the next level grid to generate several secondary geographic grids, and recursively divide each secondary geographic grid; if the current geographic grid does not meet the preset division conditions, stop the recursive division of the current geographic grid.
[0068] Step S5: Output the geographic grid representation data of the target data according to the grid cell identifier of each final geographic grid.
[0069] This application provides a grid-based representation method for geospatial data. It recursively divides an initial geographic grid, dynamically adjusts the grid granularity, and generates final geographic grid representation data. Several final geographic grids are used to represent the target data, mapping the graphics to discretized grid cells. This provides data support for subsequent efficient compressed storage and rapid spatial computation, improving the storage and computational efficiency of geospatial data. In the specific division process, this application determines each geographic grid based on division conditions, recursively dividing only areas requiring refinement. This avoids redundant storage of a global high-precision grid, balancing storage resources and spatial accuracy, further improving the storage efficiency of geospatial data. Furthermore, this application uses a preset geographic grid hierarchy table and division conditions to automatically divide the input target data into grids without manual intervention, improving the standardization and efficiency of geospatial data processing.
[0070] Furthermore, in step S1, determining whether the target data is valid target data includes:
[0071] Calculate the area of the graphic outline of the target data;
[0072] Traverse each vertex of the graphic contour of the target data. If the first vertex and the last vertex of the graphic contour of the target data are the same, and the area of the graphic contour of the target data is not 0, then the target data is determined to be valid target data.
[0073] In this embodiment, before segmenting the target data, the validity of the target data is determined by the closure of the vertices of the graphic contour and the non-zero area, effectively filtering out non-closed polygons or zero-area graphics, reducing the waste of computational resources in subsequent processes; by automatically verifying the legality of the data, processing errors or crashes caused by invalid data can also be avoided, further improving the degree of automation in geospatial data processing and improving data processing efficiency.
[0074] The method described above for determining whether the target data is valid is also called geometric validity judgment, which checks whether there are suspended nodes that are not properly closed or connected, and whether there are self-intersecting and overlapping elements that intersect with other parts of the graphic. To determine whether a graphic forms a single-layer closed shape, the area method and vertex matching method can be used for polygons. It should be noted that this invention considers objects such as roads and rivers to be represented as planar elements.
[0075] Geometric validity assessment of polygons includes the area method and the vertex matching method. The area method determines geometric validity by calculating the area of the polygon. If the area is non-zero, the polygon is generally considered closed, and a polygon is required to have at least three vertices. If the area is zero, the polygon is either not closed or has degenerated (i.e., all points are collinear, or some points are repeated consecutively, forming a line or a point), and is therefore considered not to meet geometric validity requirements. The vertex matching method supplements cases not fully considered by the area method. For example, a closed polygon with a very small area might still be considered closed, but due to numerical precision limitations, the calculated area might be close to zero. Conversely, a degenerated polygon might have a non-zero area due to floating-point errors. Therefore, the vertex matching method is used for supplementary assessment. Specifically, if the first and last vertices of a polygon are the same, the polygon can be considered closed. Geospatial data that satisfies both the area method and the vertex matching method can be determined as valid target data.
[0076] In a preferred embodiment, in steps S2-S3, the initial geographic grid is the smallest grid level of the graphic capable of completely covering the target data through a single grid cell. It is selected based on the spatial extent of the minimum horizontal bounding rectangle (MHBR) of the graphic, automatically determined by matching preset geographic grid hierarchical rules (such as latitude and longitude intervals or projected coordinate system grid division standards). The selection method is as follows:
[0077] ① Calculate the minimum horizontal bounding rectangle (MHBR) of the figure and obtain its spatial boundary values;
[0078] ② Traverse the preset geographic grid hierarchy table, starting from the largest grid level and searching downwards until the smallest grid level that can completely cover the MHBR is found;
[0079] ③Use this level of grid as the initial geographic grid, denoted as L. X .
[0080] In one possible implementation, step S4, determining whether the current geographic grid meets the preset segmentation conditions, includes:
[0081] Calculate the percentage of the coverage area of the current geographic grid to the total area of the current geographic grid as the grid occupancy rate of the current geographic grid, where the coverage area is the area of the target data covered by the current geographic grid;
[0082] If the grid occupancy rate is less than a first preset threshold, then the current geographic grid is determined to meet the preset segmentation conditions;
[0083] If the grid occupancy rate is greater than the second preset threshold, then it is determined that the current geographic grid does not meet the preset segmentation conditions;
[0084] If the grid occupancy rate is between the first preset threshold and the second preset threshold, then based on the current storage system status data and the current geographic grid level, a third preset threshold is generated using a preset reinforcement learning agent, and the current geographic grid is judged to meet the preset segmentation conditions based on the third preset threshold and the size of the grid occupancy rate.
[0085] This application provides a method for determining segmentation conditions. By introducing a grid occupancy rate index to represent the coverage of data in a geographic grid, it determines whether the geographic grid needs further segmentation. Furthermore, this application also provides a dynamic threshold optimization method. When the grid occupancy rate is between a first preset threshold and a second preset threshold, a dynamic threshold is generated by a reinforcement learning agent based on the storage state and grid level. This improves the flexibility and adaptability of segmentation decisions, thereby enhancing the accuracy of geographic grid segmentation.
[0086] The occupancy ratio (OR) is defined as the percentage of the area of a graphic within a given grid cell relative to the total area of that grid cell. The formula is as follows:
[0087]
[0088] Among them, S graphic S represents the actual area covered by the graphic within the grid. grid This represents the total area of the grid cells.
[0089] In a preferred embodiment, the first preset threshold is set to 50%, and the second preset threshold is denoted by T, which is typically a value between 60% and 70%, dynamically adjusted according to the actual processing task. If the occupancy rate of the graphic in a certain level of grid is less than 50%, it is determined that the space utilization is insufficient, and the next level of grid segmentation must be forced to improve the accuracy of data representation. If the occupancy rate is higher than T, no segmentation is required, and the current grid level can be used as the final representation result; if the occupancy rate is between 50% and the threshold T, the value of T is dynamically adjusted according to the actual application scenario. The dynamic adjustment method is as follows: using the grid level, occupancy rate, storage resource occupancy rate, and regularity index as the state space, the threshold adjustment action (±Δ) and the composite reward function (storage resource saving + negative penalty for contour fidelity) are defined. The agent is trained through deep reinforcement learning to generate a dynamic threshold strategy; when the storage resource balance is detected to be lower than the warning threshold or the graphic complexity changes abruptly, the reinforcement learning model is triggered to intervene, and the strategy network parameters are updated based on real-time state-action to achieve adaptive optimal control of the threshold T in the spatiotemporal dimension. The threshold range [60%, 70%] is a statistical reference range based on experimental data. In practical applications, it can be adaptively modified according to specific geographic feature characteristics, system performance requirements and storage optimization goals to ensure the scientific nature and flexibility of the segmentation strategy.
[0090] In addition, through iterative experiments and feedback optimization, the rationality of the threshold setting can be verified. If the occupancy rate of the sub-grids after a certain level of grid division still does not meet the threshold requirements, the division operation is recursively executed until the termination condition is met or the preset upper limit of the grid level is reached. This mechanism takes into account both the efficiency and accuracy of data representation, effectively avoiding the waste of storage resources caused by excessive division.
[0091] In a preferred embodiment, the determination process of the division condition can be further simplified, and only the second preset threshold T is used to judge the division condition. Specifically, if OR≥T, it is considered that the current grid cell can effectively represent the graphic space characteristics, the division is terminated and the grid identifier is stored; if OR<T, the current grid is divided into the next level to generate several sub-grid cells, and the OR values of each sub-grid are recursively calculated until OR≥T is satisfied or the preset division termination condition is reached. The graph is finally represented as a set of multi-level grid cells that meet the threshold conditions. A single graph can correspond to a single high-level grid (high regularity, simple contour), or be associated with multiple mixed-level sub-grids (low regularity, complex contour). In this embodiment, as Figure 2 shown, the complete recursive division process is as follows:
[0092] 1. Initial level determination: As Figure 3 shown, based on the target data X, the corresponding initial geographical grid is determined, that is, Figure 3 the rectangle that encloses the target data X in the figure. Then, based on the initial geographical grid (example is level L X ) that can completely cover the graph, its OR value is calculated;
[0093] 2.逐级切分验证:若L X 级网格的OR<T,则据网格分级规则将其切分至L X+1 级子网格,切分后的子网格示意图如 Figure 4 所示,分别计算各子网格的OR值,对满足OR≥T的子网格,终止切分并存储;对仍不满足的子网格,递归执行L X+2 级切分,直至满足OR≥T或满足自适应切分终止机制。
[0094] 3. Result aggregation: The final division result is as Figure 5 shown, generating the final geographical grids x21, x30, x31, x04 and x1. The finally stored grid set is the identification of all grid cells that meet OR≥T, forming a compact expression of the graphic space distribution.
[0095] By superimposing the spatial ranges of all stored grid cells, it is ensured that their union completely covers the boundary of the original graph. If there are uncovered areas, the threshold adaptive adjustment mechanism is triggered to re-execute the division process.
[0096] Furthermore, the second preset threshold is calculated based on several historical geospatial data of areal features, including:
[0097] Based on the graphic outline of each of the historical geospatial data, calculate the minimum horizontal bounding rectangle and the maximum horizontal inscribed rectangle of each of the historical geospatial data.
[0098] The first index of each of the historical geospatial data is calculated based on the ratio of the area of the largest horizontal inscribed rectangle to the area of the smallest horizontal bounding rectangle.
[0099] The second index of each of the historical geospatial data is calculated based on the ratio of the area of the graphic outline to the area of the minimum horizontal bounding rectangle.
[0100] The sample mean of each of the historical geospatial data within the confidence interval is calculated based on the first indicator and the second indicator, and then the second preset threshold is determined based on the sample mean.
[0101] This application provides a method for determining a second preset threshold. Based on a first index and a second index of several historical geospatial data, the method calculates the first index and the second index to reflect the geometric characteristics of each historical geospatial data. Then, based on the geometric characteristics, the method calculates the sample mean of each historical geospatial data within the confidence interval, thereby determining the second preset threshold. This avoids relying on manual experience to set the second threshold and enhances the objectivity and rationality of grid segmentation decisions.
[0102] In a preferred embodiment, the basic parameters for evaluating the graphic are selected as the minimum horizontal bounding rectangle (MHBR) and the maximum horizontal inscribed rectangle (MHIR).
[0103] The minimum horizontal bounding rectangle reflects the compactness of the fill within the graphic. The calculation of the minimum horizontal bounding rectangle involves two parameters: its width and length, denoted as MHBR. width and MHBR length Then the area of the minimum bounding rectangle corresponding to the figure is MHBR area =MHBR width ×MHBR length .
[0104] The maximum horizontal inscribed rectangle is used to measure the fit between the outline of a shape and its bounding rectangle. The internal geometric center of the shape is determined, and a binary image is created where the outline is filled. Using an image-based approach, a search is performed with the outline portion filled with white against a black background, generating a binary image. Given the image and the coordinates of the internal geometric center, the bounding box is expanded outwards from the internal geometric center of the outline polygon, checking each pixel for connected regions. This returns the bounding box of the maximum inscribed rectangle, specifically the upper left point (coordinates (ULX, ULY)) and the lower right point (coordinates (BRX, BRY)). Figure 6 As shown. Then the area MHIR of the largest horizontally inscribed rectangle. area =|BRX-ULX|×|ULY-BRY|.
[0105] like Figure 7 As shown, the MHBR and MHIR results corresponding to the graph are generated, and the first index I is defined in conjunction with the graph area S. MHIR-MHBR Second indicator I S-MHBR The first and second indicators are used to analyze the segmentation threshold (i.e., the second preset threshold) of the image. The calculation formulas for the first and second indicators are as follows:
[0106] ①I MHIR-MHBR
[0107]
[0108] This index represents the ratio of the area of the largest horizontal inscribed rectangle to the area of the smallest horizontal bounding rectangle of a graphic. The value of the above formula ranges from (0, 100%), and the larger the value, the closer the overall outline of the graphic is to the smallest horizontal bounding rectangle.
[0109] ②I S-MHBR
[0110]
[0111] This metric represents the ratio of the area of a graphic to the area of its smallest horizontal bounding rectangle. The value of the above formula ranges from (0, 100%), and the larger the value, the closer the outer contour of the graphic is to the smallest horizontal bounding rectangle.
[0112] By collecting and calculating the first and second indicators of various historical geospatial data, and based on the data distribution characteristics, a second preset threshold is determined using a 95% confidence interval statistical method. Specifically, for a dataset containing n samples, its mean is denoted as... Given a standard deviation of s, and assuming a normal population, calculate the confidence interval using the t-distribution:
[0113]
[0114] in This is the critical value for n-1 degrees of freedom. Experimentally verified, the confidence interval for the sample mean is:
[0115]
[0116] The weighted average of the sample means within this interval is taken as the second preset threshold T. Multiple experiments show that the T value typically falls within the 60% to 70% range; this result is a statistical inference and can serve as the basis for dynamic adjustment.
[0117] Furthermore, the grid segmentation representation method also includes: during the recursive segmentation process, determining in real time whether the segmentation termination condition is met; if the segmentation termination condition is met, then terminating the recursive segmentation of all geographic grids, specifically:
[0118] Calculate the total storage space occupied by each geographic grid of the current target data. If the total storage space is greater than a fourth preset threshold, then terminate the recursive segmentation.
[0119] Calculate the total number of each geographic grid in the current target data. If the total number is greater than a fifth preset threshold, then terminate the recursive segmentation.
[0120] Calculate the cumulative number of recursive segments of the current target data. If the cumulative number of recursive segments is greater than a sixth preset threshold, then terminate the recursive segmentation.
[0121] This application further introduces a segmentation termination condition. By judging the segmentation termination condition in real time, the global recursive segmentation is terminated in advance. Specifically, the judgment on storage space takes into account the utilization of storage resources by each target data, avoiding excessive storage consumption by a single target data. The judgment on the total number of geographic grids and the cumulative number of recursive segmentations limits the segmentation degree of each target data, avoiding redundant storage caused by over-segmentation of target data, effectively balancing the storage efficiency and contour fidelity of target data. Furthermore, users can adjust the termination condition as needed to optimize resource allocation strategies, ensuring controllability and predictability in the data segmentation process.
[0122] Furthermore, the sixth preset threshold is calculated based on the difference between the grid occupancy rate of the initial geographic grid and the second preset threshold.
[0123] In this embodiment, a sixth preset threshold is determined by the difference between the grid occupancy rate of the initial geographic grid and the second preset threshold, so that the sixth preset threshold is different for each target data. That is, the cumulative number of recursive segments allowed for different target data is different. When the graphic outline of the target data is more complex and the grid occupancy rate of the initial geographic grid is low, more recursive segments of the target data are allowed. When the graphic outline of the target data is simpler and the grid occupancy rate of the initial geographic grid is higher, it is necessary to avoid over-segmenting the target data. This achieves targeted processing of the target data, allowing this embodiment to flexibly control the number of segments according to the actual data coverage, and improves the generalization ability of this embodiment for different datasets.
[0124] In a preferred embodiment, an adaptive partitioning termination mechanism is established based on the storage resource optimization objective and partitioning accuracy constraints, with the following specific rules:
[0125] (1) Termination condition of segmentation
[0126] ① Storage space limit constraint: The system presets the maximum storage capacity S for the corresponding grid group of graphics. max (i.e., the fourth preset threshold, unit: bytes), when the accumulated space occupied by the stored grid cells is S current ≥S max If the threshold condition is met, the splitting process is terminated immediately, and the grid group that currently meets the threshold condition is output as the final result.
[0127] ② Maximum grid number constraint: Set the maximum number of grid cells N that a single graphic can be associated with. max (i.e., the fifth preset threshold, unit: number of cells), if the total number of grid cells N generated during the segmentation process is... current ≥N max If the condition is met, then stop the segmentation and output the current result. The N... max The value is dynamically set based on the processing capacity and response time of the target storage system.
[0128] ③ Loop Count Constraint: Based on the difference Δ = T - OR0 between the initial grid occupancy rate OR0 and the target threshold T, the maximum number of segmentation loops K is estimated. max (i.e., the sixth preset threshold), the calculation formula is:
[0129]
[0130] Where γ is the area reduction factor of the grid cell after each level of subdivision (γ>1), and ε is the allowable occupancy error threshold (e.g., ε=5%), to ensure that the depth of the subdivision level matches the complexity of the graphics space and avoid over-subdivision.
[0131] Composite decision logic: The above three conditions are in an "OR" relationship. The splitting will be terminated when any condition is triggered, ensuring the global optimal balance between storage resource usage and system performance.
[0132] (2) Real-time monitoring and adjustment: Dynamically monitor S during the segmentation process. current With N current If S current / S max >η or N current / N max If η (η is the warning ratio, usually set to 80%), the termination condition will be triggered in advance, and subsequent splitting operations will be stopped.
[0133] In one possible implementation, if the recursive segmentation is terminated because the total storage space is greater than a fourth preset threshold or the total number is greater than a fifth preset threshold, then several final geographic grids that are lower than a preset level and are adjacent to each other in each final geographic grid are merged into several geographic grids of a higher geographic grid level.
[0134] In this embodiment of the application, when the recursive segmentation stops due to excessive storage space occupied by the target data or excessive number of grids, the final geographic grids are further merged. By merging adjacent small grids, redundant grid units are automatically cleaned up, storage space utilization is optimized to the maximum extent, and the efficiency of subsequent queries and rendering is improved.
[0135] In a preferred embodiment, a post-segmentation processing and verification mechanism is introduced, including result integrity verification and resource release mechanisms. Specifically, the result integrity verification checks whether the spatial union of the stored mesh groups completely covers the original graphic after segmentation termination. If any uncovered areas exist, an anomaly is recorded and an alarm is triggered, prompting manual intervention or adjustment of S. max N max The partitioning is re-executed after parameter adjustments. The resource release mechanism automatically cleans up redundant grid cells (such as merging adjacent low-level grids into higher-level cells) for partitioning results that are terminated due to storage limitations and grid quantity limitations, thereby maximizing storage space utilization.
[0136] Example 2:
[0137] like Figure 8 As shown, Embodiment 2 provides a grid segmentation representation system for geospatial data, including an acquisition module 10, an outer rectangle generation module 20, an initial geographic grid generation module 30, a recursive segmentation module 40, and an output module 50.
[0138] The acquisition module 10 is used to acquire target data and determine whether the target data is valid target data, wherein the target data is geospatial data of areal features;
[0139] The bounding rectangle generation module 20 is used to generate the minimum horizontal bounding rectangle of the target data according to the graphic outline of the target data if the target data is valid target data.
[0140] The initial geographic grid 30 generation module is used to determine the smallest level grid that can cover the smallest horizontal bounding rectangle from the preset geographic grid hierarchy table, as the initial geographic grid used to represent the target data;
[0141] The recursive segmentation module 40 is used to recursively segment the initial geographic grid several times to generate each final geographic grid. During each recursive segmentation process, it is determined whether the current geographic grid meets the preset segmentation conditions. If so, the current geographic grid is segmented according to the next level of the current geographic grid to generate several secondary geographic grids, and each secondary geographic grid is recursively segmented. If the current geographic grid does not meet the preset segmentation conditions, the recursive segmentation of the current geographic grid is stopped.
[0142] The output module 50 is used to output the geographic grid representation data of the target data according to the grid cell identifier of each final geographic grid.
[0143] Furthermore, the acquisition module 10 determines whether the target data is valid target data, including:
[0144] Calculate the area of the graphic outline of the target data;
[0145] Traverse each vertex of the graphic contour of the target data. If the first vertex and the last vertex of the graphic contour of the target data are the same, and the area of the graphic contour of the target data is not 0, then the target data is determined to be valid target data.
[0146] In one possible implementation, determining whether the current geographic grid meets the preset segmentation conditions includes:
[0147] Calculate the percentage of the coverage area of the current geographic grid to the total area of the current geographic grid as the grid occupancy rate of the current geographic grid, where the coverage area is the area of the target data covered by the current geographic grid;
[0148] If the grid occupancy rate is less than a first preset threshold, then the current geographic grid is determined to meet the preset segmentation conditions;
[0149] If the grid occupancy rate is greater than the second preset threshold, then it is determined that the current geographic grid does not meet the preset segmentation conditions;
[0150] If the grid occupancy rate is between the first preset threshold and the second preset threshold, then based on the current storage system status data and the current geographic grid level, a third preset threshold is generated using a preset reinforcement learning agent, and the current geographic grid is judged to meet the preset segmentation conditions based on the third preset threshold and the size of the grid occupancy rate.
[0151] Furthermore, the second preset threshold is calculated based on several historical geospatial data of areal features, including:
[0152] Based on the graphic outline of each of the historical geospatial data, calculate the minimum horizontal bounding rectangle and the maximum horizontal inscribed rectangle of each of the historical geospatial data.
[0153] The first index of each of the historical geospatial data is calculated based on the ratio of the area of the largest horizontal inscribed rectangle to the area of the smallest horizontal bounding rectangle.
[0154] The second index of each of the historical geospatial data is calculated based on the ratio of the area of the graphic outline to the area of the minimum horizontal bounding rectangle.
[0155] The sample mean of each of the historical geospatial data within the confidence interval is calculated based on the first indicator and the second indicator, and then the second preset threshold is determined based on the sample mean.
[0156] Furthermore, the grid segmentation representation system also includes a segmentation termination module. This module is used to determine in real-time whether the segmentation termination condition is met during the recursive segmentation process. If the segmentation termination condition is met, the recursive segmentation of all geographic grids is terminated. Specifically:
[0157] Calculate the total storage space occupied by each geographic grid of the current target data. If the total storage space is greater than a fourth preset threshold, then terminate the recursive segmentation.
[0158] Calculate the total number of each geographic grid in the current target data. If the total number is greater than a fifth preset threshold, then terminate the recursive segmentation.
[0159] Calculate the cumulative number of recursive segments of the current target data. If the cumulative number of recursive segments is greater than a sixth preset threshold, then terminate the recursive segmentation.
[0160] Furthermore, the sixth preset threshold is calculated based on the difference between the grid occupancy rate of the initial geographic grid and the second preset threshold.
[0161] Furthermore, if the recursive segmentation is terminated because the total storage space is greater than the fourth preset threshold or the total number is greater than the fifth preset threshold, then several final geographic grids that are lower than the preset level and are adjacent in each final geographic grid will be merged into several geographic grids of a higher geographic grid level.
[0162] This application provides a grid-based representation system for geospatial data. It recursively divides an initial geographic grid, dynamically adjusts the grid granularity, and generates final geographic grid representation data. Several final geographic grids are used to represent the target data, mapping the graphics to discretized grid cells. This provides data support for subsequent efficient compressed storage and rapid spatial computation, improving the storage and computational efficiency of geospatial data. In the specific division process, this application determines each geographic grid based on division conditions, recursively dividing only areas requiring refinement. This avoids redundant storage of a global high-precision grid, balancing storage resources and spatial accuracy, further improving the storage efficiency of geospatial data. Furthermore, this application automatically divides the input target data using a preset geographic grid hierarchy table and division conditions, requiring no manual intervention throughout the process, thus improving the standardization and efficiency of geospatial data processing.
[0163] For a more detailed explanation of the working principle and procedures of this embodiment, please refer to the relevant description in Embodiment 1.
[0164] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application for those skilled in the art.
Claims
1. A method of mesh-cut representation of geospatial data, characterized in that, The method comprises the following steps: acquiring target data and determining whether the target data is valid target data, the target data being geographic spatial data of a planar element; the determination of whether the target data is valid target data comprises: calculating the area of the graphic contour of the target data; traversing each vertex of the graphic contour of the target data; if the first vertex and the last vertex of the graphic contour of the target data are the same and the area of the graphic contour of the target data is not 0, it is determined that the target data is valid target data; if the target data is valid target data, a minimum horizontal circumscribed rectangle of the target data is generated according to the graphic contour of the target data; a minimum level grid capable of covering the minimum horizontal circumscribed rectangle is determined from a preset geographic grid level table as an initial geographic grid for representing the target data; the initial geographic grid is recursively split for several times to generate each final geographic grid; wherein in each recursive splitting process, it is determined whether the current geographic grid meets the preset splitting condition; if yes, the current geographic grid is split according to the next level grid of the current geographic grid to generate several secondary geographic grids, and each secondary geographic grid is recursively split; if the current geographic grid does not meet the preset splitting condition, the recursive splitting of the current geographic grid is stopped; the determination of whether the current geographic grid meets the preset splitting condition comprises: calculating the percentage of the coverage area of the current geographic grid to the total area of the current geographic grid as the grid occupancy rate of the current geographic grid, the coverage area being the area of the target data covered by the current geographic grid; if the grid occupancy rate is less than a first preset threshold, it is determined that the current geographic grid meets the preset splitting condition; if the grid occupancy rate is greater than a second preset threshold, it is determined that the current geographic grid does not meet the preset splitting condition; if the grid occupancy rate is between the first preset threshold and the second preset threshold, a third preset threshold is generated according to the current storage system state data and the geographic grid level of the current geographic grid using a preset reinforcement learning agent, and it is determined whether the current geographic grid meets the preset splitting condition according to the third preset threshold and the size of the grid occupancy rate; geographic grid representation data of the target data is output according to the grid cell identifiers of each final geographic grid.
2. A method of meshed representation of geospatial data as claimed in claim 1 wherein, The second preset threshold is calculated based on a plurality of historical geographic spatial data of planar elements, comprising: the minimum horizontal circumscribed rectangle and the maximum horizontal inscribed rectangle of each historical geographic spatial data are calculated according to the graphic contour of each historical geographic spatial data; a first index of each historical geographic spatial data is calculated according to the area ratio of the maximum horizontal inscribed rectangle and the minimum horizontal circumscribed rectangle; a second index of each historical geographic spatial data is calculated according to the area ratio of the graphic contour and the minimum horizontal circumscribed rectangle; The first index and the second index are used to calculate sample mean values of each historical geospatial data within a confidence interval, and the second preset threshold is determined according to the sample mean values.
3. A method of meshed representation of geospatial data as claimed in claim 1, wherein, The grid segmentation representation method further comprises: in the recursive segmentation process, judging in real time whether a segmentation termination condition is met, and if the segmentation termination condition is met, terminating the recursive segmentation of all geographic grids, specifically: calculating the total storage space occupied by each geographic grid of the target data, and if the total storage space is greater than a fourth preset threshold, terminating the recursive segmentation; calculating the total number of each geographic grid of the target data, and if the total number is greater than a fifth preset threshold, terminating the recursive segmentation; calculating the cumulative recursive segmentation times of the target data, and if the cumulative recursive segmentation times are greater than a sixth preset threshold, terminating the recursive segmentation.
4. A method of meshed representation of geospatial data as claimed in claim 3 wherein, The sixth preset threshold is calculated according to the difference between the grid occupancy rate of the initial geographic grid and the second preset threshold.
5. A method of meshed representation of geospatial data as claimed in claim 3 wherein, If the recursive segmentation is terminated due to the total storage space being greater than the fourth preset threshold or the total number being greater than the fifth preset threshold, a number of final geographic grids that are lower than a preset level and adjacent are merged into a number of geographic grids of a higher geographic grid level.
6. A system for a grid cut representation of geospatial data, characterized in that, The method comprises an acquisition module, a minimum horizontal bounding rectangle generation module, an initial geographic grid generation module, a recursive segmentation module, and an output module. The acquisition module is configured to acquire target data and determine whether the target data is valid target data, wherein the target data is geospatial data of a planar feature. The determination of whether the target data is valid target data comprises: calculating the area of the graphic contour of the target data; traversing each vertex of the graphic contour of the target data, and if the first vertex and the last vertex of the graphic contour of the target data are the same and the area of the graphic contour of the target data is not 0, determining that the target data is valid target data. The minimum horizontal bounding rectangle generation module is configured to generate a minimum horizontal bounding rectangle of the target data according to the graphic contour of the target data if the target data is valid target data. The initial geographic grid generation module is configured to determine a minimum level grid capable of covering the minimum horizontal bounding rectangle from a preset geographic grid level table as an initial geographic grid for representing the target data. The recursive segmentation module is configured to perform recursive segmentation on the initial geographic grid for a number of times to generate each final geographic grid, wherein in each recursive segmentation process, it is determined whether a current geographic grid meets a preset segmentation condition, and if yes, the current geographic grid is segmented according to a next level grid of the current geographic grid to generate a number of secondary geographic grids, and each secondary geographic grid is recursively segmented; and if the current geographic grid does not meet the preset segmentation condition, the recursive segmentation of the current geographic grid is stopped. The determining whether the current geographic grid meets the preset splitting condition comprises: calculating a percentage of a covered area of the current geographic grid to a total area of the current geographic grid as a grid occupancy rate of the current geographic grid, the covered area being an area of the current geographic grid covering the target data; if the grid occupancy rate is less than a first preset threshold, determining that the current geographic grid meets the preset splitting condition; if the grid occupancy rate is greater than a second preset threshold, determining that the current geographic grid does not meet the preset splitting condition; if the grid occupancy rate is between the first preset threshold and the second preset threshold, generating a third preset threshold according to a current storage system state data and a geographic grid level of the current geographic grid using a preset reinforcement learning agent, and determining whether the current geographic grid meets the preset splitting condition according to the third preset threshold and the size of the grid occupancy rate. The output module is configured to output the geographic grid representation data of the target data according to the respective grid cell identifiers of the final geographic grids.
7. A system for grid-based representation of geospatial data as claimed in claim 6, wherein, The grid splitting representation system further comprises a splitting termination module configured to determine in real time whether a splitting termination condition is met in the recursive splitting process, and terminate the recursive splitting of all geographic grids if the splitting termination condition is met, specifically: calculating a total storage space occupied by each geographic grid of the target data, and terminating the recursive splitting if the total storage space is greater than a fourth preset threshold; calculating a total number of each geographic grid of the target data, and terminating the recursive splitting if the total number is greater than a fifth preset threshold; calculating a cumulative recursive splitting number of the target data, and terminating the recursive splitting if the cumulative recursive splitting number is greater than a sixth preset threshold.
Citation Information
Patent Citations
Geographic space object indexing method and device, storage medium and computer equipment
CN119719115A
Geohash-based spatial-data processing method and apparatus, and electronic device
WO2023185144A1