A vector map-based method for automatic generation of a war game board

By calculating the similarity of linear features and adjusting the hexagonal grid coding, combined with the LCSS and DTW algorithms, the problem of low accuracy in war chess board generation is solved, and higher quality automatic chess board generation is achieved.

CN113935197BActive Publication Date: 2025-10-21Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111333174.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-11
Publication Date
2025-10-21
Estimated Expiration
2041-11-11

AI Technical Summary

Technical Problem

In the existing automatic generation methods of war game chessboards, the accuracy of the generated chessboards is low.

Method used

Through a vector map-based method, the similarity of linear features before and after quantization is calculated, and the hexagonal grid coding of sub-segments with low similarity is adjusted. Combined with the longest common subsequence algorithm (LCSS) and dynamic time warping (DTW) algorithm, the segment trajectory is evaluated and corrected to generate a more accurate wargame board.

Benefits of technology

The accuracy of wargame board generation has been improved, ensuring accurate modeling of line segments and surface elements, and improving the quality of automated board generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113935197B_ABST
    Figure CN113935197B_ABST
Patent Text Reader

Abstract

The application relates to a kind of vector map-based automatic generation method of war game board, belong to war game technical field.The method includes linear feature modeling: each linear feature is divided into line segment, obtain several line segments before quantization;According to the coordinate data of linear feature, determine the hexagonal grid code passed by each line segment, and then determine the trajectory of each line segment after quantization;The first similarity of the trajectory before quantization and the trajectory after quantization of each line segment is calculated, if the first similarity is less than or equal to the set threshold, then the line segment is divided into sub-line segment, the sub-line segment with smaller similarity in the line segment is selected, the hexagonal grid code passed by the sub-line segment with smaller similarity is translated in at least one direction around one unit, the second similarity is calculated, the trajectory with greater similarity in the first similarity and the second similarity is used as the final trajectory of the line segment after quantization.The application improves the accuracy of war game board establishment by evaluating and correcting the trajectory after quantization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for automatically generating a war game board based on a vector map, and belongs to the technical field of war games. Background Art

[0002] With advances in computer science and technology, computer wargames have become a major platform for studying informationized warfare. However, traditional computer wargame board creation still relies primarily on manual deployment, resulting in low efficiency, long production cycles, and high costs. To address this, some have proposed technical solutions for automated wargame board generation. For example, an article titled "Research and Implementation of Wargame Board Generation Methods" published in the Journal of Surveying and Mapping Science and Technology, Volume 31, Issue 4, 2014, discloses a method for automated wargame board generation. The key points of this method involve classifying and capturing linear and surface features based on existing vector map data. Then, different algorithms are used to construct feature models within a hexagonal grid coordinate system, ultimately automating the wargame board construction.

[0003] However, during the generation process of the above-mentioned wargame chessboard, the generated chessboard is not effectively evaluated and corrected, resulting in low accuracy of the chessboard. Summary of the Invention

[0004] The purpose of this application is to provide a method for automatically generating a war chess board based on a vector map, so as to solve the problem of low accuracy of existing automatic chess board generation.

[0005] To achieve the above objectives, this application proposes a technical solution for a method for automatically generating a wargame board based on a vector map, which includes the following linear feature modeling steps:

[0006] 1) Obtain linear features in the vector map; divide each linear feature into segments to obtain several segments before quantization;

[0007] 2) Determine the hexagonal grid code that each line segment passes through based on the coordinate data of the linear element, and then determine the quantized trajectory of each line segment;

[0008] 3) Calculate the first similarity between the trajectory before and after quantization of each line segment, and determine whether the trajectory after quantization needs to be adjusted based on the first similarity:

[0009] If the first similarity is greater than the set threshold, no adjustment is required;

[0010] If the first similarity is less than or equal to the set threshold, adjustment is required and the process goes to step 4);

[0011] The calculation formula of the first similarity is:

[0012]

[0013] Among them, P t is the trajectory before quantization containing t trajectory points; Q n is the quantized trajectory containing n trajectory points; D dtw (P t ,Q n ) is the trajectory P t With Q n The DTW distance d(p i ,q j ) is p i ,q j The latitude and longitude distance between two points;

[0014] 4) The line segment is divided into sub-segments. The longest common subsequence algorithm (LCSS) is used to select sub-segments with smaller similarity within the line segment. The hexagonal grid code passed by the sub-segment with smaller similarity is translated by one unit in at least one direction on all four sides. The second similarity between the trajectory of the line segment and the trajectory before quantization is calculated based on the translated hexagonal grid code. The trajectory with the larger similarity between the first and second similarities is used as the final trajectory of the line segment after quantization. After all linear and surface elements are modeled, the wargame board is automatically generated.

[0015] The beneficial effects of the technical solution of the present invention's automatic wargame board generation method based on a vector map are as follows: After quantizing linear elements, the present invention calculates a first similarity between the quantized trajectory of each segment in the linear element and the trajectory before quantization. For segments with low first similarity, it is necessary to identify sub-segments with lower similarity, then adjust the hexagonal grid encodings that the sub-segments pass through to obtain a second similarity for the adjusted segments. The second similarity is then compared with the first similarity, and the trajectory corresponding to the higher similarity is selected as the final quantized trajectory. By evaluating and correcting the quantized trajectories, the present invention improves the accuracy of wargame board creation.

[0016] Furthermore, in step 4), the hexagonal grid encoding of the sub-segment with smaller similarity is respectively translated by one unit upward, downward, left, and right, thereby obtaining the second similarity of the upward translation, the second similarity of the downward translation, the second similarity of the left translation, and the second similarity of the right translation. The trajectory corresponding to the maximum similarity among the first similarity and all the second similarities is selected as the final trajectory of the quantized segment.

[0017] Furthermore, in step 4), the hexagonal grid codes passed by the sub-segments with smaller similarities are sequentially translated in different directions. The translation process is stopped when the second similarity is greater than the first similarity, and the corresponding trajectory with larger similarity is used as the final trajectory after quantization of the segment.

[0018] Furthermore, in step 2), the process of determining the hexagonal grid code that each line segment passes through includes:

[0019] c. Determine the hexagonal grid code of each line segment vertex, including the starting point and the end point;

[0020] Determine whether the starting point and the end point are located in the same hexagonal grid. If the starting point and the end point are located in the same hexagonal grid, the hexagonal grid codes of the starting point and the end point are the hexagonal grid codes that the line segment passes through. If the starting point and the end point are not located in the same hexagonal grid, then starting from the starting point, draw several equidistant parallel lines parallel to the y-axis until the end point, obtain the intersection of each parallel line with the line segment, and then obtain the hexagonal grid code of each intersection. The hexagonal grid code of each intersection, the starting point, and the end point is the hexagonal grid code that the line segment passes through.

[0021] Furthermore, the process of determining the hexagonal grid code of each line segment vertex includes:

[0022] Determine the initial hexagonal grid code of the vertex according to the vertex coordinates in the rectangular coordinate system;

[0023] A local coordinate system is established based on the hexagonal grid where the initial hexagonal grid code is located, and the vertex coordinates in the rectangular coordinate system are converted to the local coordinate system to obtain the vertex coordinates in the local coordinate system;

[0024] Calculate the vector between the vertex in the local coordinate system and each vertex of the hexagonal grid to obtain the angle between adjacent vectors;

[0025] The angle sum of adjacent vectors is calculated, and the final hexagonal grid code of the line segment vertex is determined based on the angle sum of adjacent vectors and the vertical coordinate of the vertex in the local coordinate system.

[0026] Furthermore, the calculation process of determining the initial hexagonal grid code of the vertex according to the vertex coordinates in the rectangular coordinate system is as follows:

[0027]

[0028] Where (x, y) is the coordinate of the vertex in the rectangular coordinate system; (i', j') is the initial hexagonal grid code of the vertex; floor is the floor symbol; w is the width of the hexagonal grid; h is the height of the hexagonal grid.

[0029] Furthermore, the step of determining the final hexagonal grid code of the line segment vertex according to the angle between the adjacent vectors and the vertical coordinate of the vertex in the local coordinate system includes:

[0030] like but

[0031] like and but

[0032] like and but

[0033] in, is the angle and ε is the set accuracy; y' is the vertical coordinate of the vertex in the local coordinate system; h is the height of the hexagonal grid; (i, j) is the final hexagonal grid code of the vertex; (i', j') is the initial hexagonal grid code of the vertex.

[0034] Furthermore, the following planar element modeling steps are also included:

[0035] Get the area features in the vector map;

[0036] Determine the hexagonal grid code through which the boundary of the area element passes;

[0037] Calculate the intersection area between the surface element and all the hexagonal grids it passes through;

[0038] If the intersection area between the surface feature and a hexagonal grid is greater than the area threshold, the hexagonal grid will be filled; otherwise, the hexagonal grid will not be filled.

[0039] Furthermore, the intersection area S 相交区域 The calculation process is:

[0040]

[0041] Among them, (x1, y1), (x2, y2),…(x6, y6) are the vertex coordinates of the polygon where the surface element intersects a hexagonal grid in the rectangular coordinate system. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 This is a schematic diagram of the element classification of the war game vector map of the present invention;

[0043] Figure 2 It is a flow chart of modeling linear elements of a war chess board according to the present invention;

[0044] Figure 3 is a coordinate diagram of the normalized hexagonal grid of the war chess game of the present invention;

[0045] Figure 4 This is a schematic diagram of river element similarity of the present invention;

[0046] Figure 5 It is a schematic diagram of filling the surface elements of the war chess board of the present invention. DETAILED DESCRIPTION

[0047] Example of a method for automatically generating a war chess board based on a vector map:

[0048] The main concept of this invention is to address the low accuracy of wargame boards generated by existing methods. After quantizing linear elements, the present invention calculates the first similarity between the quantized trajectory of each segment in the linear element and the trajectory before quantization. For segments with low first similarity, it is necessary to identify sub-segments with lower similarity. Then, the hexagonal grid encoding through which the sub-segments pass is adjusted to obtain the second similarity of the adjusted segments. The second similarity is compared with the first similarity, and the trajectory corresponding to the higher similarity is selected as the final quantized trajectory. By evaluating and correcting the quantized trajectory, the present invention improves the accuracy of wargame board creation.

[0049] Specifically, the method for automatically generating a war chess board based on a vector map firstly generates a war chess board based on the given vector map data. Figure 1 The feature classification method shown classifies the features in the vector map into linear features and surface features. Linear features include roads, linear rivers, boundaries, etc., and surface features include surface rivers, vegetation, settlements, swamps, elevations, etc., and then the linear features and surface features are modeled in the hexagonal grid coordinate system.

[0050] The modeling process of linear features is as follows Figure 2 As shown, the following steps are included:

[0051] 1) Establish a rectangular coordinate system based on the vector map of the chessboard to be generated, read N linear elements, recorded as R1, ···, R i ,···,R N , where the i-th linear feature R i It includes m line segments, denoted as s1,···,s j ,···s m , the line segment trajectory at this time is the trajectory of the line segment before quantization.

[0052] 2) Let i = 1, j = 1, that is, the first line segment in the first linear element, find the coordinates (x, y) of the vertex of the first line segment in the first linear element in the rectangular coordinate system, and determine the initial hexagonal grid code of the vertex based on the coordinates (x, y) of the vertex in the rectangular coordinate system. The coordinates in the rectangular coordinate system can be obtained from the vector map.

[0053] In this step, the initial hexagonal grid code of the vertex is determined as follows:

[0054]

[0055] Where (i', j') is the initial hexagonal grid code corresponding to the rough chessboard of the vertex, floor is the floor symbol, w is the width of the hexagonal grid, and h is the height of the hexagonal grid.

[0056] 3) Establish a local coordinate system based on the hexagonal grid where the initial hexagonal grid code is located, that is, normalize the hexagonal grid where the initial hexagonal grid code is located, and then convert the coordinates (x, y) of the line segment vertex in the rectangular coordinate system to the local coordinate system. The coordinates of the line segment vertex in the local coordinate system are (x', y'); and determine the coordinates of each vertex of the hexagonal grid where the initial hexagonal grid code is located in the local coordinate system, and determine the hexagonal grid code where the line segment vertex is precisely located (that is, the final hexagonal grid code) according to the positional relationship between the line segment vertex and the hexagonal grid vertex.

[0057] In this step, the local coordinate system established is as follows Figure 3 As shown, the coordinates (x', y') of the line segment vertex in the local coordinate system are:

[0058]

[0059] Figure 3 In the example, the line segment vertex is M, and the vertices of the hexagonal grid where the initial hexagonal grid code is located are M1, M2, M3, M4, M5, and M6. The calculation process of the exact hexagonal grid code (i, j) where the line segment vertex is located is as follows:

[0060] a. Calculate vector Then calculate the angle between adjacent vectors:

[0061]

[0062] Similarly, The angle is

[0063] b. Sum the angles between vectors according to The size of and y' determines the exact hexagonal grid code (i, j) where the line segment vertex is located:

[0064] like Then the vertex M is considered to be located at Figure 2 The 1 area in (ε is the set accuracy), its exact corresponding hexagonal grid code is

[0065] like and The vertex is considered to be located at Figure 2 The 2 regions in the , whose exact corresponding hexagonal grid code is

[0066] like and The vertex is considered to be located at Figure 2 The exact corresponding hexagonal grid code of the 3 regions in

[0067] 4) Determine whether the line segment is located in the same hexagonal grid based on the exact hexagonal grid codes of the line segment vertices (starting point and end point). If they are located in the same hexagonal grid, then the hexagonal grid codes passed by the line segment can be determined based on the hexagonal grid codes of the line segment vertices. If they are located in different hexagonal grids, then the hexagonal grid codes passed by the line segment are determined by rasterization.

[0068] In this step, if the line segment is located in different hexagonal grids, the hexagonal grid encoding process of the line segment is determined by rasterization as follows:

[0069] a. Starting from the starting point (the vertex with the smaller x value), draw several parallel lines parallel to the y axis at equal distances to the end point (the vertex with the larger x value), and find the intersection of these parallel lines with the line segment;

[0070] b. Determine the hexagonal grid codes of all intersections using the methods of steps 2) and 3), and determine whether the hexagonal grid codes of adjacent intersections are adjacent. If they are adjacent, record the hexagonal grid codes of the adjacent intersections. If they are not adjacent, solve the hexagonal grid codes of the two intersections, and finally obtain all the hexagonal grid codes of the line.

[0071] 5) Determine the quantized trajectory of the line segment based on the hexagonal grid code obtained in step 4). Calculate a first similarity between the quantized trajectory of the line segment and the trajectory before quantization. If the first similarity exceeds a set threshold, indicating that the quantized trajectory of the line segment is highly accurate, there is no need to adjust the hexagonal grid code of the line segment. If the first similarity does not exceed the set threshold, indicating that the quantized trajectory of the line segment is inaccurate, the line segment is divided into several sub-segments, and the sub-segments with low similarity are selected for hexagonal grid code adjustment. After adjustment, the sub-segments are spliced ​​with the other sub-segments to obtain an adjusted line segment. The second similarity of the adjusted line segment is determined to be greater than the first similarity of the line segment before adjustment. The trajectory corresponding to the larger of the first and second similarities is used as the final quantized trajectory of the line segment.

[0072] In this step, two principles are used to determine the quantized trajectory of linear features based on hexagonal grid codes: first, uniformly quantize rivers to the nearest hexagonal grid edge, and second, ensure that the quantized features retain their original flow direction. Based on these two principles, the distance between the linear river and the midpoint of each hexagonal grid edge it passes through is calculated, and the river is quantized to the nearest hexagonal grid boundary.

[0073] In this step, if Figure 4 As shown in the figure, the threshold value of similarity is (0-1). The closer the similarity is to 1, the more similar it is. The threshold value of linear river elements is 0.3. Assume that the trajectory of the linear river elements before quantization is:

[0074]

[0075] The trajectory of the quantized line segment is:

[0076] Among them, P t is the trajectory of the line segment before quantization, including t trajectory points; is the latitude and longitude of the t-th trajectory point in the trajectory before quantization; Q n is the quantized trajectory of the line segment, including n trajectory points; is the latitude and longitude of the nth trajectory point in the quantized trajectory.

[0077] The trajectory P before line segment quantization t The trajectory Q after quantization of the line segment n The calculation process of the DTW distance is:

[0078]

[0079] Among them, P i is the trajectory before quantization containing i trajectory points; Q j is the quantized trajectory containing j trajectory points; D dtw (P i ,Q j ) is the trajectory P i With Q j DTW distance; p i is the i-th trajectory point of the trajectory before quantization; q j is the jth trajectory point of the quantized trajectory; d(p i ,q j ) is p i ,q j The longitude and latitude distance between two points; D dtw (P i ,Q j-1 ) is the trajectory P i With Q j-1 DTW distance; D dtw (P i-1 ,Q j ) is the trajectory P i-1 With Q j DTW distance; D dtw (P i-1 ,Q j-1 ) is the trajectory P i-1 With Q j-1 DTW distance.

[0080] Finally, we get P t With Q n The DTW distance D dtw (Pt ,Q n ), D dtw (P t ,Q n ) After normalization, we get P t With Q n The similarity η of , the normalization method is as follows:

[0081]

[0082] At the same time, in this step, if the similarity does not exceed the set threshold, the line segment is divided into sub-segments, and the sub-segments with low similarity are selected for adjustment through the LCSS algorithm. The LCSS algorithm only calculates sub-segments with high similarity (that is, sub-trajectory segments). Therefore, the LCSS algorithm is used to calculate the sub-trajectory segments with high similarity, and the remaining sub-trajectory segments are sub-trajectory segments with low similarity ( Figure 4 The dotted box in the middle is the sub-trajectory segment with low similarity).

[0083] Sub-trajectory segments with low similarity are adjusted by shifting the hexagonal grid code of the less similar sub-trajectory segment by one unit upward, downward, left, and right, respectively. Each shift is then joined with the sub-trajectory segment with high similarity to produce the adjusted segment trajectory. The second similarity between each adjusted segment trajectory and the trajectory before quantization is calculated, resulting in the second similarity for the upward, downward, left, and right shifts. The trajectory with the highest similarity among the first and second similarities is selected as the final trajectory for the quantized segment.

[0084] Alternatively, for sub-trajectory segments with low similarity, the method of adjustment is to sequentially shift the hexagonal grid codes passed by the sub-trajectory segment with low similarity in different directions. The shifting process is stopped when the second similarity is greater than the first similarity, and the corresponding trajectory with higher similarity is used as the final quantized trajectory of the segment. For example, if the second phase velocity is greater than the first similarity after the first upward shift, the upward-adjusted trajectory can be directly used as the final quantized trajectory of the segment without further downward, left, or right adjustments, which can speed up the adjustment process.

[0085] Alternatively, a direction is empirically determined as the adjustment direction, and after translating in this direction, regardless of whether the second similarity is greater than the first similarity, only one adjustment is performed, and the trajectory with the greater similarity is used as the final trajectory after quantization of the line segment. The present invention does not limit the specific adjustment process.

[0086] 6) Let j = 2, repeat steps 2) to 5) to obtain the quantized trajectory of the second line segment in the first linear element, and so on, let j = j + 1, until j is greater than or equal to m, and the modeling of the first linear element is completed.

[0087] 7) Let i = 2, repeat steps 2) to 6) to obtain the quantized trajectory of the second linear element, and so on, let i = i + 1, until i is greater than or equal to N, and all linear elements are modeled.

[0088] The modeling of surface elements requires filling the corresponding hexagonal grids. Different environments are formed according to different surface elements. The modeling process includes the following steps:

[0089] 1) Read the T-block surface elements in the vector map, recorded as A1, ···, A k ,···A T .

[0090] 2) Let k = 1, that is, the first block of surface elements, and use the modeling method of linear elements to determine the hexagonal grid code through which the boundary of the surface element passes.

[0091] 3) Calculate the intersection area of ​​the surface element and all the hexagonal grids it passes through, and determine whether the hexagonal grid needs to be filled. If the intersection area of ​​a hexagonal grid and the surface element is greater than the area threshold, the hexagonal grid needs to be filled; if the intersection area of ​​a hexagonal grid and the surface element is not greater than the area threshold, the hexagonal grid needs to be discarded and does not need to be filled.

[0092] In this step, the area threshold is generally set to the hexagonal grid area S 六角格 Of course, the area threshold can be set as needed, and the present invention does not limit it.

[0093] like Figure 5 As shown, the surface element intersects with the hexagonal grid (dark black area), among which the hexagonal grid R0 is included and needs to be filled. Then, whether the remaining hexagonal grids R1, R2, R3, R4, R5, R6, and R7 are filled requires calculating the proportion of the surface element occupying its hexagonal grid. Taking the surface element v1v2v3v4v5v6 in the hexagonal grid R1 as an example, the method for calculating the ratio of the intersection area of ​​R1 and v1v2v3v4v5v6 is as follows:

[0094] a. Assume that the vertex coordinates of the intersecting polygons v1v2v3v4v5v6 are: (x1, y1), (x2, y2), ... (x6, y6)

[0095] b. Polygon area S 相交区域 for:

[0096]

[0097] c. If If , the hexagonal grid is filled, otherwise it is not filled. ξ is the threshold, which is generally set to 1 / 3.

[0098] 4) Let k = 2, and fill the second block of surface elements according to steps 2) to 3) until k ≥ T, and all surface elements are modeled.

[0099] After all linear and surface features are modeled, the wargame board is automatically generated.

[0100] In the above embodiment, in order to ensure the accuracy of the hexagonal grid code of the line segment vertex, the initial hexagonal grid code of the line segment vertex is obtained, and then the initial hexagonal grid code is adjusted in the local coordinate system. As another implementation method, the initial hexagonal grid code can also be directly used as the hexagonal grid code of the vertex.

[0101] The present invention improves the accuracy of establishing a war game board by evaluating and correcting the quantized trajectory.

Claims

1. A method for automatically generating a war chess board based on a vector map, characterized in that: The linear feature modeling steps include the following: 1) Obtain linear features from the vector map; divide each linear feature into segments to obtain a number of pre-quantized segments, establish a rectangular coordinate system based on the vector map of the war chess board to be generated, and read the linear features; 2) Determine the hexagonal grid code that each line segment passes through based on the coordinate data of the linear element, and then determine the quantized trajectory of each line segment; 3) Calculate the first similarity between the trajectory before and after quantization of each line segment, and determine whether the trajectory after quantization needs to be adjusted based on the first similarity: If the first similarity is greater than the set threshold, no adjustment is required; If the first similarity is less than or equal to the set threshold, adjustment is required and the process goes to step 4); the calculation formula for the first similarity is: Among them, P t is the trajectory before quantization containing t trajectory points; Q n is the quantized trajectory containing n trajectory points; D dtw (P t ,Q n ) is the trajectory P t With Q n DTW distance, d(p i ,q j ) is p i ,q j The latitude and longitude distance between two points; 4) Divide the line segment into sub-segments. Based on the principle of LCSS only calculating sub-segments with high similarity, LCSS is used to select sub-segments with low similarity within the line segment. The hexagonal grid codes passed by the sub-segments with low similarity are translated by one unit in at least one direction on all four sides. The second similarity between the trajectory of the line segment and the trajectory before quantization is calculated based on the translated hexagonal grid codes. The trajectory with the greater similarity between the first and second similarities is used as the final trajectory of the line segment after quantization. After all linear elements are modeled, the wargame board is automatically generated.

2. The method for automatically generating a war chess board based on a vector map according to claim 1, characterized in that: In step 4), the hexagonal grid codes of the sub-segments with smaller similarities are respectively translated upward, downward, leftward, and rightward by one unit, thereby obtaining the second similarity of the upward translation, the second similarity of the downward translation, the second similarity of the leftward translation, and the second similarity of the rightward translation. The trajectory corresponding to the maximum similarity among the first similarity and all the second similarities is selected as the final trajectory of the quantized segment.

3. The method for automatically generating a war chess board based on a vector map according to claim 1, characterized in that: In step 4), the hexagonal grid codes passed by the sub-segments with smaller similarity are sequentially translated in different directions. The translation process is stopped when the second similarity is greater than the first similarity, and the corresponding trajectory with larger similarity is used as the final trajectory after quantization of the segment.

4. The method for automatically generating a war chess board based on a vector map according to claim 1, characterized in that: In step 2), the process of determining the hexagonal grid code that each line segment passes through includes: a. Determine the hexagonal grid code of each line segment vertex, including the starting point and the end point; b. Determine whether the starting point and the end point are located in the same hexagonal grid. If so, the hexagonal grid codes of the starting point and the end point are the hexagonal grid codes that the line segment passes through. If the starting point and the end point are not located in the same hexagonal grid, then starting from the starting point, draw several equidistant parallel lines parallel to the y-axis to the end point, and obtain the intersection of each parallel line with the line segment. Then, obtain the hexagonal grid code of each intersection point. The hexagonal grid code of each intersection point, the starting point, and the end point is the hexagonal grid code that the line segment passes through.

5. The method for automatically generating a war chess board based on a vector map according to claim 4, characterized in that: The process of determining the hexagonal grid code for each line segment vertex includes: Determine the initial hexagonal grid code of the vertex according to the vertex coordinates in the rectangular coordinate system; A local coordinate system is established based on the hexagonal grid where the initial hexagonal grid code is located, and the vertex coordinates in the rectangular coordinate system are converted to the local coordinate system to obtain the vertex coordinates in the local coordinate system; Calculate the vector between the vertex in the local coordinate system and each vertex of the hexagonal grid to obtain the angle between adjacent vectors; The angle sum of adjacent vectors is calculated, and the final hexagonal grid code of the line segment vertex is determined based on the angle sum of adjacent vectors and the vertical coordinate of the vertex in the local coordinate system.

6. The method for automatically generating a war chess board based on a vector map according to claim 5, characterized in that: The calculation process of determining the initial hexagonal grid code of the vertex according to the vertex coordinates in the rectangular coordinate system is as follows: Where (x, y) is the coordinate of the vertex in the rectangular coordinate system; (i', j') is the initial hexagonal grid code of the vertex; floor is the floor symbol; w is the width of the hexagonal grid; h is the height of the hexagonal grid.

7. The method for automatically generating a war chess board based on a vector map according to claim 5, characterized in that: The steps of determining the final hexagonal grid encoding of the line segment vertex according to the angle between the adjacent vectors and the vertical coordinate of the vertex in the local coordinate system include: like but like and but like and but in, is the angle and ε is the set accuracy; y' is the vertical coordinate of the vertex in the local coordinate system; h is the height of the hexagonal grid; (i, j) is the final hexagonal grid code of the vertex; (i', j') is the initial hexagonal grid code of the vertex.

8. The method for automatically generating a war chess board based on a vector map according to claim 1, characterized in that: The following steps for modeling area features are also included: Get the area features in the vector map; Determine the hexagonal grid code through which the boundary of the area element passes; Calculate the intersection area between the surface element and all the hexagonal grids it passes through; If the intersection area between the surface feature and a hexagonal grid is greater than the area threshold, the hexagonal grid will be filled; otherwise, the hexagonal grid will not be filled.

9. The method for automatically generating a war chess board based on a vector map according to claim 8, characterized in that: Intersection area S 相交区域 The calculation process is: Among them, (x1, y1), (x2, y2),…(x6, y6) are the vertex coordinates of the polygon where the surface element intersects a hexagonal grid in the rectangular coordinate system.

Citation Information

Patent Citations

  • Method for modeling terrain property of Wargame map by grid matrix

    CN105045976A

  • Method for acquiring and generating mountain road data of electronic geographic information system

    CN111324601A