A planar object grid code generation method
By using the recursive quadrilateral partitioning method and distance constraints of GeoSOT mesh coding to generate planar object mesh codes, the problems of high complexity and large computational load of existing algorithms are solved, and efficient spatial mesh code generation and positioning are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 芜湖联合飞机科技有限公司
- Filing Date
- 2024-03-18
- Publication Date
- 2026-06-19
AI Technical Summary
Existing algorithms for generating grid codes for planar objects are highly complex and computationally intensive, resulting in low efficiency in managing large amounts of data for flight route control and no-fly zone identification.
A recursive quadrilateral partitioning method based on GeoSOT mesh coding is adopted to generate planar object mesh codes through hierarchical decomposition and distance constraints. This includes merging and deduplication of boundary line mesh code sets, aggregation processing, and optimization of the algorithm to reduce computational complexity and computational load.
It greatly reduces computational complexity and workload, enables rapid generation of mesh codes for planar objects, and improves the performance and speed of spatial positioning.
Smart Images

Figure CN118277495B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic control technology, and in particular to a method for generating grid codes for planar objects. Background Technology
[0002] Currently, conflict detection in airspace and flight path management both domestically and internationally primarily relies on calculating the 3D distance between each pair of flight paths. However, the algorithms for precise calculations are relatively complex. This also significantly impacts efficiency when dealing with a large number of flight paths, making it unsuitable for managing large datasets. A similar issue exists with determining the boundaries between no-fly zones within airspace, requiring complex 3D spatial distance calculations. Current algorithms for generating mesh codes for no-fly zone surface objects require unfolding the mesh into a set of smaller mesh codes at a specified level. Then, each smaller mesh code is checked to see if it is inside the surface object, retaining all those inside. These are then merged with the boundary line mesh code set, followed by mesh deduplication and aggregation. While this approach yields correct results, it suffers from severe performance issues when dealing with large surface objects or converting them to lower-level mesh codes. Moving the mesh level down one level means the number of meshes quadruples, resulting in a 4x increase in data volume. n The exponential growth and the enormous increase in computational load result in extremely low efficiency in practical applications. Summary of the Invention
[0003] Based on the above analysis, the embodiments of the present invention aim to provide a method for generating mesh codes for planar objects, in order to solve the problems of high complexity and large computational load in existing algorithms for generating mesh codes for planar objects.
[0004] On one hand, embodiments of the present invention provide a method for generating mesh codes for planar objects. The central control system generates the mesh code for a planar object in a closed area of a mesh map using the following method, which includes the following steps:
[0005] For a closed area surface object in the mesh graph, the lowest level mesh code containing the surface object is obtained based on the mesh code hierarchy rules and used as the mesh code to be processed.
[0006] Calculate and obtain the set of boundary line mesh codes that satisfy the distance constraint with the boundary line of the planar object;
[0007] The mesh code set for the planar object is obtained through the following process:
[0008] S11: Convert each grid code in the boundary line grid code set to the grid code of the corresponding level of the grid to be processed, and remove duplicates to obtain each grid code in the updated boundary line grid code set;
[0009] S12: If the level corresponding to the grid code to be processed is higher than the set minimum level, the grid code to be processed is decomposed into the next level grid code; otherwise, the process ends.
[0010] If the next-level mesh code exists in the boundary line mesh set of the planar object, then the next-level mesh code will be used as the mesh code to be processed in the next iteration.
[0011] Otherwise, if the mesh corresponding to the next level mesh code is located within the boundary line of the planar object, then add the next level mesh code to the planar object mesh code set; return to step S11;
[0012] The set of mesh codes for the planar object is merged with the set of mesh codes for the planar object boundary lines, and then deduplication and aggregation are performed to obtain the planar object mesh code.
[0013] The beneficial effects of the above technical solution are as follows: the algorithm optimized compared with the existing technology greatly reduces the computational complexity and amount of computation, and can quickly obtain the grid code set of planar objects, thereby locating the spatial domain, and greatly improving the computational performance and speed.
[0014] Based on a further improvement of the above method, the lowest-level mesh code of the planar object is obtained through the following process:
[0015] Based on 2 n The recursive quadrilateral decomposition method of the tree-based one-dimensional integral geographic coordinate subdivision grid coding method decomposes the code level by level from the largest grid code downwards.
[0016] After each decomposition, determine whether there is a mesh in the decomposed mesh that can completely contain the area where the planar object is located;
[0017] If it exists, continue to decompose the mesh of the area where the planar object is located until there is no mesh in the decomposed mesh that can completely contain the area where the planar object is located. Then, take the mesh code corresponding to the mesh of the previous level of the mesh obtained from the last decomposition as the lowest level mesh code of the planar object.
[0018] The beneficial effects of the above-mentioned further improvement scheme are: by decomposing the surface object through simple and fast layer-by-layer operations, the smallest level grid code is found first, eliminating many unnecessary layer operations and grid code comparisons, and using a relatively fine granularity as the starting point for subsequent operations.
[0019] A further improvement to the above method, the step of converting each grid code in the boundary line grid code set to the grid code corresponding to the level of the grid to be processed, includes:
[0020] Remove the low-level bit depth and encoding from each grid code in the boundary line grid code set, retaining only the encoding with the same level and bit depth as the grid to be processed.
[0021] The beneficial effects of the above-mentioned further improvement scheme are: a simple transformation in each iteration process reduces the number of grid codes and the number of bits, which helps to further reduce the amount of computation and the complexity of the algorithm.
[0022] Based on a further improvement to the above method, the calculation of the set of boundary line mesh codes that satisfy the distance constraint with the boundary line of the planar object includes:
[0023] The boundary lines constituting the planar object are divided into line segments according to waypoints, with the endpoints of each line segment being two adjacent waypoints;
[0024] Obtain the distance constraint mesh code set for each line segment; merge the mesh codes in the distance constraint mesh code sets of each line segment, and perform deduplication and aggregation to obtain the boundary line mesh code set.
[0025] The beneficial effects of the above-mentioned further improvement scheme are as follows: First, the set of grid codes for each route of the planar object is calculated as a comparison reference. This is so that when the minimum level grid covering the planar object is further decomposed layer by layer and compared with the set of grid codes for each route of the planar object, only a very small set of grid codes needs to be calculated. Therefore, it lays the foundation for further reducing the algorithm complexity and computational load.
[0026] Based on a further improvement of the above method, obtaining the distance constraint grid code set for each line segment includes: dividing each line segment into segments with a preset threshold as the step size, starting from the starting point;
[0027] For each line segment, perform the following steps one by one to establish a distance constraint mesh code set, and then perform mesh code deduplication and aggregation to generate the distance constraint mesh code set for the line segment:
[0028] If the grid codes corresponding to the two endpoints of a line segment are the same, then the grid code is selected as the selected grid code; if the selected grid code is not included in the distance constraint grid code set, then the selected grid code is added to the distance constraint grid code set.
[0029] If the grid codes corresponding to the two endpoints of the line segment are different, a first selected area grid code set is obtained based on the latitude and longitude of each grid code. Redundant grid codes are removed from the first selected area grid code set, and grid codes that meet the preset conditions are selected from the remaining grid codes in the first selected area grid code set and added to the distance constraint grid code set.
[0030] Based on the preset threshold, the selected grid code or the first selected area grid code set is expanded to obtain a second selected area grid code set. Redundant grid codes are removed from the second selected area grid code set, and grid codes that meet the preset conditions are selected from the remaining grid codes in the second selected area grid code set and added to the distance constraint grid code set.
[0031] The beneficial effects of the above-mentioned further improvement scheme are as follows: The technical solution of the present invention segments the route by setting the preset threshold, so that it is only necessary to calculate the set of grid codes for each route segment within a threshold range, without having to calculate all grid codes with inclusion relationships or equality, which greatly reduces the amount of computation and algorithm complexity; in addition, the calculation result of the previous route segment can effectively reduce the amount of computation of the subsequent segment, further improving the grid code calculation efficiency; overall, the calculation of grid codes is always within the quasi-linear category of the route and distance constraints, which greatly reduces the computational complexity and amount of computation compared with the exponential operation of traditional algorithms.
[0032] Based on a further improvement of the above method, the preset threshold is the aircraft safety threshold, and the lowest level grid in the distance constraint grid set is determined by selecting either the grid code width equal to the aircraft safety threshold or the grid code width of the two closest adjacent levels.
[0033] The beneficial effects of the above-mentioned further improvement scheme are: the present invention sets the preset threshold to be consistent with the aircraft safety threshold, and determines the lowest level of the grid map based on the aircraft safety threshold. This is a suitable and reasonable choice for the processing of routes in the grid map. It will not increase the computational burden too much, nor will it affect the distance constraint too little. It can also make the route segments approximately straight lines when dividing the route, thus reducing the computational complexity.
[0034] Based on a further improvement of the above method, the removal of redundant grid codes refers to removing grid codes that are the same as those in the distance constraint grid code set from the first selected region grid code set or the second selected region grid code set.
[0035] The beneficial effects of the above-mentioned further improvement scheme are: by removing redundancy, the present invention eliminates the calculation of the overlapping part of the grid in the previous route segment and the next route segment. For the next route segment, only the newly added grid and the grid in the previous route segment with a calculation greater than the preset threshold need to be calculated, which further effectively reduces the amount of calculation and the complexity of the algorithm.
[0036] Based on a further improvement of the above method, the preset condition refers to the perpendicular distance between the point in the grid farthest from the route segment and the route segment being less than the preset threshold.
[0037] The beneficial effect of the above-mentioned further improvement scheme is that by determining whether the perpendicular distance between the farthest fixed point of the remaining grid farthest from the route segment and the route segment is less than the preset threshold, it is possible to determine whether all the remaining grids meet the conditions. The overall conclusion can be obtained in one step, further reducing the amount of computation and the complexity of the algorithm.
[0038] Based on a further improvement of the above method, the deduplication refers to performing the following steps on the lattice code, the steps including:
[0039] Sort the grid codes by size;
[0040] Compare adjacent grid codes after sorting;
[0041] If two adjacent grid codes are the same, then delete either of the two adjacent identical grid codes.
[0042] The beneficial effects of the above-mentioned further improvement scheme are: after deduplication, a set of non-redundant grid codes can be obtained, which is convenient for subsequent applications and saves subsequent storage and processing resources.
[0043] Based on a further improvement of the above method, the aggregation includes the following steps:
[0044] SA1: Sort the grid codes of the distance constraint grid code set by size;
[0045] SA2: Group every four adjacent grid codes in the sorted grid code sequence into the same group. SA3: Determine whether the grid codes in each group are at the same level and whether the grid codes at the next higher level are the same.
[0046] If so, delete each grid code in the same group and add the corresponding parent grid code of the group to obtain the updated distance constraint grid code set, and return to step SA1; when the four adjacent grid codes that have no groups can be merged into the parent grid code, then the process ends.
[0047] The beneficial effects of the above-mentioned further improvement scheme are: the aggregated grid collection is easier to use in subsequent applications and saves subsequent storage and processing resources.
[0048] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description
[0049] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.
[0050] Figure 1 This is a schematic diagram of the grid code for point objects in a grid diagram;
[0051] Figure 2 A schematic diagram of a set of mesh codes covering distance constraints for point objects;
[0052] Figure 3 A schematic diagram showing the segmentation of the boundary line of a planar object;
[0053] Figure 4 This is a schematic diagram of the boundary line mesh code of the planar object generated in an embodiment of the present invention;
[0054] Figure 5 This is a schematic diagram of the first selected area in an embodiment of the present invention;
[0055] Figure 6 This is a schematic diagram of the second selected area in an embodiment of the present invention;
[0056] Figure 7 This is a schematic diagram of the grid code algorithm for surface objects generated in an embodiment of the present invention;
[0057] Figure 8 This is a schematic diagram of grid code aggregation operation according to an embodiment of the present invention. Detailed Implementation
[0058] To facilitate understanding of the technical solution of this invention, the following provides a detailed explanation of the technical terms that appear or are involved:
[0059] GeoSOT grid: GeoSOT (Geographic Coordinate Subdividing Grid with One Dimension Integral Coding on 2n-Tree) is based on 2n-tree... nGeoSOT is a one-dimensional integer array global latitude and longitude subdivision grid. The GeoSOT grid achieves integer-degree, integer-division quadtree subdivision by expanding the Earth's surface latitude and longitude range three times (expanding the Earth's geographic space to 512°, 1° to 64′, and 1′ to 64″). Based on the GeoSOT grid subdivision principle, each level of subdivision is identified using a 64-bit code. The longest code is a 32-bit quaternary numerical code. Bits 1-9 are degree-level grid codes, bits 10-15 are hierarchical grid codes, bits 16-21 are second-level grid codes, and bits 22-32 are sub-second grid codes. The code length represents the grid level. The GeoSOT grid is divided into 32 levels, ranging from global to centimeter-level, uniformly dividing the Earth's surface into multi-level grids that form a global quadtree system. The area ratio between different levels of the GeoSOT grid is approximately 4:1, showing a uniform variation.
[0060] Grid coding is a multi-scale, discrete global geogrid coding model developed based on a globally segmented grid, suitable for navigation and positioning services. This grid coding model proposes a unified method for identifying and representing global spatial location information, capable of identifying both locations and regions. It features non-overlapping boundaries, orthogonal grids, consistent latitude and longitude, and good compatibility with traditional data specifications, and can perform integrated point-area representation. Through integer coding design, it greatly simplifies the complexity of identifying, representing, and calculating location information, effectively solving the problem of organizing massive, multi-source, and heterogeneous spatial information in terms of information processing speed, information indexing efficiency, and information exchange and integration. This invention employs the GeoSOT meshing scheme, which expands the Earth's surface space three times: both latitude (-90° to 90°) and longitude (-180° to 180°) are expanded to (-256° to 256°), 1° is expanded to 64′, and 1′ is expanded to 64″, achieving equal degree, equal division, and equal second meshing. GeoSOT belongs to the equal latitude and longitude quadtree meshing system, with a total of 32 meshing levels. From the top level 1, a mesh of size 256° can be expressed, to the bottom level 32, a mesh of size 1 / 2048″ (approximately 1.5 cm) can be expressed.
[0061] Spatial domain representation refers to the spatial representation of three types of objects: point, line, and area. Point spatial domains are directly converted from the latitude and longitude coordinates of the point into a positioning-level grid code, and the corresponding grid is quickly located. Linear spatial domains are represented as a series of interconnected grids; different subdivision levels are selected for different representation accuracies based on the accuracy correspondence principle. The boundary of an area spatial domain can be considered as a continuous and closed series of connected line spatial domains; therefore, the method for obtaining the row and column coordinate sets of the area spatial domain boundary is the same as for the line spatial domain. Additionally, mesh filling is required for the internal regions of the area objects. The two parts are then merged to obtain the grid set of the area spatial domain. Spatial domain representation satisfies two principles: ① minimum grid size principle; ② accuracy correspondence principle.
[0062] Grid aggregation: Since the grid code used in this invention belongs to the equal latitude and longitude quadtree partitioning grid system, theoretically all grids are formed by progressively subdividing from the top-level grid of 256°*256° downwards. Grid aggregation is the reverse process, which is the process of aggregating four adjacent grids that satisfy the encoding rules into a grid of the next higher level.
[0063] Mesh decomposition: Mesh decomposition is the opposite of mesh aggregation, and it is a process of decomposing the mesh level by level. The mesh of the previous level can be decomposed into four sub-mesh levels of the next level according to the encoding rules, while maintaining the encoding rules between the meshes of the upper and lower levels.
[0064] Mesh operations primarily refer to spatial operations performed between linear or planar objects in a spatial domain using mesh sets. These operations include intersection, union, and erasure operations between mesh sets, each with its own specific meaning. An intersection operation represents the shared mesh area between two objects; a union operation represents the mesh area covered by two objects; and an erasure operation represents the mesh area after one object has been removed by another.
[0065] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0066] A specific embodiment of the present invention discloses a method for generating mesh codes for planar objects, the method comprising the following steps:
[0067] S1: For a closed area surface object in the mesh graph, the lowest level mesh code containing the surface object is obtained based on the mesh code hierarchy rules and used as the mesh code to be processed.
[0068] Specifically, in this embodiment, the mesh diagram is based on the specified improved type 2. nThe tree-based one-dimensional integral geographic coordinate subdivision grid coding method converts the latitude and longitude coordinates of points into corresponding grid codes, allowing direct location to the appropriate grid. Complete grid information includes: grid code, grid coordinates, and grid level.
[0069] For example, with Figure 1 Taking the coordinates of point A (39°54′20″N, 116°25′29″E) as an example, the algorithm for calculating a 16-level grid code (grid scale approximately 1km) is as follows:
[0070] ① First, encode the latitude and longitude coordinates of point A according to the grid size reference table below. The encoding process is to continuously divide the coordinate value by the grid size of each level, and the quotient is the grid code value of that level, until the specified encoding level is reached.
[0071] The longitude value 116°25′29″ is coded in level 16 as follows:
[0072]
[0073] The 16th level code for latitude 39°54′20″ is as follows:
[0074]
[0075] The final 16th-level binary grid code for point A, obtained through cross-coding of latitude and longitude, is as follows: 00000111010011101010110110100100;
[0077] If converted to quaternion, it would be: 0013103222312210.
[0078] Table 1: Mesh Size Comparison Table
[0079]
[0080] ② The coordinates of the grid rectangle are calculated as follows:
[0081] Rect.Left=116°25′29″-29″=116°25′;
[0082] Rect.Bottom=39°54′20″-20″=39°54′;
[0083] Rect.Right=Rect.Left+32″=116°25′32″;
[0084] Rect.Top=Rect.Bottom+32″=39°54′32″;
[0085] ③ Calculation of the grid code set considering distance constraints:
[0086] like Figure 2 As shown, the calculation requires not only obtaining the grid information of point A, but also obtaining the information of all grids within a certain range from point A. The distance constraint range is represented by a dashed box in the figure. The actual calculation result is the set of all grids marked with diagonal lines. There are a total of 9 grids here, and each grid includes the corresponding level grid code and the corresponding grid coordinates.
[0087] Specifically, a polygonal region consisting of multiple flight paths is considered as a closed planar object region.
[0088] Furthermore, the lowest-level mesh code of the planar object is obtained through the following process:
[0089] Based on the GeoSOT recursive quadrilateral decomposition method, the decomposition starts from the largest grid code and proceeds downwards level by level;
[0090] After each decomposition, determine whether there is a mesh in the decomposed mesh that can completely contain the area where the planar object is located;
[0091] If it exists, continue to decompose the mesh of the area where the planar object is located until there is no mesh in the decomposed mesh that can completely contain the area where the planar object is located. Then, take the mesh code corresponding to the mesh of the previous level of the mesh obtained from the last decomposition as the lowest level mesh code of the planar object.
[0092] Specifically, to calculate the minimum level mesh containing planar objects, we can decompose the maximum mesh (256*256) level by level. Each level of decomposition transforms the current mesh into four sub-mesh levels. Let the current mesh be G. A The four subgrids are G. A1 G A2 G A3 G A4 If G A1 G A2 G A3 G A4 If a mesh completely contains a planar object, then this sub-mesh replaces G. A The process is repeated iteratively until the next level sub-mesh no longer meets the requirements. At this point, the current level mesh is the smallest level mesh containing the planar objects, and the calculation ends. For example... Figure 7 As shown, the large grid G is indicated by dashed lines. O It is the smallest level of mesh containing planar objects, with point O as the center point of the mesh.
[0093] S2: Calculate and obtain the set of boundary line mesh codes that satisfy the distance constraint with the boundary line of the planar object.
[0094] Furthermore, the calculation of obtaining the set of boundary line mesh codes that satisfy the distance constraint with the boundary line of the planar object includes:
[0095] The boundary lines constituting the planar object are divided into line segments according to waypoints, with the endpoints of each line segment being two adjacent waypoints;
[0096] Obtain the distance constraint mesh code set for each line segment;
[0097] The mesh codes in the distance constraint mesh code set of each line segment are merged, and duplicates are removed and aggregated to obtain the boundary line mesh code set.
[0098] Furthermore, obtaining the distance constraint grid code set for each line segment includes: dividing each line segment into segments with a preset threshold as the step size, starting from the starting point;
[0099] For each line segment, perform the following steps one by one to establish a distance constraint mesh code set, and then perform mesh code deduplication and aggregation to generate the distance constraint mesh code set for the line segment:
[0100] If the grid codes corresponding to the two endpoints of a line segment are the same, then the grid code is selected as the selected grid code; if the selected grid code is not included in the distance constraint grid code set, then the selected grid code is added to the distance constraint grid code set.
[0101] If the grid codes corresponding to the two endpoints of the line segment are different, a first selected area grid code set is obtained based on the latitude and longitude of each grid code. Redundant grid codes are removed from the first selected area grid code set, and grid codes that meet the preset conditions are selected from the remaining grid codes in the first selected area grid code set and added to the distance constraint grid code set.
[0102] Based on the preset threshold, the selected grid code or the first selected area grid code set is expanded to obtain a second selected area grid code set. Redundant grid codes are removed from the second selected area grid code set, and grid codes that meet the preset conditions are selected from the remaining grid codes in the second selected area grid code set and added to the distance constraint grid code set.
[0103] Furthermore, the preset threshold is the aircraft safety threshold, and the lowest level grid in the distance constraint grid set is determined by selecting either the grid code width equal to the aircraft safety threshold or the grid code width of the two closest adjacent levels.
[0104] Specifically, the minimum level grid code width depends on the aircraft's own safety threshold. The aircraft's own safety threshold is a factory parameter based on the aircraft's maneuverability attributes. Preferably, the minimum level grid code width is selected based on the aircraft's own safety threshold, which is equal to or closest to the value of the aircraft's own safety threshold. The advantage of this approach is that it not only ensures the range of the aircraft's safety threshold, but also prevents the grid code width from being too large, causing coarse-grained errors, or too small, causing low grid code precision and increasing the amount of invalid calculations.
[0105] For example, assuming the lowest level of grid code is level 16, according to Table 1, the size of a level 16 grid is 1km and the size is 32″. Therefore, the minimum preset threshold value is the grid width corresponding to the level 16 grid code.
[0106] Specifically, such as Figure 4 The pentagonal surface object shown is divided into the following line segments according to its waypoints: AB, BC, CD, DE, EA. The following section uses line segment AB as an example to explain in detail how to obtain the distance constraint mesh code set of this line segment.
[0107] Starting from point A, temporary intermediate nodes are inserted between points A and B in steps of a threshold value to segment the route. The threshold is preferably set to the width of the lowest-level grid. If the distance between the last inserted node and point B is less than one step, no insertion is needed. Insertion also stops when the distance between the last inserted node and point B is less than one step. Figure 3 Seven intermediate nodes were inserted to form route segments AA1, A1A2, ..., A7B.
[0108] Furthermore, the selected grid code level is the grid code level corresponding to the minimum precision selected by the grid diagram according to application requirements.
[0109] Next, each segment is processed, starting with segment AA1. First, the grid code for point A and point A1 is calculated as G. A G A1 If G A =G A1 This indicates that A and A1 are within the same grid range. In this case, the grid code corresponding to the grid where points A and A1 are located is saved to the distance constraint grid code set G.
[0110] It should be noted that the distance constraint code grid set is initially set to an empty set. After traversing all route segments AA1, A1A2, ..., A7B, the set stores the grid codes corresponding to each route segment.
[0111] Furthermore, obtaining the first selected area grid code set based on the latitude and longitude of the grid refers to sorting the longitude and latitude of the grids where the two endpoints of the route segment are located, and taking the rectangular area covered by the two longitudes and two latitudes with the largest differences as the first selected area, thereby obtaining the set of grid codes covered by the first selected area.
[0112] like Figure 5 As shown, if the grid code G where point A is located... A The grid code G where point A1 is located A1 If they are different, they are merged into a larger grid G. Inner Specifically, according to G A G A1 The range is determined by sorting the latitude and longitude of the grids containing points A and A1 respectively, and then taking the grid range covered by the maximum difference in longitude and latitude between the grids containing points A and A1 as the first selected region, i.e., G. Inner .
[0113] For example, suppose the grid coordinates of point A are:
[0114] ARect.Left = 116°25′;
[0115] ARect.Bottom=39°54′32″;
[0116] ARect.Right=116°25′32″;
[0117] ARect.Top = 39°54′;
[0118] The latitude and longitude of the grid where point A1 is located are:
[0119] A1Rect.Left=116°25′32″;
[0120] A1Rect.Bottom=39°55′4″;
[0121] A1Rect.Right=116°26′4″;
[0122] A1Rect.Top=39°54′32″;
[0123] Sort the longitudes of points A and A1 so that we have: ARect.Left, ARect.Right, A1Rect.Left, A1Rect.Right. We can see that ARect.Left and A1Rect.Right have the largest longitude difference, so we retain these two longitudes as G. InnerThe longitude; similarly, obtain the two latitudes with the largest difference between point A and point A1: ARect.Top and A1Rect.Bottom as G. Inner At the latitude, G can be obtained. Inner The grid covered by the rectangular region yields the grid code set G. Inner .
[0124] Get G Inner Remove G from A G A1 The remaining two grid codes are then labeled G. LT G RB .
[0125] Furthermore, the preset condition refers to the fact that the perpendicular distance between the point in the grid farthest from the route segment and the route segment is less than the preset threshold.
[0126] Determine AA1 and G respectively LT G RB The distance relationship, if G LT G RB If the perpendicular distance between the farthest point in the mid-distance route segment AA1 and the route segment AA1 is less than the preset threshold, then G... LT and G RB Save it to the distance-constrained mesh code set G.
[0127] Next, as Figure 6 As shown, G continues to increase according to the preset threshold. Inner Cheng G Outer Specifically, from G Inner The corresponding rectangular region extends outward by a threshold width on each of its four sides (top, bottom, left, and right). In the embodiment, G Inner Originally, it corresponded to a rectangular area containing 2*2, or 4 grids, which was expanded to G. Outer Afterwards, it becomes a rectangular region containing a 4x4 grid, such that G Outer It becomes a set containing all grid codes within the AA1 segment threshold range.
[0128] Furthermore, the removal of redundant grid codes refers to removing grid codes that are the same as those in the distance constraint grid code set from the first selected region grid code set or the second selected region grid code set.
[0129] Specifically, from G Outer Remove G from Inner The grid codes in the set are compared with the grid coordinates and AA1 distances of the remaining grid codes and the preset threshold. The grid codes corresponding to the grids that are less than the preset threshold are saved to the distance constraint grid code set G.
[0130] After processing segment AA1, segment A1A2 is processed. The processing method for segment A1A2 is similar to that of segment AA1. However, due to the adjacency relationship between AA1 and A1A2, there will be overlapping mesh areas at the connection points. Many meshes have already been identified and preserved during the processing of segment AA1. Therefore, after removing redundant meshes, the duplicate verification of overlapping meshes between AA1 and A1A2 can be skipped directly, without secondary processing. Only newly added meshes whose distance from the previous processing is greater than a preset threshold need to be processed, reducing the number of comparisons.
[0131] This process continues until the last route segment is processed, resulting in a set of distance constraint mesh codes for each segment. The mesh codes in each segment's distance constraint mesh code set are then merged, deduplicated, and aggregated to obtain the boundary line mesh code set. The mesh code set for the boundary line of the planar object is calculated using step 1, as shown below. Figure 4 As shown, the solid line grid is obtained after converting the ABCDEA grid code of the boundary line of the planar object.
[0132] S3: Obtain the mesh code set for the planar object through the following process:
[0133] For example, for ease of explanation, the set of mesh codes for the boundary lines of planar objects is denoted as G. Line The set of grid codes to be processed is denoted as G. Intersect First, the smallest level mesh code G containing the planar object obtained in step S1 is... O Join G Intersect middle.
[0134] S11: Convert each grid code in the boundary line grid code set to the grid code of the corresponding level of the grid to be processed, and remove duplicates to obtain each grid code in the updated boundary line grid code set;
[0135] Furthermore, the step of converting each grid code in the boundary line grid code set to the grid code corresponding to the level of the grid to be processed includes:
[0136] Remove the low-level bit depth and encoding from each grid code in the boundary line grid code set, retaining only the encoding with the same level and bit depth as the grid to be processed.
[0137] For example, for ease of explanation, let's say the current G... Intersect The hierarchy of the lattice code is denoted as L. C , will G Line All grid codes in the Lth generation are converted to the Lth generation. C The grid code is divided into levels, and duplicates are removed. The set of converted grid codes is denoted as G. C .
[0138] S12: If the level corresponding to the grid code to be processed is higher than the set minimum level, the grid code to be processed is decomposed into the next level grid code; otherwise, the process ends.
[0139] If the next-level mesh code exists in the boundary line mesh set of the planar object, then the next-level mesh code will be used as the mesh code to be processed in the next iteration.
[0140] Otherwise, if the mesh corresponding to the next level mesh code is located within the boundary line of the planar object, then add the next level mesh code to the planar object mesh code set; return to step S11;
[0141] For example, G Intersect Any lattice code in the code is represented by the variable symbol G. i Judge G one by one Intersect Each G i Is it related to the grid code set G? C They are equal to a certain grid code in the grid.
[0142] If so, it means that the current G i Included in the boundary grid code set G Line Then the current element contained in G will be included. Line G i Decomposed into the next level of grid code: G i0 G i1 G i2 G i3 and put G i0 G i1 G i2 G i3 Added to the spare grid code set, denoted as G Bak In the middle, at the same time from G Intersect Delete the contents of G Line G i ;
[0143] Otherwise, it means that the current G i There are two possibilities: either G i It is either entirely inside the face object or entirely outside the face object. Next, obtain G. i The center point of the grid is used to determine its spatial relationship with the planar object. Specifically, the rectangular region formed by the maximum longitude, minimum longitude, highest latitude, and lowest latitude of the planar object, obtained by sorting the longitude and latitude of the planar object's boundary lines respectively, is taken as the minimum bounding rectangle of the planar object. The current G... i Compare the center point coordinates of G with the minimum bounding rectangle; if the current G... i If the center point coordinates are inside the smallest bounding rectangle, then the current G... i The resulting graticule is retained in the spare graticule set, denoted as G.Surin In the middle, at the same time in G Intersect Remove the current G from the set i If the center point is outside the planar object, then it is also in G. Intersect Delete the current G from the set i This concludes the current G i The judgment.
[0144] For G Intersect After all grid codes have been processed, clear set G. Intersect , will set G Bak All grid codes in G are assigned to G Intersect And repeat step S3 until G. Intersect The grid code hierarchy and G Line If the lowest grid code level is the same, the loop ends.
[0145] After the above steps, the set G is obtained. Line G Surin .
[0146] S4: Merge the set of mesh codes for the planar object with the set of mesh codes for the boundary line of the planar object, and then obtain the planar object mesh code by deduplication and aggregation.
[0147] For example, merging G Line and G Surin Let it be set G ALL , for G ALL Perform deduplication and aggregation of grid codes.
[0148] Furthermore, the deduplication refers to performing the following steps on the lattice code, the steps including:
[0149] Sort the grid codes by size;
[0150] Compare adjacent grid codes after sorting;
[0151] If two adjacent grid codes are the same, then delete either of the two adjacent identical grid codes.
[0152] Furthermore, the aggregation includes the following steps:
[0153] SA1: Sort the grid codes of the distance constraint grid code set by size;
[0154] SA2: Group every four adjacent grid codes in the sorted grid code sequence into the same group.
[0155] SA3: Determine whether the grid codes in each group are at the same level and whether the upper-level grid codes are the same.
[0156] If so, delete each grid code in the same group and add the corresponding parent grid code of the group to obtain the updated distance constraint grid code set, and return to step SA1; when the four adjacent grid codes that have no groups can be merged into the parent grid code, then the process ends.
[0157] Specifically, according to the principle of minimizing grid codes, it is necessary to aggregate the grid codes in some areas upwards to reduce the number of grid codes to a minimum.
[0158] Since the grid coding principle follows the equal latitude and longitude quadtree partitioning grid system, through sorting, if four adjacent grid codes simultaneously satisfy: Same level If all the parent grid codes are the same, then these four grid codes can be aggregated into a single parent grid code.
[0159] For example, such as Figure 8 As shown:
[0160] The large grid where point C is located was originally composed of 4 smaller grids G. C1 G C2 G C3 G C4 The small grid is at level 16, and the grid codes are as follows:
[0161] G C1 =00000111010011101010110110100100;
[0162] G C2 =00000111010011101010110110100101;
[0163] G C3 =00000111010011101010110110100110;
[0164] G C4 =00000111010011101010110110100111;
[0165] Due to G C1 G C2 G C3 G C4 The parent grid code is 000001110100111010101101101001, denoted as G. C ,
[0166] The merged mesh G meets the merging requirements. C It becomes a level 15 grid.
[0167] In theory, after a grid code is aggregated once, it can continue to aggregate upwards until all adjacent grid codes no longer meet the conditions, at which point the aggregation process stops.
[0168] For example, such as Figure 7 As shown, the grid code G O Decomposed into 4 subgrid codes G O0 G O1 G O2 G O3 Let L O =15, then L O0 =L O1 =L O2 =L O3 =16, while the boundary line grid code set G Line The lowest level is level 19 ( Figure 7 Minimum precision, i.e., the smallest grid level). Due to G O0 G O1 G O2 G O3 Contained in G at level 16 Line G needs to be retained. O0 G O1 G O2 G O3 And continue to make judgments. Using G... O2 For example, let's take G O2 Further decompose into: G O20 G O21 G O22 G O23 After comparison G O20 G O22 G O23 Not included in G at level 17 Line After further evaluation, it can be deleted directly. Because G O21 Contained in G at level 17 Line Continue to retain and further evaluate. Repeat this process until G is reached. Intersect and G Line After completing the containment relationship check for level 18 mesh codes, temporarily store all mesh codes contained within face objects in the mesh code set G. Surin In, such as Figure 7 In the middle, G 012 Can be directly added to G Surin In the middle. Then G will be... Surin and G Line Merge into G ALL Then, by calling step S4, G is... ALL The mesh code algorithm for planar objects is completed after deduplication and aggregation.
[0169] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0170] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for generating mesh codes for planar objects, characterized in that, The central control system generates the mesh code for a closed area surface object in the mesh map using the following method, which includes the following steps: For a closed area surface object in the mesh graph, the lowest level mesh code containing the surface object is obtained based on the mesh code hierarchy rules and used as the mesh code to be processed. The set of boundary line mesh codes that satisfy the distance constraint with the boundary line of the planar object is calculated, including: The boundary lines constituting the planar object are divided into line segments according to waypoints, with the endpoints of each line segment being two adjacent waypoints; Obtain the distance constraint mesh code set for each line segment, including: For each line segment, starting from the starting point, the line segment is divided into segments with a preset threshold as the step size; For each line segment, perform the following steps one by one to establish a distance constraint mesh code set, and then perform mesh code deduplication and aggregation to generate the distance constraint mesh code set for the line segment: If the grid codes corresponding to the two endpoints of a line segment are the same, then the grid code is selected as the selected grid code; if the selected grid code is not included in the distance constraint grid code set, then the selected grid code is added to the distance constraint grid code set. If the grid codes corresponding to the two endpoints of the line segment are different, a first selected area grid code set is obtained based on the latitude and longitude of each grid code. Redundant grid codes are removed from the first selected area grid code set, and grid codes that meet the preset conditions are selected from the remaining grid codes in the first selected area grid code set and added to the distance constraint grid code set. Based on the preset threshold, the selected grid code or the first selected area grid code set is expanded to obtain a second selected area grid code set. Redundant grid codes are removed from the second selected area grid code set, and grid codes that meet the preset conditions are selected from the remaining grid codes in the second selected area grid code set and added to the distance constraint grid code set. Merge the mesh codes in the distance constraint mesh code set of each line segment, and then perform deduplication and aggregation to obtain the boundary line mesh code set; The mesh code set for the planar object is obtained through the following process: S11: Convert each grid code in the boundary line grid code set to the grid code of the corresponding level of the grid to be processed, and remove duplicates to obtain each grid code in the updated boundary line grid code set; S12: If the level corresponding to the grid code to be processed is higher than the set minimum level, the grid code to be processed is decomposed into the next level grid code; otherwise, the process ends. If the next-level mesh code exists in the set of meshes for the boundary line of the planar object, then the next-level mesh code will be used as the mesh code to be processed in the next iteration. Otherwise, if the mesh corresponding to the next level mesh code is located within the boundary line of the planar object, then add the next level mesh code to the planar object mesh code set; return to step S11; The set of mesh codes for the planar object is merged with the set of mesh codes for the planar object boundary lines, and then deduplication and aggregation are performed to obtain the planar object mesh code.
2. The method for generating a mesh code for a planar object according to claim 1, characterized in that, The lowest-level mesh code of the areal object is obtained through the following process: Based on 2 n The recursive quadrilateral decomposition method of the tree-based one-dimensional integral geographic coordinate subdivision grid coding method decomposes the code from the largest grid code downwards level by level. After each decomposition, determine whether there is a mesh in the decomposed mesh that can completely contain the area where the planar object is located; If it exists, continue to decompose the mesh of the area where the planar object is located until there is no mesh in the decomposed mesh that can completely contain the area where the planar object is located. Then, take the mesh code corresponding to the mesh of the previous level of the mesh obtained from the last decomposition as the lowest level mesh code of the planar object.
3. The method for generating a grid code for a planar object according to claim 2, characterized in that, The step of converting each grid code in the boundary line grid code set to the grid code corresponding to the level of the grid to be processed includes: Remove the low-level bit depth and encoding from each grid code in the boundary line grid code set, retaining only the encoding with the same level and bit depth as the grid to be processed.
4. The method for generating a grid code for a planar object according to claim 3, characterized in that, The preset threshold is the aircraft safety threshold. The lowest level grid in the distance constraint grid set is determined by selecting either the grid code width equal to the aircraft safety threshold or the grid code widths of the two closest adjacent levels.
5. The method for generating a mesh code for a planar object according to claim 4, characterized in that, The removal of redundant grid codes refers to removing grid codes that are the same as those in the distance constraint grid code set from the first selected region grid code set or the second selected region grid code set.
6. The method for generating a mesh code for a planar object according to claim 5, characterized in that, The preset condition refers to the fact that the perpendicular distance between the point farthest from the route segment in the grid and the route segment is less than the preset threshold.
7. The method for generating a mesh code for a planar object according to claim 6, characterized in that, The deduplication process refers to performing the following steps on the lattice code: Sort the grid codes by size; Compare adjacent grid codes after sorting; If two adjacent grid codes are the same, then delete either of the two adjacent identical grid codes.
8. The method for generating a mesh code for a planar object according to claim 7, characterized in that, The aggregation includes the following steps: SA1: Sort the grid codes of the distance constraint grid code set by size; SA2: Group every four adjacent grid codes in the sorted grid code sequence into the same group. SA3: Determine whether the grid codes in each group are at the same level and whether the grid codes at the next higher level are the same. If so, delete each grid code in the same group and add the corresponding upper-level grid code of the group to obtain the updated distance constraint grid code set, and return to step SA1; The process ends when the four adjacent grid codes that are not grouped together can be merged into the next higher-level grid code.