Attribute matching based cross-tile vector feature merging method, device and equipment
Patent Information
- Application Number
- CN202611119831.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-10-30
AI Technical Summary
[0006]有鉴于此,本申请提供了一种基于属性匹配的跨瓦片矢量要素合并方法、装置及设备,主要目的在于解决矢量瓦片渲染中因瓦片切分导致的地理要素碎片化问题,实现在用户点击拾取时自动识别、归并、合并跨瓦片分散的要素碎片并返回完整几何体技术问题
[0011]借由上述技术方案,本申请提供的一种基于属性匹配的跨瓦片矢量要素合并方法、装置及设备,与目前现有技术相比,本申请可通过接收用户在三维地图上的点击拾取操作,通过Web Worker线程中构建的RTree空间索引对当前瓦片内的矢量要素进行空间查询,将命中拾取点所在的矢量要素确定为命中要素,并检测命中要素是否包含预设语义标识属性;当检测到命中要素包含预设语义标识属性时,计算当前瓦片在瓦片金字塔中的邻域范围,通过Worker并发任务池并发获取所有相邻瓦片中已缓存的矢量要素;将当前瓦片与相邻瓦片的矢量要素统一转换为WGS84地理坐标系,按预设语义标识属性的属性值进行分组过滤,保留属性值与命中要素的属性值相匹配的要素,对同一属性值的多个要素碎片执行第一次空间Union合并,再将合并结果与命中要素执行第二次带拓扑修复的渐进式Union合并,得到完整要素几何体;将完整要素几何体封装为影像要素信息对象,高亮绘制到三维球体上进行展示。
Smart Images

Figure CN123015867A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of geographic information systems and 3D visualization technology, specifically to a method, apparatus, and device for merging cross-tile vector features based on attribute matching. Background Technology
[0002] With the development of Geographic Information System (GIS) technology, vector tile technology, especially the Mapbox Vector Tile (MVT / PBF) format, as one of the standard specifications adopted by the Open Geospatial Consortium (OGC), has been widely used in the GIS industry due to its advantages such as small data size, support for dynamic client-side style customization, and high-resolution adaptation. Unlike traditional raster tiles, MVT directly transmits vector geometric coordinates and attribute data, greatly improving the transmission efficiency and rendering flexibility of map data.
[0003] However, while retaining the efficient loading characteristics of the tile pyramid model, the MVT format also inherits the inherent technical defects brought about by tile cutting: logically complete vector features in geospatial space (such as cross-regional administrative divisions, continuous water systems, or long-distance road lines) are physically cut into multiple geometric fragments during tile generation and stored separately in different PBF files. This problem is particularly prominent in 3D sphere rendering scenarios such as Cesium, mainly manifested in the following three aspects: First, incomplete interactive picking; the single-tile picking mechanism based on RTree spatial indexing can only hit geometric fragments within the current viewport, resulting in the inability to obtain the complete feature shape when the user clicks; second, incomplete highlighting; the outline drawing after the feature is selected only covers the fragment area and cannot display its true complete boundary; finally, errors exist in attribute querying; because attribute information is attached to fragments rather than complete features, the accuracy of data display and statistics is impaired.
[0004] To address the aforementioned problem of cross-tile feature fragmentation, existing technologies primarily offer two solutions, both with significant limitations. One is a spatial proximity-based merging method, which automatically identifies and merges fragments by calculating the buffer overlap or boundary distance of geometry in adjacent tiles. However, this method has a computational complexity of O(n²), and its reliance on spatial location makes it prone to mistakenly merging adjacent but unrelated features at tile boundaries. Furthermore, cross-tile geometric fragments often exhibit topological defects such as tiny gaps, boundary misalignments, or self-intersecting loops at their joints, making direct union operations highly susceptible to failure. The other approach is a full-tile loading merging scheme, where all relevant tiles are loaded on the client side before merging. However, this ignores the full performance advantages of tile layering, resulting in significant data redundancy. Memory consumption and bandwidth overhead increase exponentially at higher levels (e.g., z=18), making it unacceptable in practical applications.
[0005] Therefore, there is an urgent need for a technical solution that can overcome the above-mentioned defects and accurately realize the automatic identification and geometric reconstruction of cross-tile vector features without increasing additional computational burden and bandwidth pressure. Summary of the Invention
[0006] In view of this, this application provides a method, apparatus and device for merging cross-tile vector features based on attribute matching. The main purpose is to solve the problem of geographic feature fragmentation caused by tile splitting in vector tile rendering, and to realize the technical problem of automatically identifying, merging and combining scattered feature fragments across tiles and returning complete geometry when the user clicks to pick.
[0007] Firstly, this application provides a method for merging cross-tile vector features based on attribute matching, including: The system receives user clicks and picks on a 3D map, performs spatial queries on vector features within the current tile using the RTree spatial index built in the Web Worker thread, identifies the vector features where the pick point is located as the hit features, and checks whether the hit features contain preset semantic identifier attributes. When the hit feature is detected to contain the preset semantic identifier attribute, the neighborhood range of the current tile in the tile pyramid is calculated, and the cached vector features in all adjacent tiles are obtained concurrently through the Worker concurrent task pool. The vector features of the current tile and the adjacent tiles are uniformly converted to the WGS84 geographic coordinate system. They are then grouped and filtered according to the attribute values of the preset semantic identifier attributes. Features whose attribute values match the attribute values of the hit features are retained. A first spatial union is performed on multiple feature fragments with the same attribute value. The merged result is then combined with the hit features to perform a second progressive union with topology repair, resulting in a complete feature geometry. The complete geometric element is encapsulated as an image element information object and highlighted on a 3D sphere for display.
[0008] Secondly, this application provides a cross-tile vector feature merging device based on attribute matching, comprising: The receiving module is used to receive the user's click and pick operation on the 3D map, perform spatial query on the vector features in the current tile through the RTree spatial index built in the Web Worker thread, determine the vector feature where the pick point is located as the hit feature, and detect whether the hit feature contains a preset semantic identifier attribute. The calculation module is used to calculate the neighborhood range of the current tile in the tile pyramid when the hit feature is detected to contain the preset semantic identifier attribute, and to concurrently obtain the cached vector features in all adjacent tiles through the Worker concurrent task pool. The merging module is used to convert the vector features of the current tile and the adjacent tiles into the WGS84 geographic coordinate system, group and filter them according to the attribute values of the preset semantic identifier attributes, retain the features whose attribute values match the attribute values of the hit features, perform a first spatial union merge on multiple feature fragments with the same attribute value, and then perform a second progressive union merge with the hit features with the merged result to obtain the complete feature geometry; The encapsulation module is used to encapsulate the complete feature geometry into an image feature information object, which is then highlighted and drawn onto a three-dimensional sphere for display.
[0009] Thirdly, this application provides an electronic device including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the computer program to implement the attribute matching-based cross-tile vector feature merging method described in the first aspect.
[0010] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the attribute-matching-based cross-tile vector feature merging method described in the first aspect.
[0011] By utilizing the above technical solutions, this application provides a method, apparatus, and device for merging cross-tile vector features based on attribute matching. Compared with existing technologies, this application can receive user clicks and picks on a 3D map and then connect via Web. The RTree spatial index built in the Worker thread performs spatial queries on the vector features within the current tile, identifies the vector features where the pick point is located as the hit features, and checks whether the hit features contain preset semantic identifier attributes. When the hit features contain preset semantic identifier attributes, the neighborhood range of the current tile in the tile pyramid is calculated, and all cached vector features in adjacent tiles are retrieved concurrently through the Worker concurrent task pool. The vector features of the current tile and adjacent tiles are uniformly converted to the WGS84 geographic coordinate system, and grouped and filtered according to the attribute values of the preset semantic identifier attributes. Features whose attribute values match the attribute values of the hit features are retained. Multiple feature fragments with the same attribute value are merged into a first spatial union, and then the merged result is merged with the hit features into a second progressive union with topology repair to obtain the complete feature geometry. The complete feature geometry is encapsulated into an image feature information object and highlighted and drawn on a 3D sphere for display.
[0012] By adopting the above technical solution, this application constructs an RTree spatial index through Web Worker threads, enabling rapid spatial querying of massive vector features. It can efficiently and accurately locate vector features at the user's click position, solving the problem of low efficiency in traditional traversal queries. Simultaneously, by detecting preset semantic identifier attributes, it can quickly identify which features may be "fragmented" features that are split across tiles, thereby triggering the subsequent merging process without invalidating ordinary independent features, providing an accurate triggering mechanism for solving the fragmentation problem.
[0013] This application, by calculating the neighborhood range and combining it with a Worker concurrent task pool, can quickly locate and retrieve all fragment data of cross-tile features scattered across different adjacent tiles. Its beneficial effect lies in breaking down data isolation within a single tile, significantly reducing the time latency for acquiring cross-tile data through concurrent reading technology, and ensuring that all fragments of the same feature distributed across multiple tiles can be completely collected.
[0014] This application achieves error-free association and aggregation of cross-tile fragments through a unified coordinate system and semantic attribute-based grouping filtering. Its advantages lie in the fact that, compared to relying on unreliable spatial proximity judgments, using business semantic attributes (such as administrative division codes) as unique identifiers can accurately identify all fragments belonging to the same geographic object with zero risk of error merging. The unified coordinate system eliminates accuracy errors caused by the transformation between different tile coordinate systems, ensuring data consistency in subsequent merging operations.
[0015] This application effectively solves the geometric topological errors (such as self-intersection, collinear edges, and tiny gaps) caused by tile segmentation by combining a "first spatial union merging" with a "second progressive union merging with topology repair." The first merging quickly processes fragmentation between neighboring tiles, while the second merging enhances the algorithm's robustness through progressive topology repair. It can safely and stably repair geometric imperfections caused by tile boundary segmentation, thereby generating high-quality, seamless, and complete feature geometry, completely solving the problem of fragmented display of geographic features.
[0016] This application visualizes the merged complete geometry. When a user clicks on any fragment on the map, the system can automatically return and highlight the complete shape of the element spanning multiple tiles, intuitively restoring the original appearance of the geographical element and greatly improving the visual coherence of 3D map rendering and user interaction experience.
[0017] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a method for merging cross-tile vector features based on attribute matching, provided in an embodiment of this application; Figure 2 This application provides a method for highlighting multiple polygons with the same code in a selected image. Figure 3 This application provides a highlighted rendering image of multiple blocks with the same code line selected in an embodiment; Figure 4-a A 3×3 neighborhood tile network diagram is provided for embodiments of this application; Figure 4-b A schematic diagram of cross-tile element distribution provided in an embodiment of this application; Figure 4-c A flowchart of a Worker concurrent neighborhood detection provided in an embodiment of this application; Figure 5-a Background diagram of a topology repair problem provided for embodiments of this application; Figure 5-b A five-step preprocessing pipeline diagram for attemptUnion provided in this application embodiment; Figure 5-c A robustUnionWithTopologyFix exponential backoff retry loop diagram is provided for embodiments of this application; Figure 5-d An exponential backoff parameter table provided for embodiments of this application; Figure 6 This is a schematic diagram of a cross-tile vector feature merging device based on attribute matching, provided in an embodiment of this application. Detailed Implementation
[0021] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0022] The following description, with reference to the accompanying drawings, describes a method, apparatus, and device for merging cross-tile vector features based on attribute matching, according to embodiments of this application.
[0023] This application provides a method, apparatus, and device for cross-tile vector feature merging based on attribute matching. The main purpose is to solve the technical problem that most existing technologies treat gas plumes as general visual targets, ignore the physical coupling relationship between the location of the leakage source and the plume diffusion process, and lack explicit constraints on the consistency of the source area and the spatial distribution structure of the plume, resulting in unsatisfactory detection results in complex scenes such as low contrast and blurred boundaries.
[0024] like Figure 1 As shown, embodiments of this application provide a method for merging cross-tile vector features based on attribute matching. This method is deployed in the vector tile image provider layer of the Cesium 3D rendering engine. The overall architecture adopts a collaborative mode between the main thread and Web Worker threads. The main thread is responsible for business logic orchestration, merging algorithm execution, and rendering display, while the Worker threads are responsible for heavy spatial queries, data parsing, and cache reading. Through this architecture, this application can effectively solve the problem of geographic feature fragmentation caused by tile segmentation in vector tile rendering. When the user clicks to pick, it automatically identifies, merges, and combines scattered feature fragments across tiles, and returns a complete geometry, specifically including: Step 101: Receive the user's click and pick operation on the 3D map, perform spatial query on the vector features in the current tile through the RTree spatial index built in the Web Worker thread, determine the vector feature where the pick point is located as the hit feature, and check whether the hit feature contains the preset semantic identifier attribute.
[0025] Specifically, when a user clicks on the Cesium 3D sphere, the Cesium engine automatically calls the `pickFeatures(x, y, level, longitude, latitude)` method of `ImageryProvider` to receive the screen pixel coordinates and the corresponding geographic coordinates, i.e., it receives the user's click operation on the 3D map. After receiving this click operation, the main thread first maps the WGS84 latitude and longitude coordinates to the tile coordinate system under the Web Mercator projection. Then, the picking task is dispatched to the worker thread through `WorkerFarm.scheduleTask` (i.e., the WorkerFarm scheduling mechanism).
[0026] In this step, the vector features within the current tile are spatially queried using the RTree spatial index built in the Web Worker thread. The vector features where the pick point is located are identified as the hit features. Specifically, this includes: In the Worker thread, all cached vector polygon features (from _cacheFillData[key]) and vector line features (from _cacheLineData[key]) within the current tile are traversed. For each feature, its geographic bounding box is calculated and inserted into the RTree index. The RTree index is dynamically built in the Worker thread, eliminating the need to maintain additional data structures in the main thread.
[0027] Coarse screening is performed using the RTree index. That is, using the constructed RTree index, the worker thread performs spatial queries on the pick points to obtain candidate features, and then performs precise matching.
[0028] For vector polygon features, an algorithm for determining whether a point is in the polygon (such as turf.booleanPointInPolygon) is used to determine whether the clicked point is in the polygon. For vector line features, the flatten-js library can be used to calculate the minimum distance from the click point to each segment of the polyline. When the minimum distance is less than a preset threshold (e.g., 100 meters), it is determined to be a hit, and the vector feature where the hit pick point is located is identified as the hit feature.
[0029] Furthermore, after the Worker thread completes the query, the hit features are converted from MVT relative coordinates (0~4095 integer coordinate system) to WGS84 latitude and longitude through Web Mercator inverse projection, and the hit features are returned to the main thread. After receiving the picking result returned by the Worker thread, the main thread checks whether the hit feature carries a preset semantic identifier attribute (this attribute is used for cross-tile association, such as the "code" attribute).
[0030] If the hit feature does not contain a `code` attribute, it is considered a regular independent feature and is treated as such. There is no need for cross-tile merging; instead, an `ImageryLayerFeatureInfo` object is created and highlighted. Figure 2 and Figure 3 As shown; if it contains the code attribute, it is determined to be a fragment that can be merged across tiles, and then proceed to step 102.
[0031] Step 102: When a hit feature is detected to contain a preset semantic identifier attribute, calculate the neighborhood range of the current tile in the tile pyramid, and concurrently obtain the cached vector features in all adjacent tiles through the Worker concurrent task pool.
[0032] In this embodiment of the application, when a hit feature is detected to contain the preset semantic identifier attribute, firstly, the neighborhood range of the current tile in the tile pyramid is calculated. Specifically, this includes: using the tile coordinates where the hit feature is located... For the central tile, iterate through the tile pyramid and calculate the offsets of the tile coordinates in both the row and column directions. Generate a 3×3 set of tile coordinates; remove the center tile itself (i.e., ...) from this set of tile coordinates. and This strategy determines the neighborhood range containing the coordinates of the remaining 8 adjacent tiles, based on the condition that a feature spans at most 2 tile boundaries. This 3×3 neighborhood strategy ensures that all associated fragments are covered when a feature crosses at most 2 tile boundaries.
[0033] After determining the neighborhood range, the cached vector features in all adjacent tiles can be retrieved concurrently through a Worker concurrent task pool. Specifically, this can be implemented by using the `Promise.all` method to concurrently dispatch data retrieval tasks for eight adjacent tiles. Each task, through the WorkerFarm scheduling mechanism, concurrently dispatches a message task of type `pickGetLineOrFillData` to a Worker thread. The Worker thread responds to this message task by directly reading the fill polygon data and polyline data of adjacent tiles from its internal cache variables (such as `_cacheFillData` and `_cacheLineData`) and returning them, without performing a secondary spatial lookup. Since the eight tasks are executed concurrently, the total execution time is approximately equal to the time of a single task, effectively reducing latency and significantly improving response speed. Figure 4-a , Figure 4-b , Figure 4-c As shown, the main thread uses the `Promise.all` method to wait in parallel for all adjacent tiles to complete their data reading tasks, thereby obtaining the cached vector features from all adjacent tiles.
[0034] Step 103: Convert the vector features of the current tile and its adjacent tiles into the WGS84 geographic coordinate system. Group and filter them according to the attribute values of the preset semantic identifier attributes. Retain the features whose attribute values match the attribute values of the hit features. Perform the first spatial union merge on multiple feature fragments with the same attribute value. Then perform the second progressive union merge with the hit features using the merged result and topology repair to obtain the complete feature geometry.
[0035] First, coordinate system one is performed. All vector feature data collected from the center tile and adjacent tiles are uniformly converted from the MVT relative coordinate system (0~4095 integer coordinate system) to the WGS84 geographic coordinate system. The specific conversion can use the WebMercator inverse projection formula, as shown below:
[0036]
[0037]
[0038] In the formula, This represents the relative x-coordinate of the vector feature within the tile. This represents the relative vertical coordinate of the vector feature within the tile. For tile column numbering, For tile row numbers, As an intermediate variable, For tile layers.
[0039] After coordinate transformation, the data is grouped and filtered according to the attribute values of the preset semantic identifiers. All features are traversed, and only features whose attribute values match the attribute values (such as code values) of the picked features are retained, while irrelevant data is filtered out.
[0040] Subsequently, a first spatial union is performed on multiple feature fragments with the same attribute value. Specifically, the filtered features are grouped according to their `code` attribute value. If each group contains more than one feature, the `union` method provided by the geospatial analysis library Turf.js is used, passing multiple GeoJSON Feature objects with the same attribute value as flattening parameters for merging. During the merging process, if the geometry type of the merged result is detected to be of type `GeometryCollection` (e.g., a mixture of polygons and lines), `LineString` type geometries are automatically filtered out, and the `Union` operation is re-executed on the remaining geometries, thus obtaining the merged result of the first spatial union. If there is only one feature fragment with the same attribute value, the feature is directly retained without performing a merge.
[0041] Because tile boundary splitting can lead to topological errors (such as self-intersections, collinear edges, and small gaps), the result of the first merge may still have topological inconsistencies with the picked features of the center tile. Therefore, a second progressive union merge with topology repair is needed to combine the merged result with the picked features to obtain the complete feature geometry. This step specifically includes: The merged results and hit features undergo a process of removing duplicate and invalid coordinates (such as NaN and infinity) using `turf.cleanCoords`. Next, the Douglas-Peucker algorithm is used to simplify the geometry of the merged results and hit features after the removal operation (`turf.simplify, highQuality=true`) to eliminate minor jagged edges and floating-point errors caused by excessive vertex density. Then, a small-distance buffer expansion operation (`turf.buffer`) is performed on the simplified merged results and hit features to repair topological defects such as self-intersections, collinear edges, and minor gaps. New duplicate points introduced by the buffer expansion operation are cleaned again (`turf.cleanCoords`). Finally, a spatial union operation (`turf.union`) is performed on the preprocessed merged results and hit features. Figure 5-a , Figure 5-b , Figure 5-c , Figure 5-d The progressive topology repair Union pretreatment pipeline is shown.
[0042] If the above merge operation fails, an exponential backoff strategy is used to repeat the above steps. During each retry, the buffer distance and simplification tolerance parameters are gradually increased (e.g., the buffer parameter is multiplied by 5, and the tolerance parameter by 2) until the merge succeeds or the maximum number of retries (e.g., 5 times) is reached. A safety limit is set during the retry process (e.g., a maximum buffer of 0.1 degrees and a maximum tolerance of 0.01 degrees) to prevent excessive deformation of the geometry. If the merge still fails after reaching the maximum number of retries, the merge is abandoned, and the result of the first spatial union merge is output as the complete feature geometry (i.e., downgraded processing); if the merge succeeds, the merged complete polygon geometry is used as the final output complete feature geometry.
[0043] By employing the aforementioned five-step preprocessing pipeline and exponential backoff retry mechanism, topological errors such as self-intersection, collinear edges, minute gaps, and duplicate coordinates caused by tile splitting are effectively resolved, ensuring the robustness of cross-tile feature merging.
[0044] Step 104: Encapsulate the complete feature geometry into an image feature information object and highlight it on a 3D sphere for display.
[0045] The complete feature geometry obtained in step 103 is encapsulated into a Cesium standard ImageryLayerFeatureInfo object, its attribute names and descriptions are configured, and the addPolygon or addPolyline method is called to highlight the complete feature on the surface of the Cesium 3D sphere, thereby displaying the complete geographic feature to the user.
[0046] Building upon Embodiment 1 above, this embodiment also includes a continuous tile update mechanism (updateTile). This mechanism ensures that when the user pans or zooms the map, the currently highlighted cross-tile features automatically adapt to the new tile layout, maintaining a complete display at all times. The specific steps are as follows: In the rendering loop of the 3D map, an update task is automatically triggered every preset time interval (default 500ms). The system obtains the vector features of all visible tiles in the current viewport, filters out the features with the same attribute values as the currently highlighted features according to the attribute values of the preset semantic identifier attributes, performs spatial union merging on the filtered features, and updates the highlighted display results on the 3D sphere to ensure that the integrity of the cross-tile merging results and the continuity of the highlighted state can be maintained without the user having to click again when panning or zooming the map.
[0047] In summary, this embodiment achieves automatic merging of cross-tile vector features based on attribute matching through the above steps, using business semantic attributes as the unique association identifier to avoid the risk of erroneous merging; it effectively reduces query latency by concurrently acquiring 8 neighboring tile workers and aggregating with Promise.all; and it robustly solves topological errors caused by tile splitting through a five-step preprocessing pipeline and an exponential backoff retry strategy, significantly improving the display effect and user experience of cross-tile vector features in the 3D map.
[0048] Based on the above Figure 1 The specific implementation of the method shown in this embodiment provides a cross-tile vector feature merging device based on attribute matching, such as... Figure 6 As shown, the device includes: a receiving module 31, a calculation module 32, a merging module 33, and an encapsulation module 34; The receiving module 31 is used to receive the user's click and pick operation on the 3D map, perform spatial query on the vector features in the current tile through the RTree spatial index built in the Web Worker thread, determine the vector feature where the pick point is located as the hit feature, and detect whether the hit feature contains a preset semantic identifier attribute. The calculation module 32 is used to calculate the neighborhood range of the current tile in the tile pyramid when the hit feature is detected to contain the preset semantic identifier attribute, and concurrently obtain the cached vector features in all adjacent tiles through the Worker concurrent task pool; The merging module 33 is used to convert the vector features of the current tile and the adjacent tiles into the WGS84 geographic coordinate system, group and filter them according to the attribute values of the preset semantic identifier attributes, retain the features whose attribute values match the attribute values of the hit features, perform a first spatial union merge on multiple feature fragments with the same attribute value, and then perform a second progressive union merge with the hit features with the merged result to obtain the complete feature geometry; The encapsulation module 34 is used to encapsulate the complete feature geometry into an image feature information object and highlight it on a three-dimensional sphere for display.
[0049] In specific application scenarios, the receiving module 31 can be used to traverse all cached vector polygon features and vector line features within the tile in the Worker thread, calculate the geographic bounding box for each feature, and insert the geographic bounding box into the RTree index; after coarse screening using the RTree index, the vector polygon features are matched using a point-in-polygon determination algorithm, the minimum distance from the click point to each line segment of the polyline is calculated for the vector line features, and if the distance is less than a preset threshold, it is determined as a hit, and the vector feature where the hit pick point is located is determined as the hit feature.
[0050] In a specific application scenario, the calculation module 32 can be used to take the tile coordinates where the hit element is located as the center tile, traverse the offsets of the tile coordinates in the row and column directions in the tile pyramid, generate a set of tile coordinates, and remove the center tile from the set of tile coordinates to determine the neighborhood range containing the remaining adjacent tile coordinates.
[0051] In specific application scenarios, the calculation module 32 can be used to dispatch message tasks of type pickGetLineOrFillData to the Worker thread through the WorkerFarm scheduling mechanism, so that the Worker thread responds to the message task, reads the fill surface data and polyline data of adjacent tiles from the cached variables and returns them; and waits in parallel for all adjacent tile data reading tasks to be completed through the Promise.all method to obtain the cached vector features in all adjacent tiles.
[0052] In specific application scenarios, the merging module 33 can be used to convert the vector features of the current tile and its neighboring tiles into the WGS84 geographic coordinate system using the Web Mercator inverse projection formula. The Web Mercator inverse projection formula is expressed as follows:
[0053]
[0054]
[0055] In the formula, This represents the relative x-coordinate of the vector feature within the tile. This represents the relative vertical coordinate of the vector feature within the tile. For tile column numbering, For tile row numbers, As an intermediate variable, For tile layers.
[0056] In specific application scenarios, the merge module 33 can be used to merge multiple GeoJSON Feature objects with the same attribute value by passing in the form of flattening parameters using the union method provided in the geospatial analysis library Turf.js; if the geometry type of the merged result is GeometryCollection, then LineString type geometry is filtered out, and the Union operation is re-executed on the remaining geometry to obtain the merged result of the first spatial Union merge.
[0057] In specific application scenarios, the merging module 33 can be used to remove duplicate and invalid coordinates from the merged result and the hit features; perform geometric simplification on the merged result and the hit features after the removal operation using the Douglas-Puk algorithm; perform a small-distance buffer expansion operation on the merged result and the hit features after the simplification operation, and clean up any new duplicate points introduced after the buffer expansion operation; perform a spatial union merge operation on the preprocessed merged result and the hit features; if the merge fails, the above steps are repeated using an exponential backoff strategy until the merge succeeds or the maximum number of retries is reached; if the merge still fails after reaching the maximum number of retries, the merge is abandoned, and the result of the first spatial union merge is output as the complete feature geometry; if the merge succeeds, the merged complete polygon geometry is output as the complete feature geometry.
[0058] In specific application scenarios, such as Figure 6 As shown, the device also includes: an update module 35; The update module 35 is used to trigger an update task every preset time interval during the rendering loop of the 3D map; obtain the vector features of all visible tiles in the current viewport, filter out the features with the same attribute value as the currently highlighted feature according to the attribute value of the preset semantic identifier attribute; perform spatial union merging on the filtered features, and update the highlighted display result on the 3D sphere to maintain the integrity of the cross-tile merging result when the user pans or zooms the map.
[0059] It should be noted that other corresponding descriptions of the functional units involved in the cross-tile vector feature merging device based on attribute matching provided in this embodiment can be found in [reference needed]. Figure 1 The corresponding description in [the document] will not be repeated here.
[0060] Based on the above, Figure 1 Accordingly, this embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. Figure 1 The method shown.
[0061] Based on this understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as CD-ROM, USB flash drive, mobile hard drive, etc.) and includes several instructions to cause a computer device (such as personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of this application.
[0062] Based on the above, Figure 1 The method shown, and Figure 6 To achieve the above objectives, the present application also provides an electronic device, comprising a storage medium and a processor; the storage medium for storing a computer program; and the processor for executing the computer program to implement the above-described virtual device embodiments. Figure 1 The method shown.
[0063] Optionally, the aforementioned physical devices may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.
[0064] Those skilled in the art will understand that the physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.
[0065] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the aforementioned physical device, supporting the operation of the attribute-matching cross-tile vector feature merging program and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software within the attribute-matching cross-tile vector feature merging physical device.
[0066] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented using software plus necessary general-purpose hardware platforms, or it can be implemented using hardware. Compared with the prior art, this application is superior by applying the solution of this embodiment.
[0067] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the term "comprising" or any other variations thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0068] The above are merely specific embodiments of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to these embodiments, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for merging cross-tile vector features based on attribute matching, characterized in that, include: The system receives user clicks and picks on a 3D map, performs spatial queries on vector features within the current tile using the RTree spatial index built in the Web Worker thread, identifies the vector features where the pick point is located as the hit features, and checks whether the hit features contain preset semantic identifier attributes. When the hit feature is detected to contain the preset semantic identifier attribute, the neighborhood range of the current tile in the tile pyramid is calculated, and the cached vector features in all adjacent tiles are obtained concurrently through the Worker concurrent task pool. The vector features of the current tile and the adjacent tiles are uniformly converted to the WGS84 geographic coordinate system. They are then grouped and filtered according to the attribute values of the preset semantic identifier attributes. Features whose attribute values match the attribute values of the hit features are retained. A first spatial union is performed on multiple feature fragments with the same attribute value. The merged result is then combined with the hit features to perform a second progressive union with topology repair, resulting in a complete feature geometry. The complete geometric element is encapsulated as an image element information object and highlighted on a 3D sphere for display.
2. The method for merging cross-tile vector features based on attribute matching according to claim 1, characterized in that, The process of performing a spatial query on vector features within the current tile using the RTree spatial index built in the Web Worker thread, and identifying the vector features where the pick point is located as the hit features, specifically includes: In the Worker thread, iterate through all cached vector polygon and vector line features within the tile, calculate the geographic bounding box for each feature, and insert the geographic bounding box into the RTree index; After coarse screening using the RTree index, the vector polygon features are matched using a point-in-plane determination algorithm. The minimum distance from the click point to each line segment of the polyline is calculated for the vector line features. If the distance is less than a preset threshold, it is determined as a hit, and the vector feature where the hit pick point is located is determined as the hit feature.
3. The method for merging cross-tile vector features based on attribute matching according to claim 1, characterized in that, The calculation of the neighborhood range of the current tile in the tile pyramid specifically includes: Using the tile coordinates where the hit element is located as the center tile, traverse the tile coordinates in the tile pyramid by the offsets in the row and column directions to generate a set of tile coordinates; The center tile is removed from the set of tile coordinates to determine the neighborhood range that includes the coordinates of the remaining adjacent tiles.
4. The method for merging cross-tile vector features based on attribute matching according to claim 1, characterized in that, The step of concurrently retrieving cached vector features from all adjacent tiles using a Worker concurrent task pool specifically includes: The WorkerFarm scheduling mechanism dispatches a message task of type pickGetLineOrFillData to the Worker thread, so that the Worker thread responds to the message task, reads the fill surface data and polyline data of adjacent tiles from the cache variable and returns them; The Promise.all method is used to wait in parallel for all adjacent tile data reading tasks to complete, in order to obtain the cached vector features in all adjacent tiles.
5. The method for merging cross-tile vector features based on attribute matching according to claim 1, characterized in that, The step of uniformly converting the vector features of the current tile and its neighboring tiles into the WGS84 geographic coordinate system specifically includes: The Web Mercator inverse projection formula is used to uniformly convert the vector features of the current tile and its neighboring tiles into the WGS84 geographic coordinate system. The Web Mercator inverse projection formula is expressed as follows: In the formula, This represents the relative x-coordinate of the vector feature within the tile. This represents the relative vertical coordinate of the vector feature within the tile. For tile column numbering, For tile row numbers, As an intermediate variable, For tile layers.
6. The method for merging cross-tile vector features based on attribute matching according to claim 1, characterized in that, The first spatial union merging of multiple feature fragments with the same attribute value specifically includes: The union method provided by the geospatial analysis library Turf.js is used to merge multiple GeoJSON Feature objects with the same attribute value as flattening parameters; If the geometry type of the merged result is GeometryCollection, then LineString type geometry is filtered out, and the Union operation is re-executed on the remaining geometry to obtain the merged result of the first spatial Union merge.
7. The method for merging cross-tile vector features based on attribute matching according to claim 1, characterized in that, The process of performing a second progressive Union merge with topology repair on the merged result and the hit features to obtain the complete feature geometry specifically includes: The merged result and the hit elements are subjected to duplicate coordinate points and invalid coordinate removal operations. The Douglas-Puk algorithm is used to perform geometric simplification on the merged result after the removal operation and the hit elements. A small-distance buffer expansion operation is performed on the merged result after the simplification operation and the hit elements, and new duplicate points introduced after the buffer expansion operation are cleaned up. Perform a spatial union merge operation on the preprocessed merge result and the hit features; If the merger fails, the above steps are repeated using an exponential backoff strategy until the merger succeeds or the maximum number of retries is reached. If the maximum number of retries is reached and the merge still fails, the merge is abandoned and the result of the first spatial union merge is output as the complete feature geometry. If the merge is successful, the resulting complete polygon geometry will be output as the complete feature geometry.
8. The method for merging cross-tile vector features based on attribute matching according to claim 1, characterized in that, The method further includes: In the rendering loop of the 3D map, an update task is triggered every preset time interval; Obtain the vector features of all visible tiles in the current viewport, and filter out the features with the same attribute values as the currently highlighted features according to the attribute values of the preset semantic identifier attributes. After performing a spatial union on the filtered features, the highlighted display on the 3D sphere is updated to maintain the integrity of the cross-tile merging results when the user pans or zooms the map.
9. A cross-tile vector feature merging device based on attribute matching, characterized in that, include: The receiving module is used to receive the user's click and pick operation on the 3D map, perform spatial query on the vector features in the current tile through the RTree spatial index built in the Web Worker thread, determine the vector feature where the pick point is located as the hit feature, and detect whether the hit feature contains a preset semantic identifier attribute. The calculation module is used to calculate the neighborhood range of the current tile in the tile pyramid when the hit feature is detected to contain the preset semantic identifier attribute, and to concurrently obtain the cached vector features in all adjacent tiles through the Worker concurrent task pool. The merging module is used to convert the vector features of the current tile and the adjacent tiles into the WGS84 geographic coordinate system, group and filter them according to the attribute values of the preset semantic identifier attributes, retain the features whose attribute values match the attribute values of the hit features, perform a first spatial union merge on multiple feature fragments with the same attribute value, and then perform a second progressive union merge with the hit features with the merged result to obtain the complete feature geometry; The encapsulation module is used to encapsulate the complete feature geometry into an image feature information object, which is then highlighted and drawn onto a three-dimensional sphere for display.
10. An electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the cross-tile vector feature merging method based on attribute matching as described in any one of claims 1 to 8.
