Attribute Matching Method and System in Parallel Map Overlay Analysis Based on Hilbert Spatial Coding
By generating globally unique Hilbert spatial codes and constructing a code-attribute mapping dictionary, the problems of high computational complexity and attribute matching conflicts in parallel map overlay analysis are solved, achieving efficient and accurate attribute matching and consistency processing.
Patent Information
- Application Number
- CN202511417229.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-09-30
AI Technical Summary
Traditional parallel map overlay analysis suffers from high computational complexity, low attribute matching efficiency, easy conflict in multi-layer attribute transfer, errors caused by floating-point precision errors, and inability to directly determine topological relationships in distributed computing.
A globally unique Hilbert spatial code is generated by calculating the geometric center point of the polygon. A code-attribute mapping dictionary is constructed. The Hilbert code is processed in blocks in parallel. K-nearest neighbor search is used to weighted fuse attribute values to resolve attribute matching conflicts.
It reduces computational complexity, improves the accuracy and efficiency of attribute matching, ensures consistency and fault tolerance in parallel processing of massive amounts of data, and reduces invalid computation.
Smart Images

Figure CN120892434B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of geographic information system technology, and more specifically to an attribute matching method and system for parallel map overlay analysis based on Hilbert spatial coding. Background Technology
[0002] Attribute matching in parallel map overlay analysis is a commonly used analysis technique in Geographic Information Systems (GIS). GIS technology is widely used in fields such as urban planning, land use monitoring, and environmental management. One of its core functions is to extract spatial relationships and attribute association information through multi-layer overlay analysis. For example, by overlaying the land use layer with the administrative division layer, it is possible to identify areas where cultivated land has been converted into construction land and simultaneously migrate attributes such as land type and ownership.
[0003] The existing technology has the following problems: traditional overlay analysis relies on geometric intersection operations, which has high computational complexity and low efficiency when dealing with massive amounts of data; multi-layer attribute transfer requires traversing all intersecting polygons, and attribute matching conflicts are prone to occur when parallelizing; boundary polygons may cause attribute matching errors due to floating-point precision errors (such as the boundary between roads and administrative divisions); in distributed computing, topological relationships cannot be directly determined for cross-node polygons.
[0004] To address the aforementioned technical problems, spatial indexing (R-tree / Quadtree), grid-based attribute copying methods, and Hilbert encoding are commonly used to resolve their shortcomings. However, spatial indexing only accelerates geometric queries and struggles to solve the uniqueness problem of attribute matching; grid-based attribute copying methods can lead to the loss of edge attributes; and existing Hilbert encoding is typically designed for point data or bounding rectangles, making it unsuitable for accurate shape verification of polygon features. Therefore, the present invention aims to solve the problem of how to generate globally unique Hilbert spatial codes by calculating the geometric center points of polygons, establishing an encoding-attribute mapping dictionary, and achieving accurate attribute copying without topological queries in parallel computing. To this end, an attribute matching method and system based on Hilbert spatial encoding for parallel map overlay analysis is proposed. Summary of the Invention
[0005] The purpose of this invention is to provide an attribute matching method and system for parallel map overlay analysis based on Hilbert spatial coding, so as to solve the problems mentioned in the background art.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] The first aspect is the attribute matching method in parallel map overlay analysis based on Hilbert spatial coding, which includes the following steps:
[0008] Step 1: Determine the target area, read and load the vector polygon data of the source layer and the target layer that need to be overlaid for analysis;
[0009] Step 2: Calculate the geometric center point of each polygon and generate a globally unique Hilbert spatial code based on the spatial range;
[0010] Step 3: Analyze the vector polygon data of the source layer, associate and store the Hilbert spatial code with the corresponding polygon attributes, and construct a source layer code-attribute mapping dictionary;
[0011] Step 4: Divide the target layer into blocks according to Hilbert spatial encoding and assign them to different nodes for parallel processing and overlay analysis tasks;
[0012] Step 5: Match source attributes using Hilbert spatial encoding. Each node independently searches for the same Hilbert spatial encoding; if it exists, the attribute is copied directly.
[0013] Step 6: When Hilbert spatial encoding is not available, automatically switch to K-nearest neighbor search (K=3) and fuse attribute values by weighting Hilbert distance;
[0014] Step 7: Summarize the vector polygon data that have completed attribute matching, output the final overlay analysis results, and store them.
[0015] A further improvement to the technical solution of the present invention is that step 1 specifically includes:
[0016] Determine the spatial extent of the target area, and load the vector polygon data of the source and target layers through the GIS system or data interface;
[0017] The geometric integrity and attribute field structure of the vector polygon data of the source and target layers are checked to ensure data format compatibility and consistent spatial reference. The geometric check includes verifying whether the polygons are closed and free of self-intersections or redundant vertices. The attribute check includes verifying whether the field names, data types and value ranges are consistent and unifying the spatial reference of the source and target layers.
[0018] A further improvement to the technical solution of this invention lies in the following: In step 2, the process of generating a globally unique Hilbert spatial code based on the spatial range is as follows:
[0019] For each polygon in the source and target layers, the coordinates of its geometric center point are calculated using GIS algorithms to ensure that the center point position reflects the spatial centroid of the polygon.
[0020] Based on the spatial extent of the target area and the preset system accuracy threshold, the order k of the Hilbert spatial curve is calculated to ensure that the encoding covers the entire area. The spatial extent includes width and height, and the preset system accuracy threshold is 0.001 map units by default.
[0021] The coordinates of the geometric center point of the polygon are mapped to the Hilbert space curve to generate a 64-bit globally unique code. The space filling property of the Hilbert space curve is used to ensure the uniqueness of the code, and the lossless conversion from coordinates to Hilbert values is determined. The generated code is then used as the globally unique identifier of the polygon, i.e., the unique Hilbert space code.
[0022] A further improvement to the technical solution of this invention lies in the following: In step 3, the process of constructing the source layer encoding-attribute mapping dictionary is as follows:
[0023] Traverse each vector polygon in the source layer, read its attribute fields, and obtain the pre-calculated Hilbert space code. Temporarily store the code and attribute in key-value pair form to form a preliminary source layer code-attribute mapping dictionary.
[0024] The key-value pairs in the temporary storage are deduplicated and verified to ensure that each Hilbert spatial code uniquely corresponds to a set of attributes. A hash table is used for storage to support efficient querying. For large-scale data, the data is partitioned according to the range of the Hilbert spatial code to improve the performance of parallel access.
[0025] The spatial proximity relationships of each Hilbert spatial code are pre-computed and cached in the source layer encoding-attribute mapping dictionary, while the statistical characteristics of the attribute fields are recorded.
[0026] A further improvement to the technical solution of this invention lies in the following: the process of forming the preliminary source layer encoding-attribute mapping dictionary is as follows:
[0027] Load each vector polygon data of the source layer into memory, parse its geometric structure and attribute table format, confirm the storage field of Hilbert space encoding, and then initialize the memory dictionary structure, defining the key as a 64-bit unsigned integer type of Hilbert space encoding and the value as an expandable attribute dictionary container, ensuring support for dynamic field addition and type compatibility checks.
[0028] Iterate through each vector polygon in the source layer, simultaneously performing geometric analysis, encoding-attribute association, and exception handling operations;
[0029] After completing the traversal, the in-memory dictionary is validated, including uniqueness checks and field integrity verification. The validated key-value pairs are then organized into a hierarchical dictionary to compress storage space and improve subsequent query efficiency, outputting a preliminary source layer encoding-attribute mapping dictionary.
[0030] A further improvement to the technical solution of the present invention is that step 4 specifically includes:
[0031] Based on the Hilbert spatial encoding range of the target layer, it is divided into several continuous, non-overlapping encoding blocks. The blocks are dynamically allocated based on the number of cluster nodes to ensure load balancing. The boundary information (encoding range, geometric range) of each block is broadcast to the corresponding node as the input unit for parallel processing.
[0032] Each node loads the allocated Hilbert block data, builds a local spatial index to accelerate geometric queries, performs analysis tasks based on the input in parallel to determine the spatial relationship between the target layer and the overlay layer, and temporarily stores the feature pairs that meet the conditions and their attribute association results in the node memory buffer.
[0033] Each node sorts its local analysis results according to Hilbert spatial encoding and sends them back to the master node. The master node merges conflicting results across node boundaries by detecting overlapping encoding ranges and deduplicating them according to the business rules of timestamps, generating a globally consistent overlay analysis result set.
[0034] A further improvement to the technical solution of the present invention is that step 5 specifically includes:
[0035] Each node loads Hilbert block data according to the dynamically divided Hilbert spatial coding range, constructs a mapping table from coding to features (the key is the Hilbert spatial code, and the value is the set of feature attributes), ensures coding continuity, and aggregates feature attributes with the same coding within the node to form a local coding-attribute dictionary;
[0036] Each node performs matching independently based on the source layer code-attribute mapping dictionary. It iterates through the Hilbert spatial codes of the target features. If the same code exists in the source layer code-attribute mapping dictionary, the source feature attributes are directly copied to the target feature. Otherwise, it is skipped.
[0037] The master node collects the local encoding-attribute dictionary output by each node, detects duplicate encodings across node boundaries according to the Hilbert spatial encoding range, performs deduplication on the attribute results of duplicate encodings, merges them into a globally consistent attribute mapping table, and outputs a complete result set sorted by encoding, ensuring no conflicts and spatial order.
[0038] A further improvement to the technical solution of the present invention is that step 6 specifically includes:
[0039] Each node loads block data based on the dynamically divided Hilbert spatial coding range and constructs a local coding-attribute mapping table. If the Hilbert spatial coding of the target feature is missing in the local coding-attribute mapping table, the coding is marked as unmatched, and a K-nearest neighbor search (K=3) is triggered as a fallback mechanism to ensure the continuity of attribute transmission.
[0040] For unmatched target features, the three nearest coded features are searched in the global space with the target feature's Hilbert spatial code as the center. The weight is calculated based on the Hilbert distance between the target code and the neighboring codes, with higher weights for closer distances.
[0041] The attribute values of the K nearest neighbors are aggregated by weight (weighted average for numerical attributes and voting selection for categorical attributes) to generate supplementary attributes for the target element. After the master node collects the results from each node, duplicate codes are merged. Directly matching attributes are retained, and K nearest neighbor results are used as alternatives. Finally, a globally consistent and spatially continuous code-attribute mapping table is generated.
[0042] A further improvement to the technical solution of this invention lies in the following: In step 7, the process of outputting and storing the final overlay analysis result is as follows:
[0043] The master node collects the local encoding-attribute mapping tables of each node, prioritizes merging direct matching results to ensure the integrity of high-priority data, supplements the K nearest neighbor results for duplicate encodings, adjudicates conflicts according to timestamps, retains the latest attribute values, and generates a conflict-free globally consistent mapping table.
[0044] Based on the globally consistent mapping table, each vector polygon is filled with the corresponding attributes of the matching Hilbert spatial code. Unmatched features retain their original geometric information and are marked with missing attributes. Then, the vector polygons are arranged in ascending order of the codes to ensure spatial continuity and generate a dataset with complete attributes to be analyzed.
[0045] Spatial overlay operation is performed on the attribute-filled vector polygon data to generate an analysis result layer. The results are then sorted according to Hilbert spatial encoding and stored in a distributed file system.
[0046] Secondly, an attribute matching system for parallel map overlay analysis based on Hilbert spatial coding is provided to implement the aforementioned attribute matching method for parallel map overlay analysis based on Hilbert spatial coding, including:
[0047] The data loading and verification module is used to load vector polygon data from the source and target layers, verify geometric integrity and attribute field structure, and ensure data compatibility.
[0048] The Hilbert encoding generation module is used to calculate the geometric center point of polygons, generate globally unique Hilbert spatial codes, establish a source layer encoding-attribute mapping dictionary, solve the problem of attribute matching uniqueness under massive data, and support parallel computing.
[0049] The parallel task allocation and processing module is used to divide the target layer into blocks according to Hilbert spatial encoding, allocate them to different nodes for parallel processing and overlay analysis tasks, accelerate distributed computing, and reduce cross-node topology judgment overhead.
[0050] The attribute matching and fusion module is used to match source attributes through Hilbert spatial encoding. If no match is found, it switches to K-nearest neighbor search and weights and fuses attribute values, thereby outputting and storing the final superposition analysis results. This solves the floating-point error problem of boundary polygons and improves the accuracy of attribute matching.
[0051] Due to the adoption of the above technical solution, the technical progress achieved by this invention compared to the prior art is as follows:
[0052] 1. This invention provides an attribute matching method and system for parallel map overlay analysis based on Hilbert spatial coding. By calculating the geometric center point of polygons to generate globally unique Hilbert spatial codes, it avoids the high complexity problem of geometric intersection operations in traditional methods. The uniqueness of the code ensures the accuracy of attribute matching. Especially in the case of massive data, the parallel processing of Hilbert spatial coding significantly reduces the computation time. At the same time, the spatial filling characteristic of the code ensures that the codes of adjacent polygons are similar, further optimizing the locality of attribute transfer and reducing invalid calculations.
[0053] 2. This invention provides an attribute matching method and system for parallel map overlay analysis based on Hilbert spatial coding. It constructs a source layer coding-attribute mapping dictionary through Hilbert spatial coding, and each node independently processes the coding block. Attributes are matched directly through coding, eliminating the need for topological relationship judgment. When the coding does not exist, it automatically switches to K-nearest neighbor search weighted fusion attribute values, ensuring the consistency and fault tolerance of attribute matching in a parallel environment. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0055] Figure 1 This is a schematic diagram illustrating the workflow of the attribute matching method and system in parallel map overlay analysis based on Hilbert spatial coding, as described in this invention.
[0056] Figure 2 This is a schematic diagram illustrating the workflow of the attribute matching method in the parallel map overlay analysis based on Hilbert spatial coding of this invention. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0058] Example 1, such as Figure 1 , Figure 2 As shown, this invention provides an attribute matching method for parallel map overlay analysis based on Hilbert spatial coding, comprising the following steps:
[0059] Step 1: Determine the target area. Read and load the vector polygon data of the source and target layers to be overlaid for analysis. Determine the spatial extent of the target area. Load the vector polygon data of the source and target layers through the GIS system or data interface. Check the geometric integrity and attribute field structure of the vector polygon data of the source and target layers to ensure data format compatibility and consistent spatial reference. Geometric checks include verifying whether the polygons are closed and free of self-intersections or redundant vertices. Attribute checks include verifying whether the field names, data types, and value ranges are consistent and unifying the spatial reference of the source and target layers.
[0060] The specific tasks are as follows: First, determine the spatial extent of the target area. Second, load vector polygon data from the source and target layers using a GIS system or data interface to ensure complete data coverage of the target area. Third, check the reliability of the data source and verify the spatial reference consistency during loading to avoid overlay misalignment due to differences in reference systems. Fourth, after data reading via the GIS system or data interface, convert the vector polygon data into a memory-processable format. Fifth, after data loading, check the geometric integrity and attribute field structure of the source and target layers. Sixth, verify the polygon closure, absence of self-intersections, and redundant vertices through geometric checks to ensure geometric validity. Seventh, check the consistency of field names, data types, and value ranges through attribute checks to prevent attribute transfer failures due to missing fields or type mismatches. Finally, unify the spatial reference of the two layers to ensure geometric alignment accuracy in the overlay analysis.
[0061] Step 2: Calculate the geometric center point of each polygon and generate a globally unique Hilbert spatial code based on the spatial range. For each polygon in the source and target layers, calculate its geometric center point coordinates using GIS algorithms to ensure that the center point position reflects the spatial centroid of the polygon. Calculate the order k of the Hilbert spatial curve based on the spatial range of the target area and the preset system accuracy threshold to ensure that the code covers the entire area. The spatial range includes width and height, and the preset system accuracy threshold is the default 0.001 map units. Map the geometric center point coordinates of the polygon to the Hilbert spatial curve to generate a 64-bit globally unique code. Utilize the spatial filling characteristics of the Hilbert spatial curve to ensure the uniqueness of the code and determine the lossless conversion from coordinates to Hilbert values. Then, use the generated code as the globally unique identifier of the polygon, i.e., the unique Hilbert spatial code.
[0062] The specific work content is as follows: For each polygon in the source layer and the target layer, the coordinates of its geometric center point are calculated using a GIS algorithm (centroid calculation method) to reflect the spatial centroid of the polygon and avoid center offset due to irregular shape. During the calculation process, the topological validity of the polygon boundary is ensured; otherwise, geometric errors need to be corrected first. Geometric errors are divided into self-intersecting polygons, dangling nodes, and duplicate vertices. Self-intersecting polygons eliminate overlapping areas through Buffer(0) operation. Dangling nodes use the Snap tool to merge adjacent vertices into the specified tolerance range. Duplicate vertices are reconstructed by deduplication and then the polygon boundary is rebuilt. Based on the spatial range (width and height) of the target area and the preset... The system accuracy threshold (default 0.001 map units) is used to calculate the order k of the Hilbert space curve. The order k must meet the minimum condition of covering the entire area to ensure that the generated Hilbert grid resolution is sufficient to distinguish any two points within the area and avoid coding conflicts. The coordinates of the geometric center point of the polygon are mapped to the Hilbert space curve to generate a 64-bit globally unique code. The spatial filling characteristic of the Hilbert space curve ensures that the code values of adjacent coordinates are similar, while ensuring global uniqueness. The conversion from coordinates to code is achieved through a lossless algorithm to avoid accuracy loss. The generated Hilbert space code is then used as the unique identifier of the polygon.
[0063] The formula for calculating the order k of a Hilbert space curve is as follows:
[0064] ;
[0065] In the formula: The order of the Hilbert space curve determines the resolution of the Hilbert grid, which is the number of times the grid is recursively divided. The higher the order, the finer the grid and the stronger the uniqueness of the encoding. For the floor function, ensure the order It is an integer and satisfies the minimum coverage condition; The logarithmic function is base 2. It calculates the number of recursive subdivisions required to divide the target region into a sufficiently fine grid. The logarithmic relationship reflects the exponentially increasing grid resolution. This indicates that the maximum value of the width and height is taken to ensure that the longest side of the area covered by the Hilbert grid is not affected, thus avoiding insufficient resolution due to the shape of the area (such as a long and narrow shape). The width of the target area. The height of the target area; The minimum cell size of the Hilbert grid is defined as a preset system accuracy threshold. The higher the accuracy, the denser the grid and the stronger the uniqueness of the encoding, but the greater the computational cost.
[0066] Step 3: Analyze the vector polygon data of the source layer, associate and store the Hilbert spatial code with the corresponding polygon attributes, construct the source layer code-attribute mapping dictionary, traverse each vector polygon of the source layer, read its attribute fields, and obtain the pre-calculated Hilbert spatial code. Temporarily store the code and attribute in key-value pairs to form a preliminary source layer code-attribute mapping dictionary. Deduplicate and verify the temporarily stored key-value pairs to ensure that each Hilbert spatial code uniquely corresponds to a set of attributes, and use a hash table for storage to support efficient querying. For large-scale data, partition storage according to the range of Hilbert spatial codes to improve parallel access performance. Pre-calculate and cache the spatial proximity relationship of each Hilbert spatial code in the source layer code-attribute mapping dictionary, and record the statistical characteristics of the attribute fields.
[0067] Furthermore, the process of forming a preliminary source layer encoding-attribute mapping dictionary is as follows:
[0068] The process loads each vector polygon data from the source layer into memory, parses its geometric structure and attribute table format, confirms the storage fields of the Hilbert spatial encoding, and then initializes the memory dictionary structure. It defines the Hilbert spatial encoding as the key (a 64-bit unsigned integer) and the value as an expandable attribute dictionary container, ensuring support for dynamic field addition and type compatibility checks. It then iterates through each vector polygon in the source layer, synchronously performing geometric parsing, encoding-attribute association, and exception handling operations. Specifically, geometric parsing extracts polygon boundary coordinates to verify their topological validity, ensuring the reliability of the geometric basis for Hilbert spatial encoding calculations. Encoding-attribute association reads the pre-calculated Hilbert spatial encoding as the key and stores all attributes of the current polygon. The attribute fields (including type validation) are mapped to values and stored in an in-memory dictionary. Records with missing codes or attributes are marked using exception handling, invalid data is skipped, and logs are recorded to avoid interrupting the process. After traversal, the in-memory dictionary is validated, including uniqueness checks and field integrity verification. Uniqueness checks are performed by traversing all key-value pairs, detecting duplicate Hilbert space codes, and merging conflicting records according to business rules (attribute integrity or timestamp). Field integrity verification ensures that each code's corresponding attribute field has no missing or incorrect types, and outliers are filled with default values or marked as pending. The validated key-value pairs are then organized into a hierarchical dictionary, compressing storage space and improving subsequent query efficiency, outputting a preliminary source layer code-attribute mapping dictionary.
[0069] The specific tasks are as follows: When traversing each vector polygon in the source layer, simultaneously read its attribute fields (land use type, area, name, etc.) and pre-calculated Hilbert spatial codes. By parsing the geometric data of the polygons, extract their unique 64-bit Hilbert spatial codes and associate them with the attribute fields in key-value pairs to form a preliminary mapping relationship. Construct a preliminary source layer code-attribute mapping dictionary, temporarily storing it in memory to ensure complete reading of codes and attributes and avoid field loss due to data format errors or geometric anomalies. Perform deduplication and validation on the temporarily stored key-value pairs to ensure that each Hilbert spatial code uniquely maps to a set of attributes. By traversing all key-value pairs, detect duplicate codes and merge their attributes to preserve integrity. For high-level fields, or based on business rules, a coverage strategy is selected. During the verification phase, the legality of the encoding and the rationality of the attribute fields are verified. After deduplication verification, a hash table is used to store the final mapping relationship. For large-scale data, it is further partitioned and stored according to the range of Hilbert spatial encoding, distributing the data to multiple hash sub-tables to improve parallel access performance and reduce the risk of single-table lock contention. In the source layer encoding-attribute mapping dictionary, the spatial proximity relationship of each Hilbert spatial encoding is pre-calculated. By analyzing the spatial filling characteristics of the Hilbert spatial curve, the set of adjacent encodings for each encoding is determined and cached in the extended field of the source layer encoding-attribute mapping dictionary. At the same time, the distribution characteristics of attribute fields are statistically analyzed to generate metadata cache, providing a reference for the fault tolerance mechanism of attribute matching.
[0070] Step 4: Divide the target layer into blocks according to Hilbert spatial encoding and distribute them to different nodes for parallel processing of overlay analysis tasks. Based on the Hilbert spatial encoding range of the target layer, divide it into several continuous and non-overlapping encoding blocks. The blocks are dynamically allocated based on the number of cluster nodes to ensure load balancing. The boundary information (encoding range, geometric range) of each block is broadcast to the corresponding node as the input unit for parallel processing. Each node loads the allocated Hilbert block data, builds a local spatial index to accelerate geometric queries, and performs the spatial relationship judgment between the target layer and the overlay layer in parallel based on the input analysis task. The feature pairs that meet the conditions and their attribute association results are temporarily stored in the node memory buffer. Each node sorts the local analysis results according to Hilbert spatial encoding and sends them back to the master node. The master node merges conflict results across node boundaries through encoding range overlap detection and deduplication according to the business rules of timestamps to generate a globally consistent overlay analysis result set.
[0071] The specific work involves: based on the Hilbert spatial encoding range of the target layer, dividing the encoding space into several continuous, non-overlapping encoding blocks. The number of blocks is dynamically determined based on the number of cluster nodes to ensure a balanced amount of data processed by each node and avoid computational skew. The block boundaries are defined by both the encoding range (starting and ending Hilbert values) and the corresponding geometric range (minimum bounding rectangle, MBR). Block information (including metadata such as encoding intervals, MBR coordinates, and the number of target features) is distributed to each node via a cluster broadcast mechanism as the input unit for parallel tasks. The block strategy must meet two core conditions: first, the continuity of the encoding blocks to ensure spatial locality; and second, dynamic adjustment capability to adapt to changes in node additions, deletions, or data distribution. After each node loads the allocated Hilbert block data, it constructs a local spatial index to accelerate subsequent spatial relationship judgments. Based on the task class, nodes execute the target layer and... Feature matching in overlay layers quickly locates candidate feature pairs using Hilbert spatial encoding, reducing unnecessary calculations. During matching, geometric operations only apply to features adjacent to the encoding, leveraging the locality of the space-fill curve to reduce computational complexity. Intermediate results (such as feature ID pairs and attribute relationships) are temporarily stored in the node's memory buffer and sorted according to Hilbert spatial encoding. Node processing must ensure atomicity, automatically retrying or marking dirty data in case of anomalies to avoid global process interruption. Each node transmits its local results to the master node after sorting them according to Hilbert spatial encoding. The master node detects overlapping or conflicting results across node boundaries using the encoding range. A two-stage strategy is used for merging: first, merging and sorting by encoding range to ensure spatial continuity; then, applying business rules (latest timestamp) to deduplicate conflicting results in overlapping areas to generate a globally consistent result set. The final output is a global result arranged in order according to Hilbert spatial encoding.
[0072] Step 5: Match source attributes using Hilbert spatial encoding. Each node independently searches for the same Hilbert spatial encoding; if it exists, the attribute is copied directly.
[0073] Step 6: When Hilbert spatial encoding is not available, automatically switch to K-nearest neighbor search (K=3) and fuse attribute values by weighting Hilbert distance;
[0074] Step 7: Summarize the vector polygon data that have completed attribute matching, output the final overlay analysis results, and store them.
[0075] Example 2, as Figure 1 , Figure 2 As shown, based on Embodiment 1, the present invention provides a technical solution: Preferably, step 5 specifically includes:
[0076] Each node loads Hilbert block data based on the dynamically divided Hilbert spatial coding range, constructs a mapping table from coding to features (key is Hilbert spatial code, value is feature attribute set), ensuring coding continuity. Within a node, feature attributes with the same coding are aggregated to form a local coding-attribute dictionary. Nodes independently perform matching based on the source layer coding-attribute mapping dictionary, traversing the Hilbert spatial codes of the target feature. If the same coding exists in the source layer coding-attribute mapping dictionary, the source feature attribute is directly copied to the target feature; otherwise, it is skipped. The master node collects the local coding-attribute dictionaries output by each node, detects duplicate coding across node boundaries according to the Hilbert spatial coding range, performs deduplication on the attribute results of duplicate coding, merges them into a globally consistent attribute mapping table, and outputs a complete result set sorted by coding, ensuring no conflicts and spatial order.
[0077] The specific tasks are as follows: Each node loads corresponding block data based on the dynamically divided Hilbert spatial coding range. During data loading, the node filters target features according to the continuity boundaries of the coding range (start and end codes), ensuring that the coding intervals processed by each node do not overlap and cover the global range. After loading, the node constructs a mapping table from code to feature, using Hilbert spatial codes as keys and feature attribute sets as values, forming a local code-attribute dictionary. The node aggregates feature attributes with the same code, merges duplicate attributes to handle multi-value conflicts, and generates a unique code-attribute mapping relationship, ensuring the consistency and continuity of local data. Based on the constructed source layer code-attribute mapping dictionary, the node independently performs matching operations between target features and source features. The matching process uses the Hilbert spatial code of the target feature as an index to quickly retrieve the mapping dictionary: if the dictionary contains the same... Encoding directly copies the attributes of the source element to the target element, completing attribute transfer. If the encoding does not exist, the target element is skipped without attribute modification. The master node collects the local encoding-attribute dictionary output by each node and performs global merging according to the Hilbert spatial encoding range. During the merging process, the master node detects duplicate encodings across node boundaries (i.e., the same encoding is processed by multiple nodes). For attribute results of duplicate encodings, it applies time-stamp-based business rules to remove duplicates: retaining the attribute value with the latest timestamp and discarding old data. If the timestamps are the same, further adjudication is made according to predefined rules (random selection). After merging, the master node generates a globally consistent encoding-attribute mapping table and arranges the result set in ascending order of Hilbert spatial encoding to ensure the spatial order of the output data. The final result set has no encoding conflicts and is spatially continuous, which can be directly used for spatial analysis, meeting the consistency and integrity requirements under distributed processing.
[0078] Step 6 specifically includes:
[0079] Each node loads block data based on the dynamically divided Hilbert spatial coding range and constructs a local coding-attribute mapping table. If the Hilbert spatial code of the target feature is missing in the local coding-attribute mapping table, the code is marked as unmatched, and a K-nearest neighbor search (K=3) is triggered as a fallback mechanism to ensure the continuity of attribute transmission. For unmatched target features, the three nearest coded features are searched in the global space with the target code as the center. The weights are calculated based on the Hilbert distance between the target code and the neighboring codes, with higher weights for closer distances. The attribute values of the K-nearest neighbor features are aggregated according to the weights (weighted average for numerical attributes and voting selection for categorical attributes) to generate supplementary attributes for the target feature. After the master node collects the results from each node, duplicate codes are merged. Directly matched attributes are retained, and K-nearest neighbor results are used as alternatives. Finally, a globally consistent and spatially continuous coding-attribute mapping table is generated.
[0080] The specific tasks are as follows: Each node loads target feature data according to the dynamically divided Hilbert spatial coding range, ensuring that the coding intervals processed by each node are continuous and non-overlapping. After loading, the node constructs a local coding-attribute mapping table, using the Hilbert spatial code as the key and the feature attribute as the value. At the same time, multi-valued attributes with the same code are aggregated to ensure local data consistency. If the Hilbert spatial code of the target feature is missing in the mapping table, it is marked as unmatched, triggering the subsequent K-nearest neighbor search mechanism. For unmatched target features, the three nearest coded features are searched globally as candidates, centered on the target feature's Hilbert spatial code. Weights are determined by calculating the Hilbert distance between the target code and neighboring codes, with closer distances resulting in higher weights. Numerical attributes are weighted and averaged, while categorical attributes are selected through a voting mechanism to generate supplementary attributes for the target element. After the master node collects the local results from each node, it merges directly matched code-attribute pairs to ensure the integrity of high-priority data. For duplicate codes, direct matching results are retained first, with K-nearest neighbor supplementary results as alternatives. During the conflict resolution phase, timestamp-based adjudication is used to finally generate a globally consistent code-attribute mapping table. The output results are arranged in ascending order of Hilbert spatial codes to ensure spatial continuity and meet the dual requirements of data consistency and analytical accuracy in a distributed environment.
[0081] Step 7, the process of outputting and storing the final overlay analysis results, is as follows:
[0082] The master node collects the local code-attribute mapping tables of each node, prioritizes merging direct matching results to ensure the integrity of high-priority data, supplements the K-nearest neighbor results for duplicate codes, adjudicates conflicts by timestamp, retains the latest attribute values, and generates a conflict-free globally consistent mapping table. Based on the globally consistent mapping table, it fills each vector polygon with the corresponding attributes of the matching Hilbert spatial code. Unmatched features retain their original geometric information and are marked with missing attributes. Then, the vector polygons are arranged in ascending order of codes to ensure spatial continuity, generating a dataset to be analyzed with complete attributes. Spatial overlay operation is performed on the attribute-filled vector polygon data to generate an analysis result layer. The results are sorted by Hilbert spatial code and stored in a distributed file system.
[0083] The specific tasks are as follows: The master node collects the local code-attribute mapping tables submitted by each node, prioritizes merging direct matching results (i.e., attributes precisely associated through Hilbert spatial coding) to ensure the integrity of high-priority data, and for duplicate K-nearest neighbor supplementary results (i.e., attributes inferred through spatial approximation matching), the master node makes conflict resolution based on timestamps: if multiple K-nearest neighbor supplementary attributes exist for the same code, the latest timestamp value is retained, older versions are discarded, and a conflict-free globally consistent mapping table is generated, where each Hilbert spatial code uniquely corresponds to a set of attribute values, and direct matching results take precedence over supplementary results; based on the globally consistent mapping table, attribute filling is performed on the input vector polygon data: if the Hilbert spatial code of the polygon exists in the mapping table, the corresponding attribute is directly associated; if the code does not match, the original geometric information is retained and marked. After recording the missing attribute states and completing the filling process, all polygons are arranged in ascending order according to their Hilbert spatial codes. Utilizing the spatial filling characteristics of Hilbert spatial curves, it is ensured that polygons corresponding to adjacent codes are also geographically adjacent, thus maintaining the spatial continuity of the data. This generates a dataset with complete attributes to be analyzed, containing both directly matched high-precision attributes and clearly identifying missing value areas that require further processing. Spatial overlay operations are performed on the attribute-filled vector polygon data. Through geometric intersection, union, or difference calculations, a new layer containing multi-level spatial relationships is generated. During the overlay process, the Hilbert spatial coding sorting rules of the input data are automatically inherited, ensuring that polygons in the result layer are still arranged in ascending order according to their codes, further enhancing spatial continuity. The final analysis result layer contains the fused attribute information and geometric features, and is stored in distributed file systems in blocks according to their codes.
[0084] Example 3, as Figure 1As shown, based on Examples 1-2, this invention also provides an attribute matching system for parallel map overlay analysis based on Hilbert spatial coding, used to implement the aforementioned attribute matching method for parallel map overlay analysis based on Hilbert spatial coding, including:
[0085] The data loading and verification module is used to load vector polygon data from the source and target layers, verify geometric integrity and attribute field structure, ensure data compatibility, avoid interruptions in subsequent analysis due to data errors, and improve system stability.
[0086] The Hilbert encoding generation module is used to calculate the geometric center point of polygons, generate globally unique Hilbert spatial codes, establish a source layer encoding-attribute mapping dictionary, solve the problem of attribute matching uniqueness under massive data, and support parallel computing.
[0087] The parallel task allocation and processing module is used to divide the target layer into blocks according to Hilbert spatial encoding, allocate them to different nodes for parallel processing and overlay analysis tasks, accelerate distributed computing, and reduce cross-node topology judgment overhead.
[0088] The attribute matching and fusion module is used to match source attributes through Hilbert spatial encoding. If no match is found, it switches to K-nearest neighbor search and weights and fuses attribute values, thereby outputting and storing the final superposition analysis results. This solves the floating-point error problem of boundary polygons and improves the accuracy of attribute matching.
[0089] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for attribute matching in parallel overlay analysis of maps based on Hilbert space encoding, characterized by, The method comprises the following steps: Step 1, determining a target area, reading and loading vector polygon data of a source layer and a target layer to be superimposed and analyzed; Step 2, calculating the geometric center point of each polygon, and generating a globally unique Hilbert space code according to the spatial range; Step 3, analyzing the vector polygon data of the source layer, storing the Hilbert space code and the corresponding polygon attribute in association, and constructing a source layer code-attribute mapping dictionary; Step 4, dividing the target layer according to the Hilbert space code, and distributing it to different nodes for parallel processing of superposition analysis tasks; Step 5, matching the source attribute through the Hilbert space code, each node independently searching for the same Hilbert space code, and directly copying the attribute if it exists; Step 6, when the Hilbert space code does not exist, automatically switching to K-nearest neighbor search, and fusing the attribute value according to the Hilbert distance weighting; Step 7, collecting the vector polygon data with completed attribute matching, outputting the final superposition analysis result and storing it; In step 2, the process of generating a globally unique Hilbert space code according to the spatial range is as follows: For each polygon in the source layer and the target layer, calculate its geometric center point coordinate through a GIS algorithm; According to the spatial range of the target area and the preset system accuracy threshold, calculate the order k of the Hilbert space curve, wherein the spatial range includes width and height, and the preset system accuracy threshold is the default 0.001 map unit; Map the geometric center point coordinate of the polygon to the Hilbert space curve to generate a 64-bit globally unique code, which is used as the globally unique identifier of the polygon, i.e., the unique Hilbert space code; Step 4 specifically includes: According to the Hilbert space code range of the target layer, divide it into several continuous and non-overlapping code blocks, dynamically allocate the blocks based on the number of cluster nodes, and broadcast the boundary information of each block to the corresponding node as the input unit for parallel processing; Each node loads the Hilbert block data allocated to it, constructs a local spatial index, and parallelly executes the spatial relationship judgment of the target layer and the superposition layer based on the input analysis task, and temporarily stores the element pair and its attribute association result that meets the condition in the node memory buffer; Each node sorts the local analysis result according to the Hilbert space code and returns it to the master node, and the master node merges the conflict results across the node boundary through code range overlap detection, and removes the duplicate results according to the time stamp business rule to generate a globally consistent superposition analysis result set.
2. The attribute matching method in map parallel overlay analysis based on Hilbert space coding according to claim 1, characterized in that: Step 1 specifically includes: Determine the spatial range of the target area, and load the vector polygon data of the source layer and the target layer through the GIS system or data interface; The geometric integrity and attribute field structure of the vector polygon data of the source layer and the target layer are checked to make the data format compatible and the spatial reference consistent, wherein the geometric checking includes verifying whether the polygon is closed, self-intersected or redundant vertex; the attribute checking includes checking whether the field name, data type and value range are consistent, and unifying the spatial reference of the source layer and the target layer.
3. The attribute matching method in Hilbert space encoding based map parallel overlay analysis according to claim 1, characterized in that: In the step 3, the process of constructing the source layer encoding-attribute mapping dictionary is as follows: Traverse each vector polygon of the source layer, read its attribute field, and obtain the pre-calculated Hilbert space encoding, temporarily store the encoding and the attribute in the form of key-value pair, and form a preliminary source layer encoding-attribute mapping dictionary; De-duplicate and check the temporarily stored key-value pair to ensure that each Hilbert space encoding corresponds to a group of attributes, and store them in a hash table; Pre-calculate and cache the spatial proximity relationship of each Hilbert space encoding in the source layer encoding-attribute mapping dictionary, and record the statistical characteristics of the attribute field.
4. The attribute matching method in map parallel overlay analysis based on Hilbert space coding according to claim 3, characterized in that: The process of forming the preliminary source layer encoding-attribute mapping dictionary is as follows: Load each vector polygon data of the source layer into the memory, parse its geometric structure and attribute table format, confirm the storage field of the Hilbert space encoding, and then initialize the memory dictionary structure, define the key as the Hilbert space encoding of 64-bit unsigned integer type, and the value as the extensible attribute dictionary container; Traverse each vector polygon of the source layer, and synchronously perform the operations of geometric parsing, encoding-attribute association and exception handling; After the traversal is completed, check the memory dictionary, including uniqueness checking and field integrity verification, and then organize the key-value pairs that pass the verification into a hierarchical dictionary, and output the preliminary source layer encoding-attribute mapping dictionary.
5. The attribute matching method in Hilbert space encoding based map parallel overlay analysis according to claim 1, characterized in that: The step 5 specifically includes: Each node loads the Hilbert block data according to the dynamically divided Hilbert space encoding range, constructs the encoding-to-feature mapping table, aggregates the feature attributes of the same encoding within the node, and forms a local encoding-attribute dictionary; The node independently performs matching based on the source layer encoding-attribute mapping dictionary, traverses the Hilbert space encoding of the target feature, and if the same encoding exists in the source layer encoding-attribute mapping dictionary, directly copies the source feature attribute to the target feature, and if not, skips it; The master node collects the local encoding-attribute dictionaries output by each node, detects the repeated encodings across the node boundaries according to the Hilbert space encoding range, de-duplicates the attribute results of the repeated encodings, and merges them into a globally consistent attribute mapping table, and outputs the complete result set sorted by encoding.
6. The attribute matching method in map parallel overlay analysis based on Hilbert space coding according to claim 5, characterized in that: The step 6 specifically includes: Each node loads the block data based on the dynamically divided Hilbert space encoding range, constructs a local encoding-attribute mapping table, and if the Hilbert space encoding of the target feature is missing in the local encoding-attribute mapping table, marks the encoding as unmatched, and triggers K-nearest neighbor search as a fallback mechanism; For unmatched target elements, search the nearest 3 encoded elements in the global space, and calculate the weight according to the Hilbert distance between the target code and the adjacent code; Aggregate the attribute values of the K nearest neighbor elements according to the weight to generate the supplementary attributes of the target element. The master node collects the results of each node and merges the repeated codes. Among them, the directly matched attributes are retained, and the K nearest neighbor results are used as alternatives. Finally, a globally consistent and spatially continuous code-attribute mapping table is generated.
7. The attribute matching method in Hilbert space encoding based map parallel overlay analysis according to claim 6, characterized in that: In step 7, the process of outputting the final overlay analysis result and storage is: The master node collects the local code-attribute mapping table of each node, preferentially merges the direct matching results, and for the K nearest neighbor supplementary results of repeated codes, resolves conflicts according to the time stamp, retains the latest attribute value, and generates a globally consistent mapping table without conflicts; According to the globally consistent mapping table, fill in the matching Hilbert space code corresponding attributes for each vector polygon, retain the original geometric information for the unmatched elements and mark the missing attributes, and then arrange the vector polygons in ascending order of the code to generate an attribute complete dataset to be analyzed; Perform spatial overlay operation on the vector polygon data after attribute filling to generate an analysis result layer, and store the result in the distributed file system after sorting according to the Hilbert space code.
8. A system for attribute matching in parallel map overlay analysis based on Hilbert space encoding, for implementing the method for attribute matching in parallel map overlay analysis based on Hilbert space encoding according to any one of claims 1 to 7, characterized in that, It includes: Data loading verification module, used for loading source layer and target layer vector polygon data, verifying geometric integrity and attribute field structure; Hilbert code generation module, used for calculating the geometric center point of the polygon, generating a globally unique Hilbert space code, and establishing a source layer code-attribute mapping dictionary; Parallel task allocation processing module, used for dividing the target layer by Hilbert space code, and allocating to different nodes for parallel processing of overlay analysis tasks; Attribute matching fusion module, used for matching source attributes through Hilbert space code, switching K nearest neighbor search when not matched, and weighted fusion of attribute values, and then outputting the final overlay analysis result and storage.