A method and device for judging and conducting the connection of map vector graph spots
Patent Information
- Application Number
- CN202610685299.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-19
- Publication Date
- 2026-08-18
AI Technical Summary
一方面,传统的矢量图斑技术计算效率低下,难以应对海量数据,例如面对县域级十万乃至百万量级的图斑数据,传统的两两遍历距离计算时间复杂度为指数级的O(N2),且单线程处理耗时极长,无法满足大规模高效计算的需求,而简单多线程并行时,由于图斑大小、形状复杂度不均,易导致线程空闲与等待,多核CPU利用率低
本申请提供了一种地图矢量图斑连片性判定和传导方法及装置,融合动态任务调度、STRtree空间索引、形态学分析及广度优先搜索(BFS)策略进行图斑连片性判定和传导,摒弃了弃传统的简单多线程或全局遍历方法,根据图斑顶点的空间分布密度构建非均匀计算网格,建立所述图斑与所述逻辑网格的映射关系,然后根据所述映射关系计算每个所述逻辑网格的任务权重,通过所述任务权重为处理器线程分配任务队列,平衡CPU核心负载,实现硬件资源的饱和式利用,将计算复杂度从O(N2)降至对数级别,从而支撑百万级图斑的快速处理。另一方面,采用改进的广度优先搜索(BFS)进行连片属性传导。首先筛选满足面积阈值和形态要求的“种子”图斑(“狭长”图斑不作为种子),随后建立BFS队列,然后以种子为中心,利用空间索引递归检索并吸纳距离阈值内的邻近图斑,结合上述几何校验算法,实现“A连B,B连C,则A连C”的连片状态全局传导,准确识别出复杂的大规模连片区,逐层向外传播连片状态。满足了国土空间规划、耕地保护等业务中对空间连续性、完整性的严苛要求,实现了分析逻辑的闭环。
Smart Images

Figure CN122597289A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of geological data processing technology, and in particular to a method and apparatus for determining and transmitting the contiguousness of map vector plots. Background Technology
[0002] In fields such as land spatial planning, farmland protection, and natural resource monitoring, it is often necessary to conduct "continuousness" analysis on vector plots (such as land parcels, farmland, and forest land) in maps, that is, to determine which plots can be regarded as a continuous area under certain distance and area thresholds.
[0003] Traditional vector map data techniques primarily rely on overlay analysis and buffered queries within Geographic Information Systems (GIS), which presents significant bottlenecks when processing large-scale (e.g., millions) map data points. On one hand, traditional vector map data techniques are computationally inefficient and struggle to handle massive datasets. For instance, when dealing with hundreds of thousands or even millions of map data points at the county level, the time complexity of traditional pairwise traversal distance calculations is exponentially O(N^2). 2 Furthermore, single-threaded processing is extremely time-consuming, failing to meet the demands of large-scale, efficient computing. Simple multi-threaded parallel processing, due to uneven patch size and shape complexity, easily leads to thread idleness and waiting, resulting in low multi-core CPU utilization. On the other hand, the geometric and topological judgment logic of overlay analysis and buffered query is simplistic and does not align with practical business needs: existing methods typically rely solely on the area of a single patch or a simple "shortest distance < threshold" rule, leading to two patches being judged as connected simply because they are only in weak contact through their "diagonal vertices" (visually not actually connected), which does not meet practical requirements such as the continuity of agricultural operations. Simultaneously, the algorithm lacks a recursive propagation mechanism and cannot automatically identify large, topologically connected patches formed by "A connects to B, B connects to C, then A connects to C". Summary of the Invention
[0004] This application provides a method and apparatus for determining and transmitting the contiguousness of map vector plots, which can significantly improve the computational efficiency and accuracy of determining and transmitting the contiguousness of map vector plots.
[0005] Firstly, this application provides a method for determining the contiguousness of patches in a map vector image, employing the following technical solution: A method for determining the contiguousness of map vector plots includes the following steps: The spatial extent of the target vector layer is acquired, and the spatial extent is divided into several logical grids; Traverse each patch within the spatial range and establish a mapping relationship between the patch and the logical grid; Calculate the task weight of each logical grid according to the mapping relationship, and allocate task queues to processor threads based on the task weights; In response to the completion of all tasks in the task queue, the processing results of all task queues are merged using the STRtree spatial index to obtain the contiguousness determination result of the patch in the target vector layer.
[0006] Furthermore, establishing the mapping relationship between the patch and the logical grid includes the following steps: Traverse each patch within the spatial range and calculate the bounding rectangle of the patch; Extract all the logical grids covered by the outer rectangle, and denote the logical grid where the geometric center point of the outer rectangle is located as the main grid of the patch, and denote all the logical grids covered by the outer rectangle except the main grid as the secondary grids; Establish the reference relationship between the primary grid and the secondary grid to obtain the mapping relationship between the feature and the logical grid.
[0007] Furthermore, the above-mentioned calculation of the task weight of each logical grid based on the mapping relationship includes the following steps: The number of vertices of each patch is calculated based on the outer rectangle; Calculate the task weight for each of the logical grids, whereby the task weight is the sum of the number of vertices of the main grid and the sum of the number of vertices of the referenced grid, multiplied by the attenuation coefficient.
[0008] Furthermore, the above-mentioned allocation of task queues to processor threads based on task weights includes the following steps: Initialize the Java ForkJoinPool and set the concurrency level to the number of processor threads; A task queue is generated by arranging the tasks in descending order according to their weights, and the task queue is then allocated to each thread. In response to a thread completing all tasks in its assigned task queue, unexecuted tasks are stolen from the tail of the task queues of other still busy threads until all task queues of all said threads have been processed.
[0009] Secondly, this application provides a device for determining the contiguousness of map vector plots, which adopts the following technical solution: A device for determining the contiguousness of map vector plots, employing the map vector plot contiguousness determination method described above, includes: The acquisition module is used to acquire the spatial range of the target vector layer and divide the spatial range into several logical grids; The mapping module is used to traverse each patch within the spatial range and establish a mapping relationship between the patch and the logical grid. The calculation module is used to calculate the task weight of each logical grid according to the mapping relationship, and allocate task queues to processor threads based on the task weights; The output module is used to respond to the completion of all tasks in the task queue by merging the processing results of all task queues through the STRtree spatial index, obtaining the contiguousness determination result of the patch in the target vector layer, and outputting it.
[0010] Thirdly, this application provides a method for transmitting the contiguousness of map vector plots, employing the following technical solution: A method for transmitting the contiguousness of map vector plots includes the following steps: The spatial index of all patches in the target vector layer is constructed using the STRtree algorithm, and patches that meet the preset area threshold and shape requirements are selected and recorded as seed patches. Centered on the seed patch, a breadth-first search queue is established by recursively retrieving and absorbing neighboring patches within a distance threshold using spatial indexing. The narrow and elongated patches in the breadth-first search queue are removed using the minimum bounding rectangle algorithm to obtain the transmission queue; Extract the unprocessed patches from the transmission queue according to the queue order, and filter out the candidate patch set whose distance from the unprocessed patch is less than a preset distance threshold using the spatial index; By eliminating pseudo-connected patches from the candidate patch set through fitting determination and adaptive projection determination, valid connected patches are obtained. The valid connected patches are added to the tail of the conduction queue until the conduction queue is recursively completed.
[0011] Furthermore, the above-mentioned process of eliminating pseudo-connected patches from the candidate patch set through fitting determination and adaptive projection determination includes the following steps: Preset fitting threshold, distance threshold, and effective width threshold; Calculate the Euclidean distance between any two candidate patches in the candidate patch set. If the Euclidean distance is less than or equal to the fitting threshold, the two patches are determined to be valid contiguous patches. If the Euclidean distance is greater than the distance threshold, the two patches are determined to be pseudo-contiguous patches. If the Euclidean distance is less than or equal to the distance threshold and greater than the fitting threshold, the adaptive projection is used to determine whether the two patches are valid contiguous patches.
[0012] Furthermore, the above-mentioned method of removing narrow patches from the breadth-first search queue using the minimum bounding rectangle algorithm includes the following steps: The minimum bounding rectangle of the candidate patch is calculated using the minimum bounding rectangle algorithm, and the length and width of the minimum bounding rectangle are extracted. If the width is less than the preset minimum value, the patch to be judged is determined to be a narrow and elongated patch and is removed; If the width is greater than or equal to a preset minimum value, calculate the aspect ratio, compactness, and eccentricity of the minimum bounding rectangle. After normalizing the aspect ratio, compactness, and eccentricity, calculate the comprehensive score of the small bounding rectangle by weighting. If the comprehensive score is greater than a preset comprehensive score threshold, determine that the patch to be judged is a narrow patch and remove it. If the comprehensive score is less than or equal to the preset comprehensive score threshold, add the patch to be judged to the transmission queue.
[0013] Furthermore, after the aforementioned contiguous transfer of the target vector layer is completed, it also includes: A spatial index of all polygons in all vector layers is constructed using the STRtree algorithm as a cross-layer index. Traverse each patch of the target vector layer, and filter neighboring patches whose Euclidean distance to the patch of the target vector layer is less than or equal to a preset distance threshold and whose overlapping area is greater than or equal to a preset area threshold through the cross-layer index, to obtain a set of neighboring patches; Calculate the minimum convex hull of the neighboring patch and the corresponding patch in the target vector layer. Using the minimum convex hull as the query area, perform spatial intersection filtering on the neighboring layer where the neighboring patch is located through the cross-layer index to obtain the patch that intersects with the neighboring patch as the effective contiguous neighbor of the neighboring patch. Using the adjacent effective contiguous patches as seed patches, the contiguous transmission is performed on the adjacent layers.
[0014] Fourthly, this application provides a map vector map patch continuity transmission device, which adopts the following technical solution: A device for transmitting the contiguous nature of map vector map patches, employing the map vector map patch contiguous nature transmission method described above, includes: The index module is used to construct a spatial index of all patches in the target vector layer using the STRtree algorithm, and to select patches that meet the preset area threshold and shape requirements as seed patches. The queue module is used to establish a breadth-first search queue centered on the seed patch, recursively searching and absorbing neighboring patches within a distance threshold using a spatial index; The narrow and elongated patches in the breadth-first search queue are removed using the minimum bounding rectangle algorithm to obtain the transmission queue; Extract the unprocessed patches from the transmission queue according to the queue order, and filter out the candidate patch set whose distance from the unprocessed patch is less than a preset distance threshold using the spatial index; The output module is used to remove pseudo-connected patches from the candidate patch set through fitting determination and adaptive projection determination, obtain valid connected patches, add the valid connected patches to the tail of the conduction queue, and output the valid connected patches in the conduction queue until the conduction queue is recursively completed.
[0015] In summary, this application includes at least one of the following beneficial technical effects: This application provides a method and apparatus for determining and transmitting the contiguousness of map vector patches. It integrates dynamic task scheduling, STRtree spatial indexing, morphological analysis, and breadth-first search (BFS) strategy for patch contiguousness determination and transmission. It abandons traditional simple multi-threaded or global traversal methods, constructing a non-uniform computational grid based on the spatial distribution density of patch vertices, establishing a mapping relationship between the patches and the logical grid, and then calculating the task weight of each logical grid based on the mapping relationship. The task weight is used to allocate task queues to processor threads, balancing CPU core load and achieving saturated utilization of hardware resources. This reduces computational complexity from O(N²) to the logarithmic level, thus supporting the rapid processing of millions of patches. Furthermore, an improved breadth-first search (BFS) is used for contiguousness attribute transmission. First, seed patches that meet the area threshold and shape requirements are selected ("narrow and elongated" patches are not considered seeds). Then, a BFS queue is established. Next, using the seed as the center, a spatial index is recursively used to retrieve and incorporate neighboring patches within a distance threshold. Combined with the aforementioned geometric verification algorithm, the contiguous state of "A connects to B, B connects to C, then A connects to C" is globally propagated, accurately identifying complex, large-scale contiguous areas and propagating the contiguous state outward layer by layer. This meets the stringent requirements for spatial continuity and integrity in land spatial planning, farmland protection, and other business operations, achieving a closed-loop analysis logic. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the method for determining the contiguousness of map vector plots in the embodiments of this application.
[0017] Figure 2 This is a schematic diagram of the method for transmitting the continuous pattern of map vector patches in the embodiments of this application.
[0018] Figure 3 This is a schematic diagram of dynamic grid partitioning and task allocation in the embodiments of this application.
[0019] Figure 4 This is a schematic diagram illustrating the principle of multi-directional projection overlap verification in the embodiments of this application.
[0020] Figure 5 This is a schematic diagram of BFS seed propagation and contiguous transport in the embodiments of this application.
[0021] Figure 6This is a schematic diagram of multi-layered stray capture in the embodiments of this application.
[0022] Figure 7 This is a schematic diagram comparing the removal of pseudo-connected pieces in the embodiments of this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0024] In the embodiments of this application, a method for determining and transmitting the contiguousness of map vector patch data is provided, aiming to solve the problem that traditional Geographic Information Systems (GIS) have significant bottlenecks when processing large-scale (e.g., millions of) patch data. For example, the bottlenecks may include the following aspects: (1) Low computational efficiency, making it difficult to handle massive amounts of data: When faced with county-level map data of hundreds of thousands or even millions of patches, the traditional pairwise traversal distance calculation has a time complexity of O(N). 2 Single-threaded processing takes a very long time and cannot meet the needs of large-scale efficient computing. When using simple multi-threaded parallel processing, the uneven size and shape complexity of the patches can easily lead to thread idleness and waiting, resulting in low utilization of multi-core CPUs.
[0025] To address this issue, this implementation provides a method for determining the contiguousness of map vector patches, based on dynamic grid task scheduling using vertex density (solving the bottleneck of computational efficiency for massive data). It abandons traditional simple multi-threading or global traversal methods, employing a "dynamic grid partitioning + work-stealing" mechanism. A non-uniform computational grid is constructed based on the spatial distribution density of patch vertices, and a Fork / Join framework is used to dynamically balance the CPU core load, achieving saturated utilization of hardware resources and reducing computational complexity from O(N^2) to O(N^2). 2 The logarithmic level is reduced to support the rapid processing of millions of patches.
[0026] (2) The geometric and topological judgment logic is too simplistic and does not conform to actual business practices: Existing methods usually judge based on the area of a single patch or the simple rule of "shortest distance < threshold". This results in two patches being judged as connected just because they are only in slight contact through the "diagonal vertex" (visually not actually connected). This does not meet the actual requirements of agricultural continuity. At the same time, the algorithm lacks a recursive propagation mechanism and cannot automatically identify large connected patches with topological propagation formed by "A connects to B, B connects to C, then A connects to C".
[0027] To address this issue, this implementation provides a method for transmitting the contiguousness of map vector patches. It integrates a topology analysis process combining seed propagation and shortest path capture, employing an improved breadth-first search (BFS) for contiguousness attribute transmission. First, "seed" patches that meet area thresholds and morphological requirements are selected ("narrow" patches are not considered seeds). Then, a BFS queue is established. Next, using the seed as the center, spatial indexing is used to recursively retrieve and absorb neighboring patches within a distance threshold. Combined with the aforementioned geometric verification algorithm, the global transmission of contiguousness states ("A connects to B, B connects to C, then A connects to C") is achieved, accurately identifying complex large-scale contiguous areas and propagating the contiguousness state outwards layer by layer. A geometric contiguousness verification algorithm based on fit determination and adaptive projection is used: to accurately eliminate "pseudo-contiguous" patches, multi-level morphological verification is introduced after distance screening. The algorithm first performs a fast fit determination; patches that are completely or nearly fitted (e.g., distance ≤ 1 mm) are directly identified as valid contiguous patches. For non-aligned patches that meet the distance threshold, an adaptive projection direction selection strategy is adopted: a connection vector is constructed based on the closest point pair of two patches, and an adaptive projection axis set is formed by its direction, vertical direction, and 45° oblique direction. The overlap length of the projection interval of two patches on each projection axis is calculated, and the maximum overlap is taken as the criterion. Only when the maximum projection overlap exceeds a set threshold (e.g., 5 meters) is it considered a valid "wide-edge adjacent". This algorithm not only ensures the fast and accurate determination of aligned patches, but also effectively identifies the true surface contact under various spatial relative orientations through adaptive projection direction, accurately eliminating "pseudo-connected" cases with weak contact only through points or diagonal vertices, making the contiguous area determination results more in line with the actual requirements of continuous farming or construction.
[0028] High risk of missed detection and inaccurate identification of "mixed" patches, affecting the integrity of the results: When judging the proximity between the target patch and the reference patch layer, the traditional buffer method is prone to incorrectly including interfering patches on non-shortest paths, or missing tiny "mixed" patches located on the shortest connected path between the target and the reference layer, resulting in logical loopholes and fragmentation in the contiguous identification results.
[0029] To address this issue, this embodiment provides a method for transmitting the contiguous nature of map vector plots. When determining the proximity of plots across layers (such as between a target plot and a reference layer), it not only calculates the Euclidean distance but also constructs a connected coverage area between the target plot and the reference layer. A spatial index is then used to query all plots intersecting this coverage area. These plots located within the connected coverage area (including small "interspersed" plots) are all determined to be adjacent or contiguous, thereby resolving the problems of logical discontinuity and fragmented results, and ensuring the integrity of spatial transmission relationships.
[0030] To address the above problems, this application discloses a method for determining the contiguousness of map vector plots, employing the following technical solution: Reference Figure 1A method for determining the contiguousness of map vector plots includes the following steps: S101: Preprocess the data of the target vector layer; In this embodiment, before determining the contiguousness of map vector patches, it is necessary to preprocess the data of the target vector layer, project the vector data into a coordinate system (ensuring it is a planar coordinate system), establish a projected coordinate system, and check whether the source file contains multiple components (MultiPolygon). If so, the user is prompted to split the components.
[0031] S102: Collect the spatial range of the target vector layer and divide the spatial range into several logical grids; Reference Figure 3 In this embodiment, it is necessary to first read the target vector layer, obtain its spatial extent, and divide it into an N * N logical grid in the X and Y directions of the projection coordinate system. N is dynamically set according to the total number of patches, for example, one grid unit corresponds to every 10,000 patches.
[0032] S103: Traverse each patch within the spatial range and establish a mapping relationship between the patch and the logical grid; In this implementation, each patch Fi is traversed, its bounding rectangle (MBR) is calculated, and all meshes covered by the MBR are identified. The complete patch object is stored in the mesh containing its geometric center (called the "master mesh"), and its ID reference is stored in the other covering meshes ("secondary meshes"), thus obtaining the mapping relationship between the patch and the logical mesh. Simultaneously, the number of vertices for each patch is calculated.
[0033] S104: Calculate the task weight of each logical grid according to the mapping relationship, and allocate task queues to processor threads based on the task weights; In this embodiment, for each grid Gj, the task weight is calculated. .in This is the attenuation coefficient (which can be set according to the actual task requirements, such as 0.5), to avoid double-counting. Press The task queue is generated in descending order. The time taken for geometric operations (such as intersection and distance) is linearly or logarithmically positively correlated with the number of vertices, making this a more accurate basis for load assessment than the number of polygons.
[0034] S105: Processes tasks in the task queue sequentially through the processor thread, while performing task stealing scheduling based on Fork / Join. In this implementation, tasks in the task queue are processed sequentially by processor threads using a map vector patch contiguous propagation method. Task stealing scheduling requires initializing a Java ForkJoinPool with concurrency set to the number of CPU cores. All grid tasks are sorted in descending order of weight Wj to generate a task queue. Work-stealing: When a CPU core (thread) quickly completes its assigned high-weight task, it does not become idle but automatically "steals" unexecuted smaller tasks from the tail of other still-busy thread queues.
[0035] S106: In response to the completion of all tasks in the task queue, the processing results of all task queues are merged through the STRtree spatial index to obtain the contiguousness determination result of the patch in the target vector layer.
[0036] In this embodiment, each thread maintains an independent local result container ThreadLocal using the STRtree spatial index established in step S105. <Map<String, String> During the computation, no global variables need to be locked. After all tasks are completed, a parallel Stream.reduce operation is performed to merge the final results, thus obtaining the contiguousness determination result of the patches in the target vector layer.
[0037] Reference Figure 2 In one embodiment of this application, in order to solve the problem of sequentially processing tasks in the task queue by the processor thread in step S105, a method for transmitting the contiguousness of map vector patch is also disclosed, which adopts the following technical solution: S201: Construct a spatial index of all patches in the target vector layer using the STRtree algorithm; In this implementation, STRtree (spatial index tree) is a common data structure used to accelerate spatial queries. Spatial indexes are very important in database systems and geographic information systems (GIS), especially when processing large-scale geographic data. By dividing the target vector layer into multiple regions and constructing a tree structure to organize these regions, a foundation is laid for subsequent fast spatial queries.
[0038] S202: Select the patches that meet the preset area threshold and shape requirements and record them as seed patches. Using the seed patches as the center, recursively search and absorb neighboring patches within the distance threshold using spatial index to establish a breadth-first search queue. Reference Figure 5 In this embodiment, the parallel architecture disclosed in step S105 allows for rapid traversal of all patches in the target vector layer, and the setting of a preset area threshold. (acres), preset distance threshold (meters), if the area of the patch is greater than... Mark it as a seed feature and add it to the breadth-first search (BFS) queue. If the feature area is less than 1, then add it to the queue. Then query its STRtree Within the buffer zone, the effective cluster area S is calculated after removing "pseudo-contiguous neighbors" from the neighbor set. If all patches within the effective cluster are marked as seed patches, they are added to the breadth-first search (BFS) queue.
[0039] S203: Eliminate narrow and elongated patches in the breadth-first search queue using the minimum bounding rectangle algorithm to obtain the transmission queue; In this embodiment, to avoid linear features (such as roads, ditches, and field ridges) acting as a medium for continuous transmission, leading to unreasonable extension of the contiguous area, a multi-index comprehensive method for determining the elongated shape of vector patches based on the minimum bounding rectangle (MBR) is proposed. For the vector patch to be determined (usually a polygonal geometry), the system calls the minimum bounding rectangle algorithm from the spatial geometry library (such as the MinimumDiameter algorithm from the JTS library) to calculate the minimum area bounding rectangle of the patch (unlike the axis-aligned rectangle AABB, this rectangle is aligned with the principal axis of the patch). After obtaining the minimum bounding rectangle, the lengths of its two adjacent sides are extracted. and The longer value is designated as the length, and the shorter value as the width. If the width is less than the preset minimum value (e.g., 1e-6 meters), it is directly identified as an extremely narrow or linear feature.
[0040] In this implementation, using the minimum bounding rectangle instead of the axis-aligned rectangle can accurately identify elongated patches at any rotation angle, avoiding misjudgment. Combining three complementary morphological indicators—aspect ratio, compactness, and eccentricity—describes the elongated features from different dimensions, making the judgment results more reliable. Through parameter configuration, users can flexibly adjust the judgment criteria according to specific business scenarios without modifying the core algorithm.
[0041] Both the minimum bounding rectangle calculation and the index calculation have linear complexity and can be completed in batches during the patch preprocessing stage, with minimal impact on the overall contiguous analysis performance. Seamless integration with the contiguous area transfer process effectively avoids excessive expansion of contiguous areas caused by linear feature transfer, ensuring the rationality and practicality of contiguous zoning.
[0042] In one embodiment of this application, based on the acquired MBR and the original map features, three core morphological indicators can be calculated: Aspect Ratio: The larger this value, the more significant the extension of the patch in a certain direction.
[0043] Compactness: Calculated using the Polsby-Popper formula. Where Area is the area of the patch and Perimeter is the perimeter. This value is between 0 and 1, with the closer to 0 indicating a more elongated shape and the closer to 1 indicating a more circular shape.
[0044] Eccentricity: Calculated based on the length and width of the MBR. This value ranges from 0 to 1. The closer it is to 0, the closer the shape is to a square. The closer it is to 1, the closer the shape is to a line segment.
[0045] To comprehensively evaluate the elongation of map patches, the three indicators mentioned above need to be normalized, and a weighted summation method should be used to calculate the comprehensive score: Aspect ratio normalization: using the Sigmoid function. ,in The aspect ratio threshold (e.g., 7.0). This is an adjustment factor (e.g., 0.5).
[0046] Compactness normalization: ,in This is the compactness threshold (e.g., 0.3). When hour, Set it directly to 0.
[0047] Eccentricity normalization: ,in This is the eccentricity threshold (e.g., 0.85). When hour, Set it directly to 0.
[0048] Overall rating: ,in These are the weights of each indicator (e.g., 0.5, 0.2, 0.3).
[0049] Set a comprehensive score threshold (e.g., 0.6). If If so, the patch is determined to be a narrow and elongated patch.
[0050] In this embodiment, during the continuous transmission process, the following strategy is adopted for the pattern marked as narrow and elongated: When used as a transmission source: if the current patch taken from the queue is determined to be narrow and long, then the patch is skipped and the continuous property is no longer transmitted outward from it.
[0051] When used as a transmission target: If a certain patch is determined to be narrow and long, even if it meets the distance and projection overlap conditions with the current contiguous area, the system will only mark it as contiguous, but will not add it to the transmission queue, that is, prevent the contiguous attribute from continuing to be transmitted outward through the narrow and long patch.
[0052] By dynamically adjusting the thresholds and weights through configuration, this embodiment can adapt to different application scenarios: In agricultural plot scenarios: The aspect ratio threshold can be appropriately increased (e.g., set to 8.0), and the compactness threshold can be decreased (e.g., set to 0.25) to distinguish between narrow and long field ridges and normal strip-shaped farmland.
[0053] Construction land scenario: The aspect ratio threshold can be appropriately reduced (e.g., set to 4.0) to improve the sensitivity to linear buildings (such as walls and green belts).
[0054] Linear feature scenarios: It can simultaneously reduce the aspect ratio and compactness thresholds to accurately identify typical linear features such as roads and rivers.
[0055] S204: Extract the unprocessed patches from the transmission queue according to the queue order, and filter out a set of candidate patches whose distance from the unprocessed patches is less than a preset distance threshold using the spatial index; In this embodiment, when the transmission queue is not empty, the map patch P is retrieved from the transmission queue, and the spatial index is used to query the surrounding areas with a distance ≤ 1. Candidate patch set This further simplifies the calculation process.
[0056] S205: By using the fitting determination and adaptive projection determination, pseudo-connected patches in the candidate patch set are removed to obtain valid connected patches. The valid connected patches are added to the tail of the conduction queue until the conduction queue is recursively completed.
[0057] In this embodiment, to address the problem that "two patches meet the threshold distance but only have corner-to-corner contact (point contact), which does not provide continuity for agricultural cultivation", this embodiment adds a complete morphological verification process after the distance determination. Through the dual judgment mechanism of "fitting priority + adaptive projection", the accuracy of "pseudo-connected patches" removal is greatly improved while ensuring computational efficiency.
[0058] Reference Figure 4 and Figure 7 In one embodiment of this application, the process of eliminating pseudo-connected patches from the candidate patch set through fitting determination and adaptive projection determination includes the following steps: S301: Rapid bonding judgment and initial distance screening; For any two polygons A and B to be determined, first calculate their Euclidean distance. The system is configured with three levels of threshold settings: Fitting threshold Minimum values (e.g., 0.001 meters) are used to identify patches that are physically perfectly or nearly perfectly aligned.
[0059] Distance threshold The maximum connection distance set by the service (e.g., 70 meters).
[0060] Effective width threshold Minimum effective contact width (e.g., 5 meters).
[0061] The decision logic is as follows: like The system directly determines that the two patches are valid contiguous areas and ends the current process.
[0062] like The system directly determines that the two patches are not contiguous and ends the current process.
[0063] like Then proceed to the next step of adaptive projection overlap calculation.
[0064] S302: For non-fitting patches that pass the initial screening, the system adaptively determines the optimal projection direction based on their spatial relative position; In this embodiment, the calculation of the optimal projection direction first requires calculating the nearest point pair. The nearest point algorithm in the geometry library is called to obtain the nearest point pair on the boundaries of patch A and patch B. and Then determine the main projection direction and calculate the connection vector. And find its direction angle. Then, based on the principal direction angle θ_main, four key projection directions are generated: Direction 1: (Connection direction) Direction 2: (Vertical direction) Direction 3: (Upper right diagonal direction) Direction 4: (Lower right diagonal direction) This adaptive direction set ensures that, regardless of the relative orientation of two patches, at least one direction's projection accurately reflects their effective contact degree, with particular optimization for identifying "corner-to-corner" contact situations.
[0065] S303: Orthogonal projection calculation and interval determination; In this embodiment, for each projection direction Calculate the unit direction vector Calculate the projection coverage areas of patch A and patch B in this direction respectively. For patch A, the projection calculation involves obtaining the set of coordinates of all vertices of the geometric outer contour of patch A. For each vertex coordinate (x, y), calculate its projection scalar value: Find all The minimum and maximum values in the graph form the patch A. Coverage range in the direction Similarly, calculate the projected coverage area of patch B. .
[0066] S304: For each projection direction Calculate the intersection length of two projection intervals. The maximum value among all directions is taken as the final overlap: Considering the correlation between distance and overlap, when two patches are close but not aligned, the overlap requirement should be appropriately relaxed: if Then a dynamic threshold is used: Otherwise, the original threshold will still be used. ,like The system determines that the two patches are validly contiguous. If The system determined that the two patches were "pseudo-connected" and forcibly severed their connection.
[0067] In this embodiment, a very small threshold is used to directly identify mating patches, avoiding unnecessary complex calculations and significantly improving algorithm efficiency. Simultaneously, it ensures that 100% of mating patches are correctly identified as contiguous. The projection axis is dynamically determined based on the nearest point pair direction, which, compared to fixed-angle projection, more accurately captures the actual spatial relationship between two patches, making it particularly suitable for determining contiguous patches of irregular shapes. Two 45° oblique directions are added to the connection and vertical directions to form a three-dimensional projection network, effectively identifying effective contact in various relative orientations and avoiding missed detections. Considering the negative correlation between distance and contact width, the requirements are appropriately relaxed for non-matting patches that are very close together, avoiding abrupt changes in interpretation due to slight distance differences. This makes the judgment results smoother and more reasonable, accurately distinguishing between true surface contact, effective line contact, and invalid point contact within milliseconds. While improving computational efficiency, it ensures the accuracy of contiguous patch determination, avoiding misjudging patches with only "corner-to-corner" contact as contiguous.
[0068] In one embodiment of this application, the fitting threshold It is recommended to set the distance threshold to 0.001 meters (1 millimeter), which can both identify the fitted patches and avoid interference from floating-point calculation errors. The effective width threshold is determined based on the actual business scenario; for example, it can be set to 30-70 meters for contiguous farmland analysis. The value should be determined based on the minimum effective contact requirement. If the operating width of agricultural machinery is taken into account, it can be set to 3-5 meters.
[0069] Reference Figure 6 In one embodiment of this application, when determining the proximity of a target patch (such as between a target patch and a reference layer), not only is the Euclidean distance calculated, but a connected coverage area between the target patch and the reference layer is also constructed. A spatial index is then used to query all patches that intersect with this coverage area. These patches located within the connected coverage area (including small "interspersed" plots) will be determined as adjacent or contiguous, thereby resolving the problems of logical discontinuity and result fragmentation, and ensuring the integrity of spatial transmission relationships.
[0070] In this embodiment, each patch Fa in reference layer A is traversed, and spatial indexing is used to search for " " in layer B. and The target patches Fb and their corresponding reference patches Fa are selected to form an initial set of compliant patches M. For each target patch Fb in set M and its corresponding reference patch Fa, the minimum convex hull of the geometric union of Fa and Fb is calculated, denoted as H(Fa, Fb). This convex hull is the minimum convex polygon formed by all vertices of Fa and Fb, which can completely cover all potential connected regions between the two patches, including curved paths and intermediate filled areas. Using H(Fa, Fb) as the query region, a spatial intersection query is performed in the target layer B using a pre-built spatial index. Any patch in layer B whose geometry intersects with H(Fa, Fb), regardless of its area size, is identified as an "intercalated patch within a connected region" and forcibly marked as a contiguous area (LP). All layer B patches marked as contiguous areas are used as a new seed set, and the BFS propagation process of Example 4 is executed within layer B to further expand and consolidate the contiguous areas.
[0071] In one embodiment of this application, in order to meet the real-time analysis needs of millions or even larger-scale vector pattern data, a vectorization acceleration scheme based on hardware primitives is further introduced on the basis of the aforementioned core algorithm to improve the efficiency of intensive geometric operations.
[0072] Data vectorization organization (AoS to SoA): The geometric objects of the patches to be calculated are flattened. Before performing batch judgment (such as neighborhood verification in the determination of the narrow shape of patches), the vertex coordinates involved are extracted from the discrete object memory addresses and constructed into a continuous floating-point array (double[]). This organization method is compatible with the SIMD (Single Instruction Multiple Data) instruction set of modern CPUs (such as AVX-2, AVX-512) or the memory access mode of general GPUs, which greatly improves the cache hit rate.
[0073] Parallelization of computational instructions: For multi-directional projection verification in adaptive projection, the trigonometric function operations of the four-directional projection rotation matrix are abstracted into vector operators. Through a hardware acceleration adapter, the dot product operation, which originally required multiple loops, is converted into a single vectorized instruction execution, enabling the coordinate transformation of multiple vertices and the selection of interval extrema within one instruction cycle.
[0074] Asynchronous Pipeline Scheduling: Establishes an asynchronous pipeline between CPU logical scheduling and hardware-accelerated execution. While the CPU core performs BFS queue maintenance and spatial index retrieval, the hardware accelerator synchronously and in parallel processes the previously distributed geometry verification tasks. A double-buffering mechanism hides data transfer latency, ensuring that the Alternating Unit (ALU) is always operating at full capacity. This is particularly suitable for scenarios requiring repetitive matrix operations and vector processing, such as multi-directional projection verification, and can improve the computation speed of this stage by one to two orders of magnitude.
[0075] This application also discloses a device for determining the contiguousness of map vector plots, which adopts the following technical solution: A device for determining the contiguousness of map vector plots, employing the map vector plot contiguousness determination method described above, includes: The acquisition module is used to acquire the spatial range of the target vector layer and divide the spatial range into several logical grids; The mapping module is used to traverse each patch within the spatial range and establish a mapping relationship between the patch and the logical grid. The calculation module is used to calculate the task weight of each logical grid according to the mapping relationship, and allocate task queues to processor threads based on the task weights; The output module is used to respond to the completion of all tasks in the task queue by merging the processing results of all task queues through the STRtree spatial index, obtaining the contiguousness determination result of the patch in the target vector layer, and outputting it.
[0076] The map vector patch contiguousness determination device of this application embodiment can implement any of the above-mentioned methods for determining the contiguousness of map vector patches, and the specific working process of each module in the map vector patch contiguousness determination device can be referred to the corresponding process in the above-mentioned method embodiment.
[0077] This application also discloses a map vector patch continuity transmission device, which adopts the following technical solution: A device for transmitting the contiguous nature of map vector map patches, employing the map vector map patch contiguous nature transmission method described above, includes: The index module is used to construct a spatial index of all patches in the target vector layer using the STRtree algorithm, and to select patches that meet the preset area threshold and shape requirements as seed patches. The queue module is used to establish a breadth-first search queue centered on the seed patch, recursively searching and absorbing neighboring patches within a distance threshold using a spatial index; The narrow and elongated patches in the breadth-first search queue are removed using the minimum bounding rectangle algorithm to obtain the transmission queue; Extract the unprocessed patches from the transmission queue according to the queue order, and filter out the candidate patch set whose distance from the unprocessed patch is less than a preset distance threshold using the spatial index; The output module is used to remove pseudo-connected patches from the candidate patch set through fitting determination and adaptive projection determination, obtain valid connected patches, add the valid connected patches to the tail of the conduction queue, and output the valid connected patches in the conduction queue until the conduction queue is recursively completed.
[0078] The map vector patch continuity transmission device of this application embodiment can realize any of the above-mentioned methods for map vector patch continuity transmission, and the specific working process of each module in the map vector patch continuity transmission device can refer to the corresponding process in the above-mentioned method embodiment.
[0079] In the several embodiments provided in this application, it should be understood that the provided methods and apparatus can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for example, the division of a component is merely a logical functional division, and in actual implementation there may be other division methods, such as multiple components can be combined or integrated into another system, or some features can be ignored or not executed.
[0080] This application also discloses a computer device.
[0081] Computer equipment, including memory, processor, and computer program stored in memory and executable on the processor, wherein the processor executes the computer program to implement the multi-source heterogeneous geological data desensitization method described above.
[0082] This application also discloses a computer-readable storage medium.
[0083] A computer-readable storage medium storing a computer program that can be loaded by a processor and executed as any of the above-described methods for desensitizing multi-source heterogeneous geological data.
[0084] The computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device; the program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0085] In summary, this application provides a method and apparatus for determining and transmitting the contiguousness of map vector patches. It integrates dynamic task scheduling, STRtree spatial indexing, morphological analysis, and breadth-first search (BFS) strategies for patch contiguousness determination and transmission. It abandons traditional simple multi-threaded or global traversal methods, and by introducing STRtree spatial indexing, dynamic mesh partitioning, and task-stealing mechanisms, it achieves optimal utilization of multi-core CPU computing resources, completely avoiding the performance bottleneck of full pairwise computation. When processing massive vector patches ranging from tens of thousands to millions, it can compress the computation time of traditional methods, which would take hours or even days, to minutes, while maintaining CPU utilization stably above 90%, achieving an order-of-magnitude efficiency improvement. It also includes automatic coordinate system verification, complex geometric processing (such as MultiPolygon splitting), and dynamic load assessment based on computational complexity, enabling the system to adapt to different data qualities and hardware environments, and possessing good engineering application potential. A dual mechanism ensures the accuracy of spatial relationship determination. On the one hand, by constructing "shortest path segments," the system accurately identifies "interspersed" patches along the path, which is more consistent with the actual logic of spatial obstruction / connection than simple buffer analysis. On the other hand, the unique multi-directional projection overlap algorithm effectively eliminates visually unreasonable connections such as "diagonal pseudo-contiguous patches," making the automated judgment results highly consistent with the experience judgments of business experts. Through BFS topology propagation and the shortest path interspersed capture mechanism, all logically consistent contiguous patches can be systematically discovered and associated, including those plots in "bridges" or "gaps" that are easily missed by traditional distance queries, ensuring the integrity and practicality of contiguous zoning. At the same time, during contiguous propagation, narrow and elongated patches are not used as seeds for propagation, avoiding the situation where two non-adjacent large patches are connected by a thin and long small patch and are misjudged as contiguous. This meets the stringent requirements for spatial continuity and integrity in land spatial planning, farmland protection, and other business operations, realizing a closed loop of analytical logic.
[0086] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0087] The above are all preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is only one example of a series of equivalent or similar features.
Claims
1. A method for determining the contiguousness of map vector plots, characterized in that, Includes the following steps: The spatial extent of the target vector layer is acquired, and the spatial extent is divided into several logical grids; Traverse each patch within the spatial range and establish a mapping relationship between the patch and the logical grid; Calculate the task weight of each logical grid according to the mapping relationship, and allocate task queues to processor threads based on the task weights; In response to the completion of all tasks in the task queue, the processing results of all task queues are merged using the STRtree spatial index to obtain the contiguousness determination result of the patch in the target vector layer.
2. The method for determining the contiguousness of map vector plots according to claim 1, characterized in that, Establishing the mapping relationship between the feature and the logical grid includes the following steps: Traverse each patch within the spatial range and calculate the bounding rectangle of the patch; Extract all the logical grids covered by the outer rectangle, and denote the logical grid where the geometric center point of the outer rectangle is located as the main grid of the patch, and denote all the logical grids covered by the outer rectangle except the main grid as the secondary grids; Establish the reference relationship between the primary grid and the secondary grid to obtain the mapping relationship between the feature and the logical grid.
3. The method for determining the contiguousness of map vector plots according to claim 2, characterized in that, The step of calculating the task weight of each logical grid according to the mapping relationship includes the following steps: The number of vertices of each patch is calculated based on the outer rectangle; Calculate the task weight for each of the logical grids, whereby the task weight is the sum of the number of vertices of the main grid and the sum of the number of vertices of the referenced grid, multiplied by the attenuation coefficient.
4. The method for determining the contiguousness of map vector plots according to any one of claims 1 or 3, characterized in that, The process of allocating task queues to processor threads based on task weights includes the following steps: Initialize the Java ForkJoinPool and set the concurrency level to the number of processor threads; A task queue is generated by arranging the tasks in descending order according to their weights, and the task queue is then allocated to each thread. In response to a thread completing all tasks in its assigned task queue, unexecuted tasks are stolen from the tail of the task queues of other still busy threads until all task queues of all said threads have been processed.
5. A device for determining the contiguousness of map vector plots, employing the method for determining the contiguousness of map vector plots as described in any one of claims 1-4, characterized in that, include: The acquisition module is used to acquire the spatial range of the target vector layer and divide the spatial range into several logical grids; The mapping module is used to traverse each patch within the spatial range and establish a mapping relationship between the patch and the logical grid. The calculation module is used to calculate the task weight of each logical grid according to the mapping relationship, and allocate task queues to processor threads based on the task weights; The output module is used to respond to the completion of all tasks in the task queue by merging the processing results of all task queues through the STRtree spatial index, obtaining the contiguousness determination result of the patch in the target vector layer, and outputting it.
6. A method for transmitting the contiguous nature of map vector plots, characterized in that, Includes the following steps: The spatial index of all patches in the target vector layer is constructed using the STRtree algorithm, and patches that meet the preset area threshold and shape requirements are selected and recorded as seed patches. Centered on the seed patch, a breadth-first search queue is established by recursively retrieving and absorbing neighboring patches within a distance threshold using spatial indexing. The narrow and elongated patches in the breadth-first search queue are removed using the minimum bounding rectangle algorithm to obtain the transmission queue; Extract the unprocessed patches from the transmission queue according to the queue order, and filter out the candidate patch set whose distance from the unprocessed patch is less than a preset distance threshold using the spatial index; By eliminating pseudo-connected patches from the candidate patch set through fitting determination and adaptive projection determination, valid connected patches are obtained. The valid connected patches are added to the tail of the conduction queue until the conduction queue is recursively completed.
7. The method for transmitting the contiguous nature of map vector plots according to claim 6, characterized in that, The process of eliminating pseudo-connected patches from the candidate patch set through fitting determination and adaptive projection determination includes the following steps: Preset fitting threshold, distance threshold, and effective width threshold; Calculate the Euclidean distance between any two candidate patches in the candidate patch set. If the Euclidean distance is less than or equal to the fitting threshold, the two patches are determined to be valid contiguous patches. If the Euclidean distance is greater than the distance threshold, the two patches are determined to be pseudo-contiguous patches. If the Euclidean distance is less than or equal to the distance threshold and greater than the fitting threshold, the adaptive projection is used to determine whether the two patches are valid contiguous patches.
8. The method for transmitting the contiguous nature of map vector plots according to claim 6, characterized in that, The step of removing narrow and elongated patches from the breadth-first search queue using the minimum bounding rectangle algorithm includes the following steps: The minimum bounding rectangle of the candidate patch is calculated using the minimum bounding rectangle algorithm, and the length and width of the minimum bounding rectangle are extracted. If the width is less than the preset minimum value, the patch to be judged is determined to be a narrow and elongated patch and is removed; If the width is greater than or equal to a preset minimum value, calculate the aspect ratio, compactness, and eccentricity of the minimum bounding rectangle. After normalizing the aspect ratio, compactness, and eccentricity, calculate the comprehensive score of the small bounding rectangle by weighting. If the comprehensive score is greater than a preset comprehensive score threshold, determine that the patch to be judged is a narrow patch and remove it. If the comprehensive score is less than or equal to the preset comprehensive score threshold, add the patch to be judged to the transmission queue.
9. The method for transmitting the continuous pattern of map vector plots according to any one of claims 6-8, characterized in that, After the target vector layer is transferred in a continuous manner, the process also includes: A spatial index of all polygons in all vector layers is constructed using the STRtree algorithm as a cross-layer index. Traverse each patch of the target vector layer, and filter neighboring patches whose Euclidean distance to the patch of the target vector layer is less than or equal to a preset distance threshold and whose overlapping area is greater than or equal to a preset area threshold through the cross-layer index, to obtain a set of neighboring patches; Calculate the minimum convex hull of the neighboring patch and the corresponding patch in the target vector layer. Using the minimum convex hull as the query area, perform spatial intersection filtering on the neighboring layer where the neighboring patch is located through the cross-layer index to obtain the patch that intersects with the neighboring patch as the effective contiguous neighbor of the neighboring patch. Using the adjacent effective contiguous patches as seed patches, the contiguous transmission is performed on the adjacent layers.
10. A device for transmitting the contiguous nature of map vector plots, employing the method for transmitting the contiguous nature of map vector plots as described in any one of claims 6-9, characterized in that, include: The index module is used to construct a spatial index of all patches in the target vector layer using the STRtree algorithm, and to select patches that meet the preset area threshold and shape requirements as seed patches. The queue module is used to establish a breadth-first search queue centered on the seed patch, recursively searching and absorbing neighboring patches within a distance threshold using a spatial index; The narrow and elongated patches in the breadth-first search queue are removed using the minimum bounding rectangle algorithm to obtain the transmission queue; Extract the unprocessed patches from the transmission queue according to the queue order, and filter out the candidate patch set whose distance from the unprocessed patch is less than a preset distance threshold using the spatial index; The output module is used to remove pseudo-connected patches from the candidate patch set through fitting determination and adaptive projection determination, obtain valid connected patches, add the valid connected patches to the tail of the conduction queue, and output the valid connected patches in the conduction queue until the conduction queue is recursively completed.