Modeling Method of Linear Elements in Regular Hexagonal Grid Based on Sub-Lattice Element Pattern
By using sub-grid mode to model linear elements in a regular hexagonal grid, the contradiction between linear element description accuracy and deduction efficiency is solved, and high-precision linear element expression and efficient spatial analysis are achieved.
Patent Information
- Application Number
- CN202111405780.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-24
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2041-11-24
AI Technical Summary
In a regular hexagonal grid, there is a contradiction between the description accuracy and deduction efficiency of linear elements, and the existing calculation mode and vector mode are each insufficient.
Using a method based on the sub-grid pattern, the regular hexagonal grid is divided to obtain multiple sub-grids, and the linear elements are described and modeled through sub-grid encoding. The specific steps include dividing the regular hexagon into n*n sub-grids, converting the geographical coordinates of the linear elements of the obstacle type into regular hexagon encoding and offset, calculating the sub-grid encoding, and storing the sub-grids of each regular hexagon as integer values.
It realizes high-precision expression of linear elements in the hexagonal grid, supports efficient spatial analysis and deduction calculation, improves the storage efficiency of sub-grid element coding, and is suitable for large-scale high-precision regular hexagonal grid modeling.
Smart Images

Figure CN114282352B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of grid maps, and particularly to a method for modeling linear features in a regular hexagonal grid based on a sub-grid element pattern. Background Art
[0002] According to the influence of linear features in a regular hexagonal grid on human activities, linear features in the natural environment can be divided into two categories, namely obstacle linear features and transportation linear features. The two types of linear features have different impacts on human activities, resulting in different description methods in the regular hexagonal grid. During the construction of a regular hexagonal grid, various methods can be used to model different types of linear features.
[0003] According to the description method of linear features in a regular hexagonal grid, it can be divided into a grid-based regular hexagonal grid and a semi-grid-based regular hexagonal grid. A grid-based regular hexagonal grid refers to a grid map that integrates and fuses all linear features and planar features in the environment into the grid based on a regular hexagonal grid, and simulates the environment through the combination of the grid edges and grid elements of the regular hexagonal grid and their attributes. A typical grid-based regular hexagonal grid map is as shown in Figure 1 shown. A semi-grid-based regular hexagonal grid map refers to a regular hexagonal grid map that integrates and fuses planar features and some linear features in the environment into the grid, and describes the remaining linear features by vectors or other methods. A typical semi-grid-based regular hexagonal grid map is as shown in Figure 2 shown. It can be seen that there are mainly two modes for describing linear features in a regular hexagonal grid: the reduction mode and the vector mode.
[0004] The basic idea of the reduction mode for describing linear environmental features is as follows: reduce obstacle linear features to the grid edges of a regular hexagon, and reduce transportation linear features to the center of a regular hexagon. Through the connection lines of the centers of regular hexagons, combined with the attribute information of the corresponding linear features, the description of linear features is realized. The main characteristics of the reduction mode include: (1) Shift and reduce obstacle linear features such as rivers and cliffs to the grid edges of a regular hexagon. When a human moves from the current regular hexagon to an adjacent regular hexagon and crosses the grid edge, the obstacle features stored on the grid edge will have a blocking effect on the speed of the passing personnel; (2) Shift and reduce transportation linear features such as roads and railways to the center of a regular hexagon, and simulate linear features through the center connection lines. When a human moves from the current regular hexagon to an adjacent regular hexagon, these linear features can be used to increase the mobility speed. Taking a river and a road in the environment as an example, Figure 3 describes the basic principle diagram of the reduction mode for describing linear features.
[0005] The basic idea of the vector mode for describing linear environmental elements is as follows: Use the geographical coordinates of the original linear environmental elements to describe the geographical spatial position of the linear elements, establish the corresponding relationship between the geographical coordinates in the linear elements and the regular hexagon encoding, and combine the relevant attribute information of the linear elements to achieve the description of the linear elements. The main features of the vector mode include: (1) Use vector lines (vector data) to describe obstacle-type and / or transportation-type linear elements; (2) The spatial position of the linear element is consistent with its real spatial position. Taking a river in the environment as an example, Figure 4 It describes the schematic diagram of the vector mode for describing linear elements.
[0006] By comparing and analyzing the reduction mode and the vector mode, it can be found that when using the reduction mode to describe linear elements, displacement processing is required and the spatial accuracy is low, but analysts can make judgments quickly and have a high analysis efficiency; when using the vector mode to describe linear elements, displacement processing is not required and the spatial accuracy is high, but analysts need to use other tools for analysis and the analysis efficiency is low. Summary of the Invention
[0007] In order to better solve the contradiction between the description accuracy and the deduction efficiency of linear elements, the present invention provides a method for modeling linear elements in a regular hexagon grid based on the sub-cell element mode.
[0008] The method for modeling linear elements in a regular hexagon grid based on the sub-cell element mode provided by the present invention includes:
[0009] Step 1: Adopt a subdivision method with an aperture of n*n, subdivide each regular hexagon in the regular hexagon grid corresponding to the set area into several sub-cell elements using a 4n*2n rectangular grid, establish a local rectangular coordinate system XOY for each regular hexagon, and then encode all the sub-cell elements in each regular hexagon; n is a positive integer;
[0010] Step 2: Convert the geographical coordinates of the obstacle-type linear elements in the set area into the corresponding regular hexagon encoding and regular hexagon offset;
[0011] Step 3: Calculate the corresponding sub-cell element encoding according to the regular hexagon encoding and the regular hexagon offset;
[0012] Step 4: If the sub-cell elements where two adjacent points of the linear element are located are not adjacent to each other, calculate the transition sub-cell elements between the two sub-cell elements;
[0013] Step 5: Synthesize the sub-cell element encodings corresponding to the same type of obstacle-type linear elements in the set area, calculate the identifiers of all sub-cell elements in each regular hexagon in units of regular hexagons, and convert them into integer values for storage.
[0014] Further, in step 1, the encoding of all sub-lattice elements in each regular hexagon specifically includes: encoding each sub-lattice element row by row and column by column in the order from top to bottom and from left to right until all the sub-lattice elements obtained by the dissection of the regular hexagon are completely encoded.
[0015] Further, in step 1, when encoding all the sub-lattice elements obtained by the dissection of each regular hexagon, specifically:
[0016] When using a dissection method with an aperture of n*n, the total number of sub-lattice elements dissected in each regular hexagon is m = n*n, and all the sub-lattice elements in each regular hexagon are encoded using integers in the set {0, 1, 2, 3, 4, 5..., m - 2, m - 1}.
[0017] Further, step 3 specifically includes:
[0018] Step 3.1: Calculate the rectangular grid encoding according to the regular hexagon offset using formula (1):
[0019]
[0020] where (X q , Y q ) is the rectangular grid encoding, X_Dis is the interval length of each segment in the horizontal direction after dissection, Y_Dis is the interval length of each segment in the vertical direction after dissection, and (X_Offset, Y_Offset) is the regular hexagon offset;
[0021] Step 3.2: If the rectangle is located within one sub-lattice element, calculate the sub-lattice element encoding where the target point is located using the rectangular grid encoding; if the rectangle is located within two sub-lattice elements simultaneously, calculate the sub-lattice element encoding where the target point is located using the rectangular grid encoding and the regular hexagon offset.
[0022] Further, calculate X_Dis and Y_Dis using formula (2):
[0023]
[0024] Further, if X q % 3 = 1 or 2, then the rectangle is only located within one sub-lattice element;
[0025] Correspondingly, calculating the sub-lattice element encoding where the target point is located using the rectangular grid encoding specifically includes:
[0026] i = X q / 3; if i is odd, that is, the sub-lattice element where the rectangle is located is an odd column, then If i is even, that is, the sub-lattice element where the rectangle is located is an even column, then (i, j) is the row and column numbers of the sub-cell where the target point is located; according to the row and column numbers of the sub-cell and the coding method in step 1, the code of the sub-cell where the target point is located can be obtained.
[0027] Further, if X q % 3 = 0, then the rectangle is simultaneously located in two sub-cells C m and C n ;
[0028] Correspondingly, using the rectangular grid code and the regular hexagon offset, the code of the sub-cell where the target point is located is calculated as follows:
[0029] According to the parity of the values of X q / 3 and Y q , the spatial rectangular coordinates of the center points of sub-cells C m and C n and the row and column numbers of sub-cells C m and C n are calculated respectively according to the corresponding formulas;
[0030] According to the spatial rectangular coordinates of the center points of sub-cells C m and C n and the offsets of the target point P relative to the center point of the regular hexagon in the X-axis and Y-axis directions, calculate the distances L(P, C m and C n ) and L(P, C m ) from the target point P to the center points of the two sub-cells C n ;
[0031] If L(P, C m ) < L(P, C n ), then the target point P is in sub-cell C m ; if L(P, C m ) > L(P, C n ), then the target point P is in sub-cell C n ;
[0032] According to the row and column numbers of the sub-cell where the target point P is located and the coding method in step 1, the code of the sub-cell where the target point P is located can be obtained.
[0033] Further, step 4 specifically includes: respectively recording the two non-adjacent sub-cells where the two adjacent points of the linear feature are located as SubCell_Code1 and SubCell_Code2, then the calculation process of the transitional sub-cells between SubCell_Code1 and SubCell_Code2 includes:
[0034] Step 4.1: Take SubCell_Code1 as the current sub-cell element, calculate the direction angle of the central connection line between the current sub-cell element and the sub-cell element SubCell_Code2, and calculate the adjacent sub-cell elements of the current sub-cell element in the corresponding direction according to the direction angle, denoted as
[0035] Step 4.2: Calculate among the remaining five sub-cell elements of the current sub-cell element, the sub-cell elements adjacent to , and denote them as and
[0036] Step 4.3: Calculate the sum of the distances from and to the center points of the current sub-cell element and SubCell_Code2, and denote them as Dis1, Dis2, and Dis3 respectively;
[0037] Step 4.4: Select the minimum value among Dis1, Dis2, and Dis3. The sub-cell element corresponding to this minimum value is the transition sub-cell element Ci, and record it in the sub-cell element set A;
[0038] Step 4.5: Take Ci as the current sub-cell element, and repeat Steps 4.1 to 4.4 until SubCell_Code2 is the current sub-cell element. At this time, the sub-cell element set A is the transition sub-cell element set between (SubCell_Code1, SubCell_Code2).
[0039] Furthermore, in Step 5, calculating the identifiers of all sub-cell elements in each regular hexagon and converting them into integer values for storage specifically includes:
[0040] Correspond the code of each sub-cell element with the binary value 0 or 1 according to whether there is a linear feature passing through the sub-cell element. This binary value is the identifier of the sub-cell element. Specifically, if the sub-cell element with code i has a linear feature passing through, the identifier of the sub-cell element with code i is 1, otherwise it is 0;
[0041] Statistical identifiers of all sub-cell elements in each regular hexagon, arrange the identifiers of all sub-cell elements in the order of the codes to obtain an m-bit binary number, and convert the m-bit binary number into an integer value for storage.
[0042] Furthermore, the method further includes: when it is necessary to convert the sub-cell element code into the regular hexagon offset, first convert the sub-cell element code into the rectangular grid code (X q , Y q ), and then use formula (10) to calculate the regular hexagon offset (X_Offset, Y_Offset):
[0043]
[0044] Advantages of the present invention:
[0045] Compared with existing methods such as the reduction mode and the vector mode, the method for modeling linear features based on the sub-cell element mode proposed by the present invention can accurately express linear features in a hexagonal grid and can support efficient spatial analysis and deduction calculations based on a regular hexagonal grid, effectively solving the contradiction between the expression accuracy and the deduction efficiency of linear features in a regular hexagonal grid. At the same time, the method proposed by the present invention for storing the identifiers of all sub-cell elements of each regular hexagon using integer values greatly improves the storage efficiency of sub-cell element encoding and can effectively support the modeling of a large-scale and high-precision regular hexagonal grid. Description of the drawings
[0046] Figure 1 Schematic diagram of a gridded regular hexagonal grid map in the prior art;
[0047] Figure 2 Schematic diagram of a semi-gridded regular hexagonal grid map in the prior art;
[0048] Figure 3 Schematic diagram of the basic principle of describing linear features in the reduction mode;
[0049] Figure 4 Schematic diagram of the basic principle of describing linear features in the vector mode;
[0050] Figure 5 Schematic diagram of the basic principle of describing linear features in the sub-cell element mode provided by the embodiment of the present invention;
[0051] Figure 6 Flowchart of the method for modeling linear features in a regular hexagonal grid based on the sub-cell element mode provided by the embodiment of the present invention;
[0052] Figure 7 Schematic diagram of a local rectangular coordinate system in a regular hexagon provided by the embodiment of the present invention;
[0053] Figure 8 Schematic diagram of the one-dimensional row-column sequence encoding principle of regular hexagon sub-cell elements provided by the embodiment of the present invention;
[0054] Figure 9 Flowchart of the conversion between sub-cell element encoding and longitude-latitude coordinates provided by the embodiment of the present invention;
[0055] Figure 10 Schematic diagram of encoding conversion when a rectangle is located in two sub-cell elements provided by the embodiment of the present invention;
[0056] Figure 11A basic principle diagram of calculating transition sub-cells provided by an embodiment of the present invention;
[0057] Figure 12 A basic flow chart of sub-cell space distance calculation provided by an embodiment of the present invention;
[0058] Figure 13 A basic principle diagram of storage sub-cell element encoding provided by an embodiment of the present invention;
[0059] Figure 14 A maximum position deviation variation trend diagram corresponding to different apertures provided in an embodiment of the present invention;
[0060] Figure 15 A distribution diagram of the center points of the sub-lattice elements of each aperture subdivision mode provided in an embodiment of the present invention in a regular hexagon;
[0061] Figure 16 A local effect diagram of modeling of sub-grid element patterns corresponding to each subdivision provided in an embodiment of the present invention;
[0062] Figure 17 A graph showing the changing trend of the storage space occupied by the sub-lattice element patterns in various partitioning methods provided in the embodiments of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] In order to better understand the present invention, the professional term "sub-grid element mode" involved in the present invention is first introduced below. The basic idea of using the sub-grid element mode to describe linear elements is: divide the regular hexagons in the regular hexagonal grid to obtain multiple sub-grid elements of smaller size, and mark the sub-grid elements that the linear element passes through, and use the corresponding sub-grid element code set and its attributes to describe the linear element. Take the river in the environment as an example, Figure 5 A schematic diagram describing the principle of using sub-grid element patterns to describe linear features.
[0065] like Figure 6 As shown, an embodiment of the present invention provides a method for modeling linear elements in a regular hexagonal grid based on a sub-grid element mode, which specifically includes the following steps:
[0066] S101: Use a dissection method with an aperture of n*n to dissect each regular hexagon in the regular hexagon grid corresponding to the set area with a 4n*2n rectangular grid to obtain a number of sub-cell elements (as shown in Figure 6 ), and establish a local rectangular coordinate system XOY for each regular hexagon, and then encode all the sub-cell elements in each regular hexagon; n is a positive integer;
[0067] As an implementable way, taking the center O of the regular hexagon as the coordinate origin, and the right and upward directions as the positive directions of the X-axis and Y-axis respectively, a local rectangular coordinate system XOY can be constructed, as shown in Figure 7 .
[0068] The selection of the sub-cell element encoding method in the regular hexagon is mainly affected by three factors: encoding operation efficiency, encoding storage efficiency, and coordinate conversion efficiency. If a two-dimensional encoding mechanism similar to the regular hexagon network is used to record the index values of the sub-cell elements in the horizontal and vertical directions, a large amount of storage space needs to be occupied when using the sub-cell element encoding to describe linear features, and storage space redundancy will be caused. Different from the global discrete grid system, the dissection method of the sub-cell elements in the regular hexagon grid is fixed, and there are only sub-cell elements with a single resolution. Therefore, the embodiment of the present invention proposes a row-column sequence encoding method to identify the sub-cell elements.
[0069] The principle of using the row-column sequence encoding method to identify the sub-cell elements is: encode each sub-cell element row by row and column by column in the order from top to bottom and from left to right until all the sub-cell elements obtained by dissecting the regular hexagon are encoded. As shown in Figure 8 .
[0070] As an implementable way, when encoding all the sub-cell elements obtained by dissecting each regular hexagon, specifically: when using a dissection method with an aperture of n*n, the total number of sub-cell elements dissected in each regular hexagon is m = n*n, and all the sub-cell elements in each regular hexagon are encoded with integers in the set {0, 1, 2, 3, 4, 5..., m - 2, m - 1}.
[0071] S102: Convert the geographical coordinates (Latitude, Longitude) of the obstacle linear feature in the set area into the corresponding regular hexagon code and regular hexagon offset (X_Index, Y_Index, X_Offset, Y_Offset);
[0072] S103: Calculate the corresponding sub-cell element code (X_Index, Y_Index, SubCell_Code) according to the regular hexagon code and the regular hexagon offset (X_Index, Y_Index, X_Offset, Y_Offset);
[0073] Specifically, since the sub-grid element encoding is for the local coordinate system of a regular hexagon, when converting the sub-grid element encoding to and from the longitude and latitude coordinates, an indirect conversion needs to be performed through the mediation of the regular hexagon encoding (X_Index, Y_Index) and the offset (X_Offset, Y_Offset). The basic process is as follows Figure 9 shown.
[0074] Since the sub-grid element encoding is based on the local rectangular coordinate system of a regular hexagon, it has nothing to do with the specific regular hexagon encoding (X_Index, Y_Index), but only with the regular hexagon offset (X_Offset, Y_Offset). The conversion between the two is essentially the conversion between the sub-grid element encoding and the regular hexagon offset. Figure 6 There is an inherent connection between the encoding of the rectangular grid and the encoding of the sub-grid element in the figure. It is necessary to convert the regular hexagon offset to the rectangular grid encoding and then further convert it to the sub-grid element encoding.
[0075] As an implementable manner, this step specifically includes the following sub-steps:
[0076] S1031: Calculate the rectangular grid encoding according to the regular hexagon offset using formula (1):
[0077]
[0078] where, (X q , Y q ) is the rectangular grid encoding, X_Dis is the interval length of each segment in the horizontal direction after subdivision, Y_Dis is the interval length of each segment in the vertical direction after subdivision, and (X_Offset, Y_Offset) is the regular hexagon offset;
[0079] where, on the basis of using a subdivision method with an aperture of n*n to subdivide each regular hexagon in the regular hexagon grid corresponding to the set area with a 4n*2n rectangular grid, formula (2) is used to calculate X_Dis and Y_Dis in formula (1):
[0080]
[0081] On this basis, when i is odd, formula (3) is used to calculate the vertex coordinates of the sub-grid element in the i-th column and the j-th row {(x 1 , y 1 ), (x 2 , y 2 ), (x 3 , y 3 ), (x 4 , y 4 ), (x 5 , y5 ),( x 6 , y 6 )}:
[0082]
[0083] When \(i\) is even, use formula (4) to calculate the vertex coordinates of the sub - grid element at the \(i\) - th column and \(j\) - th row \(\{(x 1 , y 1 ), (x 2 , y 2 ), (x 3 , y 3 ), (x 4 , y 4 ), (x 5 , y 5 ), (x 6 , y 6 )}:
[0084]
[0085] After calculating the vertex coordinates of the sub - grid element, a large regular hexagon can be subdivided into several small regular - hexagon sub - grid elements, thus establishing a spatial reference for linear feature modeling based on the sub - grid element pattern.
[0086] S1032: If the rectangle is within one sub - grid element, use the rectangle grid encoding to calculate the sub - grid element code where the target point is located; if the rectangle is within two sub - grid elements at the same time, use the rectangle grid encoding and the regular - hexagon offset to calculate the sub - grid element code where the target point is located.
[0087] As Figure 7 shown, let the rectangle grid encoding be \((X q , Y q )\), corresponding to the sub - grid element at the \(i\) - th column and \(j\) - th row.
[0088] As an implementable way, if \(X q \% 3 = 0\), then the rectangle is within two sub - grid elements at the same time (such as the filled rectangle in Figure 10 ); if \(X q \% 3 = 1\) or \(2\), then the rectangle is only within one sub - grid element (such as the unfilled rectangle in Figure 10 ).
[0089] As an implementable way, when the rectangle is only within one sub - grid element, the calculation process of the sub - grid element code where the target point is located is as follows:
[0090] i = X q / 3; if \(i\) is odd, that is, the sub - grid element where the rectangle is located is an odd - numbered column, then If i is even, that is, the sub-cell where the rectangle is located is in an even column, then
[0091] According to the row and column numbers (i, j) of the sub-cell, combined with the row-column sequence coding method (as Figure 8 shown), the code of the sub-cell can be obtained.
[0092] When the rectangle is located in two sub-cells at the same time (such as Figure 10 P in 1 and P 2 shown), according to the positional relationship between the grid edge and the rectangle, it can be divided into two cases: the grid edge divides the rectangle in the "upper left - lower right" direction ( Figure 10 the rectangle where P 1 is located), the grid edge divides the rectangle in the "lower left - upper right" direction ( Figure 10 the rectangle where P 2 is located).
[0093] For the above two cases, according to the distances from the target point to the centers of the two sub-cells spanned by the rectangle, the sub-cell where the target point is located can be determined. The basic mathematical principle is: in a regular hexagonal grid, the distance from any point in a regular hexagon to its center is less than the distance from this point to the centers of other regular hexagons.
[0094] Based on the above mathematical principle, as an implementable manner, when the rectangle is located in two sub-cells C m and C n at the same time, the calculation process of the code of the sub-cell where the target point P is located is as follows:
[0095] If X q / 3 is odd and Y q is odd, then calculate according to formula (5):
[0096]
[0097] If X q / 3 is odd and Y q is even, then calculate according to formula (6):
[0098]
[0099] If X q / 3 is even and Y q is odd, then calculate according to formula (7):
[0100]
[0101] If X q / 3 is even and Y q is even, then calculate according to formula (8):
[0102]
[0103] Among them, (X Cm , Y Cm ) is the spatial rectangular coordinate of the center point of the sub-cell C m , (X Cn , Y Cn ) is the spatial rectangular coordinate of the center point of the sub-cell C n , (i Cm , j Cm ) is the row and column number of the sub-cell C m , (i Cn , j Cn ) is the row and column number of the sub-cell C n .
[0104] Next, according to the spatial rectangular coordinates of the center points of the sub-cells C m and C n , and the offsets (X_Offset_P, Y_Offset_P) of the target point P relative to the center point of the regular hexagon in the X-axis and Y-axis directions, calculate the distances L(P, C m ) and L(P, C n ) from the target point P to the center points of the two sub-cells C m and C n according to formula (9):
[0105]
[0106] If L(P, C m ) < L(P, C n ), then the target point P is in the sub-cell C m , and the row and column number of the sub-cell is (i Cm , j Cm ). If L(P, C m ) > L(P, C n ), then the target point P is in the sub-cell C n , and the row and column number of the sub-cell is (i Cn , j Cn ).
[0107] For example, as Figure 10 shown, for the point P 1 , if L(P 1 , C 1 ) < L(P 1 , C 3 ), then the sub-cell where P 1 is located is C 1 , otherwise the sub-cell where P 1 is located is C 3. Similarly, for point P 2 , if L(P 2 , C 2 ) < L(P 2 , C 3 ), then the grid cell where P 2 is located is C 2 , otherwise the grid cell where P 2 is located is C 3 .
[0108] Finally, according to the row and column numbers where the sub-grid cell is located, combined with the row and column sequence coding method (as shown in Figure 8 ), the code of the sub-grid cell can be obtained.
[0109] It should be noted that when converting the sub-grid cell code to the regular hexagon offset, first the sub-grid cell code needs to be converted to the rectangular grid code (X q , Y q ), and then the regular hexagon offset (X_Offset, Y_Offset) can be calculated using formula (10).
[0110]
[0111] S104: If the sub-grid cells where two adjacent points of the linear feature are located are not adjacent to each other, then calculate the transitional sub-grid cells between the two sub-grid cells;
[0112] Specifically, the two non-adjacent sub-grid cells where two adjacent points of the linear feature are located are respectively denoted as SubCell_Code1 and SubCell_Code2, and the calculation process of the transitional sub-grid cells between SubCell_Code1 and SubCell_Code2 includes the following sub-steps:
[0113] S1041: Take SubCell_Code1 as the current sub-grid cell, calculate the direction angle of the line connecting the centers of the current sub-grid cell and the sub-grid cell SubCell_Code2, and calculate the adjacent sub-grid cell of the current sub-grid cell in the corresponding direction according to the direction angle, denoted as SubCell_Code 1 1 ;
[0114] S1042: Calculate the sub-grid cells adjacent to SubCell_Code 1 1 among the remaining five sub-grid cells of the current sub-grid cell, and are respectively denoted as SubCell_Code 1 2 and SubCell_Code 1 3 ;
[0115] S1043: Calculate SubCell_Code separately 1 1 、SubCell_Code 1 2 and SubCell_Code 1 3 to the sum of the distances from the center points of the current sub-cell element and SubCell_Code2, denoted as Dis1, Dis2, and Dis3 respectively;
[0116] S1044: Select the minimum value among Dis1, Dis2, and Dis3. The sub-cell element corresponding to this minimum value is the transition sub-cell element Ci, and record it in the sub-cell element set A;
[0117] S1045: Take Ci as the current sub-cell element, and repeat steps S1041 to S1044 until SubCell_Code2 is the current sub-cell element. At this time, the sub-cell element set A is the transition sub-cell element set between (SubCell_Code1, SubCell_Code2).
[0118] For example, as Figure 11 shown, let C1 and C2 be the starting and ending sub-cell elements respectively, C i be the current sub-cell element, C i 1 、C i 2 and C i 3 be three adjacent sub-cell elements in the forward direction from C1 to C2. The sum of the distances from these three sub-cell elements to C1 and C2 can be calculated using formula (11).
[0119]
[0120] If Dis1 is the minimum value among {Dis1, Dis2, Dis3}, then is the interval sub-cell element and can be set as the current sub-cell element for the next judgment. Otherwise or is the transition sub-cell element.
[0121] In formula (11), Dis[A, B] can be calculated using formula (12):
[0122]
[0123] Among them, (X_Index_A, Y_Index_A, X_Offset_A, Y_Offset_A) is the regular hexagon code and offset corresponding to sub-cell A; (X_Index_B, Y_Index_B, X_Offset_B, Y_Offset_B) is the regular hexagon code and offset corresponding to sub-cell B.
[0124] It should be noted that the spatial operation of sub-cells in a regular hexagon grid is mainly the spatial distance operation, that is, the spatial distance is calculated according to the sub-cell code. Since the sub-cell code is a one-dimensional code, it needs to be converted into a regular hexagon code and offset before the spatial distance operation can be carried out. The process is as Figure 12 shown.
[0125] S105: Synthesize the sub-cell codes corresponding to the same type of obstacle linear elements within the set area, calculate the identifiers of all sub-cells in each regular hexagon as a unit, and convert them into integer values for storage.
[0126] During the storage process, if the codes of all sub-cells in each regular hexagon are directly stored, the codes of all sub-cells within the entire set area will occupy a huge storage space. To solve this technical problem, the embodiment of the present invention proposes to store the sub-cell codes by the "integer synthesis method", that is, the code of each sub-cell in a regular hexagon corresponds to a binary number, and then the m-bit binary number is converted into [m / 32] integer values for storage.
[0127] As an implementable manner, on the basis that all sub-cells in each regular hexagon are encoded with integers in the set {0, 1, 2, 3, 4, 5..., m-2, m-1}, according to whether there is a linear element passing through the sub-cell, the code of each sub-cell is corresponded to the binary value 0 or 1, and this binary value is the identifier of the sub-cell. Specifically: if the sub-cell with code i has a linear element passing through, the identifier of the sub-cell with code i is 1, otherwise it is 0; count the identifiers of all sub-cells in each regular hexagon, arrange the identifiers of all sub-cells in the coding order to obtain an m-bit binary number, and store the m-bit binary number after converting it into [m / 32] integer values. As Figure 13 shown. It should be noted that when reading the sub-cell code, it is necessary to arrange the integer values in the reverse order of the order shown in Figure 13 to convert them into an arrangement of m binary values and establish an association with the m sub-cell codes in the regular hexagon.
[0128] In order to verify the effectiveness and practicality of the linear element modeling method provided by the present invention, the present invention also provides the following experimental data to analyze the related technologies of sub-cell pattern modeling.
[0129] To maintain the consistency between the regular hexagon and the orientation of the sub-cell elements, when selecting the dissection aperture, only the dissection methods with apertures of 4, 9, and their products can be chosen. If the dissection aperture is too small, it is difficult to meet the need for the spatial accuracy of the description of linear elements; if the dissection aperture is too large, the linear element model will occupy a large amount of storage and computing resources, reducing the efficiency of deduction. Therefore, in this experiment, six dissection methods with apertures of 64, 81, 144, 256, 324, and 576 were selected to dissect the regular hexagon, and a comparative analysis of these six sub-cell element patterns was carried out from three aspects: modeling accuracy, modeling efficiency, and storage efficiency.
[0130] (1) Modeling accuracy analysis
[0131] To be able to analyze the accuracy change trend of the sub-cell element pattern as a whole, this experiment calculated the spatial position accuracy corresponding to various aperture dissection methods, as shown in Table 1. The change trend of the maximum position offset corresponding to different apertures is as Figure 14 shown.
[0132] Table 1 Modeling accuracy of sub-cell element patterns corresponding to each dissection method
[0133] Subdivision method Sub-cell element size ratio Corresponding size for 7.5 km Maximum position offset No subdivision 1 7.5 km 3.25 km Aperture 64 1 / 8 937.5m 833.3m Aperture 81 1 / 9 833.3m 625.0m Aperture 144 1 / 12 625.0m 468.75m Aperture 256 1 / 16 468.75m 416.67m Aperture 324 1 / 18 416.67m 312.5m Aperture 576 1 / 24 312.5m 156.25m
[0134] It can be seen that the larger the aperture dissection, the smaller the corresponding sub-cell element size, the smaller the maximum position offset, and the higher the modeling accuracy, and vice versa. However, as the dissection aperture continues to increase, the decreasing trend of the corresponding maximum position offset slows down, and it is meaningless to increase the dissection aperture without limit.
[0135] (2) Modeling efficiency analysis
[0136] Through the mutual conversion between the sub-cell element coding and the regular hexagon offset corresponding to the six dissection methods, an experimental analysis of the sub-cell element coordinate conversion efficiency was carried out. For any point in the regular hexagon, the forward and reverse conversion times of its corresponding sub-cell element coding and the regular hexagon offset are shown in Table 2.
[0137] Table 2 Sub-cell element coordinate conversion time corresponding to each dissection method
[0138] Subdivision method Forward conversion time (ms) Inverse conversion time (ms) Aperture 64 4.507929e-4 5.596792e-4 Aperture 81 4.404992e-4 5.385486e-4 Aperture 144 4.429912e-4 4.849233e-4 Aperture 256 4.491365e-4 4.896381e-4 Aperture 324 4.396664e-4 5.014093e-4 Aperture 576 4.516841e-4 4.871945e-4
[0139] The distribution of the sub-cell element center points corresponding to the six dissection methods with apertures of 64, 81, 144, 256, 324, and 576 in the regular hexagon is respectively as Figure 15 (a), (b), (c), (d), (e), (f) shown.
[0140] Using linear experimental data, modeling is carried out using the sub-cell element model, and the modeling times corresponding to six dissection methods are compared and analyzed, so as to evaluate the modeling efficiency of the sub-cell element model. Table 3 describes various input parameter values in the linear feature modeling experiment. Table 4 describes the modeling experiment results corresponding to various dissection methods.
[0141] Table 3 Parameter values of the sub-cell element model for linear feature modeling
[0142]
[0143] Table 4 Modeling time corresponding to various dissection methods
[0144] Subdivision method Modeling time (s) Total number of sub-cell elements Aperture 64 5.7041637 15,351 Aperture 81 6.0151362 15,849 Aperture 144 6.1090374 16,880 Aperture 256 28.369085 18,176 Aperture 324 41.153849 21,853 Aperture 576 73.032216 25,222
[0145] The local effects of the sub-cell element model corresponding to six dissection methods with pore sizes of 64, 81, 144, 256, 324, and 576 are as Figure 16 (a), (b), (c), (d), (e), and (f) shown.
[0146] 6.4.3 Storage efficiency analysis
[0147] In a 500*500 regular hexagonal grid (the distance between opposite sides of the regular hexagon is 5 kilometers), the "integer integration method" is used to store five linear features described by the sub-cell element model, and the computer storage space occupied by various dissection methods can be calculated, as shown in Table 5. Using different dissection methods, the changing trend of the computer storage space occupied by the linear features described by the sub-cell element model is as Figure 17 shown.
[0148] Table 5 Storage space of obstacle linear features corresponding to various dissection methods
[0149] Subdivision method Storage space (Bytes) Aperture 64 10,546,080 Aperture 81 15,819,120 Aperture 144 26,365,200 Aperture 256 42,184,320 Aperture 324 58,003,440 Aperture 576 94,914,720
[0150] It can be seen from the experimental results that the sub-cell element model can greatly improve the simulation accuracy of linear features. As the dissection pore size continues to increase, its maximum position offset continues to decrease, that is, the spatial accuracy continues to improve, but the modeling efficiency and storage efficiency of linear features decrease sharply, and vice versa. Therefore, considering comprehensively from the three aspects of modeling accuracy, modeling efficiency, and storage efficiency, the best dissection method can be selected as the 256-pore-size dissection for the sub-cell element model simulation of linear features.
[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for modeling linear features in a regular hexagonal grid based on a sub-cell element pattern, characterized in that, it includes: Step 1: Adopt a dissection method with an aperture of n*n, dissect each regular hexagon in the regular hexagonal grid corresponding to the set area with a 4n*2n rectangular grid to obtain a number of sub-cell elements, and establish a local rectangular coordinate system XOY for each regular hexagon. Then, encode all the sub-cell elements in each regular hexagon; n is a positive integer; Step 2: Convert the geographical coordinates of the obstacle linear features in the set area into corresponding regular hexagon codes and regular hexagon offsets; Step 3: Calculate the corresponding sub-cell element code according to the regular hexagon code and the regular hexagon offset; specifically including: Step 3.1: Calculate the rectangular grid code according to the regular hexagon offset using formula (1): Among them, (X q , Y q ) is the rectangular grid code, X_Dis is the interval length of each segment in the horizontal direction after subdivision, Y_Dis is the interval length of each segment in the vertical direction after subdivision, and (X_Offset, Y_Offset) is the regular hexagon offset; Calculate X_Dis and Y_Dis using formula (2): Step 3.2: If the rectangle is within one sub-cell element, calculate the sub-cell element code where the target point is located using the rectangular grid code; if the rectangle is within two sub-cell elements at the same time, calculate the sub-cell element code where the target point is located using the rectangular grid code and the regular hexagon offset; Step 4: If the sub-cell elements where two adjacent points of the linear feature are located are not adjacent to each other, calculate the transitional sub-cell elements between the two sub-cell elements; specifically including: Denote the two non-adjacent sub-cell elements where two adjacent points of the linear feature are located as SubCell_Code1 and SubCell_Code2 respectively. Then, the calculation process of the transitional sub-cell elements between SubCell_Code1 and SubCell_Code2 includes: Step 4.1: Take SubCell_Code1 as the current sub-cell element, calculate the direction angle of the central connection line between the current sub-cell element and the sub-cell element SubCell_Code2, and calculate the adjacent sub-cell elements of the current sub-cell element in the corresponding direction according to the direction angle, denoted as Step 4.2: Calculate, among the remaining five sub-cell elements of the current sub-cell element, the sub-cell elements adjacent to and denote them respectively as and Step 4.3: Calculate respectively and the sum of the distances to the center points of the current sub-cell and SubCell_Code2, denoted as Dis1, Dis2, and Dis3 respectively; Step 4.4: Select the minimum value among Dis1, Dis2, and Dis3. The sub-cell element corresponding to this minimum value is the transitional sub-cell element Ci, and record it in the sub-cell element set A; Step 4.5: Take Ci as the current sub-cell element, and repeat steps 4.1 to 4.4 until SubCell_Code2 is the current sub-cell element. At this time, the sub-cell element set A is the transitional sub-cell element set between (SubCell_Code1, SubCell_Code2); Step 5: Synthesize the sub-cell element codes corresponding to the same type of obstacle linear features in the set area. Taking the regular hexagon as a unit, calculate the identifiers of all sub-cell elements in each regular hexagon, and convert them into integer values for storage.
2. The method for modeling linear features in a regular hexagonal grid based on a sub-cell element pattern according to claim 1, characterized in that, in Step 1, the encoding of all sub-cell elements in each regular hexagon specifically includes: Encoding each sub-cell element row by row and column by column in the order from top to bottom and from left to right until all the sub-cell elements obtained by dissecting the regular hexagon are encoded.
3. According to the method for modeling linear features in a regular hexagonal grid based on a sub-cell element pattern described in claim 2, in Step 1, when encoding all the sub-cell elements obtained by dissecting each regular hexagon, specifically: When using the subdivision method with an aperture of n*n, the total number of sub-grid elements divided in each regular hexagon is m = n*n, and all sub-grid elements in each regular hexagon are encoded with integers in the set {0, 1, 2, 3, 4, 5..., m - 2, m - 1}.
4. The method for modeling linear elements in a regular hexagon grid based on sub-grid element patterns according to claim 1, characterized in that, If X q % 3 = 1 or 2, then the rectangle is only located in one sub-cell element; correspondingly, the sub-grid element code where the target point is located is calculated using the rectangular grid code, specifically: i = X q / 3; If i is odd, that is, the sub-cell where the rectangle is located is an odd-numbered column, then If i is even, that is, the sub-cell where the rectangle is located is an even-numbered column, then (i, j) is the row and column numbers of the sub-cell where the target point is located; According to the row and column numbers of the sub-cell, combined with the encoding method in step 1, the encoding of the sub-cell where the target point is located can be obtained.
5. The method for modeling linear elements in a regular hexagon grid based on sub-grid element patterns according to claim 1, characterized in that, If X q % 3 = 0, then the rectangle is located in both sub-cell C m and C n inside; correspondingly, the sub-grid element code where the target point is located is calculated using the rectangular grid code and the regular hexagon offset, specifically: According to X q / 3 and Y q Based on the parity of the numerical values, calculate the sub-cell elements C m and C n respectively according to the corresponding formulas, and obtain the spatial rectangular coordinates of the center point and the row and column numbers of the sub-cell elements C m and C n ; According to the sub-lattice element C m and C n the spatial rectangular coordinates of the center point and the offsets of the target point P relative to the center point of the regular hexagon in the X-axis and Y-axis directions, calculate the distances L(P, C m and C n ) and L(P, C m ) from the target point P to the center points of the two sub-lattice elements C n ); If L(P, C m ) < L(P, C n ), then the target point P is in the sub-lattice element C m ; if L(P, C m ) > L(P, C n ), then the target point P is in the sub-lattice element C n ; According to the row and column numbers of the sub-grid element where the target point P is located, combined with the coding method in step 1, the sub-grid element code where the target point P is located can be obtained.
6. The method for modeling linear elements in a regular hexagon grid based on sub-grid element patterns according to claim 2 or 3, characterized in that, in step 5, calculating the identifiers of all sub-grid elements in each regular hexagon and converting them into integer values for storage, specifically: Corresponding the code of each sub-grid element with the binary value 0 or 1 according to whether there is a linear element passing through the sub-grid element. This binary value is the identifier of the sub-grid element. Specifically: if the sub-grid element with code i has a linear element passing through, the identifier of the sub-grid element with code i is 1, otherwise it is 0; Count the identifiers of all sub-grid elements in each regular hexagon, arrange the identifiers of all sub-grid elements in the coding order to obtain an m-bit binary number, and convert the m-bit binary number into an integer value for storage.
7. The method for modeling linear elements in a regular hexagon grid based on sub-grid element patterns according to claim 1, characterized in that, further comprising: When converting the sub-grid element code to the regular hexagon offset, first convert the sub-grid element code to the rectangular grid code (X q , Y q ), and then use formula (10) to calculate the regular hexagon offset (X_Offset, Y_Offset):
Citation Information
Patent Citations
Radio transmission system, radio communication apparatus, and radio transmission method
CN102045137A
Hierarchical coding, operation and indexing method for hexagonal grid with aperture of 4
CN102281075A