A method for automatically generating a road network of an indoor map based on a cross pattern grid

By generating indoor map road networks through a multi-stage thinning method based on a grid, the problems of long generation cycle and low reusability in existing technologies are solved, and efficient and low-cost indoor map road network generation is achieved.

CN116433796BActive Publication Date: 2026-03-20SOUTHEAST UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2026-03-20

Smart Images

  • Figure CN116433796B_ABST
    Figure CN116433796B_ABST
Patent Text Reader

Abstract

The application provides a method for automatically generating a road network of an indoor map based on a rice character grid map, and the basic principle is to form a road network map by repeatedly thinning the embedded rice character grid of the map. The method is mainly used to solve how to generate a road network of an indoor map in the case that the geometric information of the indoor map cannot be extracted. The main indoor steps are as follows: 1. generating a rice character grid map of the map; 2. performing Delaunay triangulation on the map to divide the map into triangular facets; 3. performing connection processing on the generated triangular facets to form a map skeleton; 4. thinning the rice character grid map generated in the first step according to the map skeleton as a reference, and only leaving path segments similar in direction and close in position to the map skeleton; 5. performing path planning according to the triangular facet centroid set obtained in the second step, and performing secondary thinning according to certain rules; and 6. saving the final result to a database and a file.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of map, and particularly relates to an indoor map road network automatic generation method based on a cross grid. BACKGROUND

[0002] With the development of information technology, indoor positioning information and navigation algorithm become more and more important, and a navigation system needs to be realized based on a traditional map road network. Considering technical problems, many navigation algorithms are based on a manually generated map road network, and the method has obvious shortcomings, such as a long production cycle, waste of a large amount of human resources, and low reuse of a customized map road network map. Each added map needs to be generated. In order to solve the problem, some road network automatic generation methods are proposed, such as a method of generating a map skeleton based on distance transformation. However, the existing methods cannot generate a road network without knowing the entrance and exit information of each room of a map, and cannot process a too complex map structure. The present application generates a road network through a map structure. The structure presented by an existing map data file is a structure based on polygon splicing, which is a polygon set without area and connection information, and only has coordinate information of each polygon.

[0003] The prior art is as follows:

[0004] Application No. 201510253566.X, a road network model automatic generation method, proposes a road network model automatic generation method, which comprises the following steps: S1, reading in Shapefile file data: reading position information contained in the Shapefile file, and exporting a set of end points Pi and line segments Li; S2, intersection determination: finding one end point Pi of the line segment Li and three points closest to Pi in the exported line segment Li set, fitting a plurality of ellipses according to the coordinates of the four points, wherein the ellipse with the smallest distance d to the point Pi+3 is the fitting ellipse, and determining the intersection as a four-way intersection or a non-four-way intersection according to the long axis, short axis and long axis threshold value theta ai and short axis threshold value theta bi of the fitting ellipse; S3, road connection: connecting the point set constituting the road into a smooth curve to obtain a vector model of the road. The application determines the intersection by the line exported from the Shapefile file, obtains the vector model of the road, and effectively uses it for map display, path search and traffic simulation.

[0005] The method needs to determine the multi-intersection according to the point coordinate in the shp file of the map, and needs to connect the discrete road. The method combines the map grid and the map skeleton, after getting the data in the shp file, the area of the map is abstracted into multiple deformations, and is divided into passable area and impassable area, and after paving the grid, it is thinned, without any geometric judgment of the map structure, the road network reflecting the topological relationship of the map can be generated. And the generated road network map is a connected structure, without road connection.

[0006] Application number: 201811070675.8, application name a method for automatically generating double-line road network from GIS single-line road network, including the following steps: 1) obtaining GIS road data of single-line road network model, including node layer and road network layer data, and judging intersection type and road type according to intersection position and road position; 2) determining the offset direction of road network node and calculating the offset, forming the road boundary of double-line road network, and generating the offset node of road network node; 3) curve interpolation is carried out on the offset node to represent the driving path of vehicle at road network node, and finally double-line road network is generated. Compared with the prior art, the application has the advantages of low cost, short cycle, and is suitable for road map with low precision requirement.

[0007] The application must obtain the single-line road network of the map in advance, and generate the double-line road network according to the structure of the single-line road network. The invention needs to judge the intersection type and calculate the offset, and is suitable for outdoor map with low precision. The method does not need to obtain the information of single-line road network and does not need to judge the intersection type, only needs to obtain the area structure of the map, and the error threshold is in the controllable range (related to the grid size of the map grid map), which can be used for indoor map with high precision requirement.

[0008] Application number: 201710098103.X, application name a method for automatically constructing indoor map generation of road network, the method for automatically constructing indoor map generation of road network includes the steps of taking point, slope calculation, key point determination, route calculation, road network construction and the like. The method for automatically constructing indoor map generation of road network provided by the application solves the technical problems of large investment, complicated implementation and inconvenient dynamic modification of the existing map road network construction technology.

[0009] The application selects a passable area map, generates a ring point set along the boundary thereof, and simultaneously needs to perform slope calculation and judgment of the sparsity of each point, thereby forming a local road network. This method can only be used for a simple structure and a small area of an independent indoor area (for example, an independent room), is not suitable for a large indoor map structure composed of a plurality of independent areas, and needs to perform some complex set operations. The method regards all passable areas as a whole, whether a tiled grid or a map skeleton is connected, so that the road network generated by the last thinning is also connected, can connect a plurality of independent areas, and forms a large overall road network model, and the process does not involve geometric operation problems such as slope calculation and judgment of the density of points.

[0010] The patent provides a road network generation method by generating a dense cross-shaped grid map and thinning the dense grid map according to a map skeleton. SUMMARY

[0011] In order to solve the above problems, the application provides an indoor map road network automatic generation method based on a cross-shaped grid.

[0012] To achieve the above object, the technical scheme adopted by the application is:

[0013] An indoor map road network automatic generation method based on a cross-shaped grid, and the specific steps are as follows:

[0014] Step 1: Obtain specific two-dimensional vector data of a target indoor map and process the data;

[0015] Step 1 is specifically as follows:

[0016] The area structure data of the indoor map is loaded into the memory through a map file loading mode;

[0017] The data includes:

[0018] The area range of the whole indoor map, that is, the coordinates of the outer frame of the map;

[0019] The coordinate data of each independent area in the map, and the type thereof, the area is divided into a passable area and an impassable area;

[0020] The coordinates of the ladder nodes on the map;

[0021] Step 2: Establish a cross-shaped grid according to the internal structure of the map;

[0022] Step 2 is specifically as follows:

[0023] According to the indoor area size of the map, a certain size interval Δd is set, and the interval Δd is not more than 1 meter, the map boundary line is obtained, the points with the interval Δd on the discrete and uniform paving in the passable area inside the polygon surrounded by the map boundary line, and each point connects 8 directions with the nearest point to itself to form 8 paths. After all the points complete the operation, the grid map of the map is obtained;

[0024] Step 3: Establish a triangular grid;

[0025] Step 3 is specifically as follows:

[0026] Obtain the coordinates of all the impassable areas of the map, and put them into a list to form a point set, and form a Delauny triangular grid based on the point set, and traverse all the triangles, and delete the triangles inside or intersecting with the impassable areas;

[0027] Step 4: generating the basic skeleton map of the map according to the triangular grid map obtained in step three;

[0028] Step 5: performing preliminary thinning on the cross-shaped grid obtained in step 2 according to the basic skeleton obtained in step 4;

[0029] Step 6: performing second thinning on the cross-shaped grid obtained in step 5 according to the triangular grid obtained in step 3;

[0030] Step 7: merging the path segments with shorter lengths in the road network map obtained in step 6;

[0031] Step 8: saving the road network of the map obtained in step 7 in a database and a file.

[0032] As a further improvement of the application, step 4 is specifically as follows:

[0033] If two triangles share an edge, the edge is called a common edge, and all the triangles are divided into three categories according to the number of common edges: a triangle with one common edge, a triangle with two common edges, and a triangle with three common edges;

[0034] For the first type of triangle, the midpoint of the common edge and the vertex opposite to the common edge are connected;

[0035] For the second type of triangle, the midpoints of the two common edges are connected;

[0036] For the third type of triangle, the centroid of the triangle and the midpoints of the three edges of the triangle are connected;

[0037] After all the triangles are connected according to the above rules, the basic skeleton of the map can be obtained.

[0038] As a further improvement to the present invention, step 5 is as follows:

[0039] Traverse each path segment of the grid, let the current path segment be L, use L as the comparison object to traverse each path of the skeleton graph obtained in step 4, and decide whether to keep L according to the following rules.

[0040] Let S be the path currently traversed in the skeleton graph, and P(x, y) be the midpoint of line segment L. Find the shortest distance dist from P to S. min Let P'(x',y') be the projection of point P onto the line segment S, and let the coordinates of the two endpoints of S be (x1,y1) and (x2,y2). Then, find dist. min The formula is:

[0041]

[0042] If dist min If Δd is less than 0, then L is retained. If no path matching the above conditions is found after traversing all paths in the skeleton graph, then L is deleted.

[0043] As a further improvement to the present invention, step 6 is as follows:

[0044] The set of centroids (C1, C2, ..., C3) of the triangular lattice obtained in step 3 is obtained. n Using the road network map G obtained in step 5 as a reference, path planning is performed for any two points in the centroid set, as follows:

[0045] Suppose we want to find the shortest path from Ci to Cj. In graph G, find the vertex Ci' that is closest to Ci and the vertex Cj' that is closest to Cj.

[0046] Find the shortest path pathi,j from vertex Ci' to vertex Cj' in graph G, where pathi,j may contain not only vertices Ci' and Cj', but also multiple edges and vertices belonging to graph G. After traversing the graph, we can obtain a total of [n*(n-1) / 2] paths similar to pathi,j. Remove the vertices and edges in graph G that do not belong to these [n*(n-1) / 2] paths.

[0047] As a further improvement to the present invention, step 7 is as follows:

[0048] Create and maintain two sets: a set of unmerged path segments C and a set of resulting paths R, setting three conditions regarding the path endpoints:

[0049] Condition a: An endpoint is simultaneously the endpoint of three or more path segments;

[0050] Condition b: The endpoint is only the endpoint of a path segment;

[0051] Condition c: the end point is the end point of two path segments, and the two path segments are not on the same straight line;

[0052] First, add all path segments obtained in step 6 to C, take any path segment from C and judge whether it meets any of the above three conditions, if it meets any of the above conditions, set the end point meeting the condition as P0 and the other end point as P1, and do the following operations:

[0053] C = C-{P0P1}

[0054] Take P1 as the current end point, select another path P1P2 with P1 as the end point, judge the relationship between P2 and the condition, and do the following operations:

[0055]

[0056] If the end point P2 meets any of the conditions a, b, and c, terminate the process, otherwise continue the process, select P3, P4, …, Pi, and do the same operation:

[0057]

[0058] Until Pi meets any of the conditions a, b, and c, select P0 from C again, and start the process again until C is empty, and the path set R is the final result graph G'.

[0059] As a further improvement of the application, step 8 is as follows:

[0060] A roadlines data table is established in the database to save the data of graph G', the coordinate information of the path is stored using the geometry type in the table, in addition, a series of attributes such as path type, floor where the path is located, whether the path is passable, direction of the path, etc. are stored, and special attention is paid to the fact that the coordinate information of the independent area where the elevator node is located has been obtained when the map area data is obtained in step 1, so when saving the path information of graph G', it is necessary to judge whether each path edge intersects with the area where the elevator node is located, if it intersects, the path type is set to the elevator node path, and the elevator node number associated with it is saved, while the elevator node number of the ordinary path is set to empty, and the path of each floor is saved in this way to complete the storage of the road network data of the layered indoor map;

[0061] In addition to storing data in the database, a corresponding data file needs to be generated, which is stored in shp file, the storage attributes of each road network in the data file are consistent with the attributes stored in the database, and the file can be exported after completion.

[0062] Beneficial effects: The speciality of the present application is that the skeleton-based and map plane point set-based multiple thinning filtering methods are used for the rice-shaped grid, the relatively simple theoretical method is used to simplify the complicated map road network generation process, the execution time of the method is greatly shortened, the method is not limited to the traditional topological road network generation, presents a process of gradually simplifying from complexity to simplicity and from the whole to the part, and does not need to know the entrance and exit information of each independent area in the map, greatly simplifies the premise data information condition of road network generation, and can generate a regular road network based on a complex map structure composed of multiple irregular and variable deformations. BRIEF DESCRIPTION OF DRAWINGS

[0063] Figure 1 is a flowchart of the algorithm;

[0064] Figure 2 is a three triangular facet map obtained after Delauny triangulation;

[0065] Figure 3 is a map structure diagram in the implementation example;

[0066] Figure 4 is a rice-shaped grid map in the implementation example;

[0067] Figure 5 is a map basic skeleton diagram in the implementation example;

[0068] Figure 6 is a road network map after the first thinning of the rice-shaped grid in the implementation example;

[0069] Figure 7 is a road network map after the second thinning of the rice-shaped grid in the implementation example. DETAILED DESCRIPTION

[0070] The present application will be further described in detail below in combination with the drawings and specific embodiments:

[0071] The present application provides a method for automatically generating an indoor map road network based on a rice-shaped grid map, and the basic principle is to perform multiple thinning on the embedded rice-shaped grid of the map to form a road network map. The algorithm flow of the method is as follows Figure 1The method is mainly shown in the following steps: 1. generating a map of a meter cross grid; 2. performing Delauny triangulation on the map to divide the map into triangular facets; 3. performing connection processing on the generated triangular facets to form a map skeleton; 4. performing thinning on the map of the meter cross grid generated in the first step based on the map skeleton, and only leaving path segments similar in direction and close in position to the map skeleton; 5. performing path planning based on the set of triangular facet centroids obtained in the second step, and performing secondary thinning according to certain rules; and 6. saving the final result to a database and a file.

[0072] Embodiment 1

[0073] 1. Load the map file area.shp Figure 3 into the memory.

[0074] 2. According to the indoor area size of the map, set the size interval Δd as 0.5 m. Calculate the vertex coordinates of the outer frame of the map obtained in the first step. In this example, the vertex coordinates are (13440871.32, 3667411.08) (in this example, the WGS84 coordinate system is used, and the real coordinates have been encrypted). Take the starting point, set points O1 (13440871.32+0.5, y), O2 (x, 3667411.08+0.5), and O3 (13440871.32+0.5, 3667411.08+0.5), connect OO1, OO2, OO3, and O1O2 to generate four path segments. Move O to the right by 0.5 m and repeat the above operation until O is not inside the outer frame of the map.

[0075] Move O down by 0.5 m (i.e., the next row), and move O to the starting point of this row again. Repeat the above operation until the next row is not inside the outer frame of the map to generate a map of a meter cross grid Figure 4 .

[0076] 3. Obtain the coordinates of all non-passable areas of the map and put them into a list to form a point set. Form a Delauny triangular grid based on the point set. Traverse all the triangles and delete the triangles inside or intersecting with the non-passable areas.

[0077] 4. Traverse the triangular grid obtained in step 3. Let the coordinates of the three vertices of triangle Si be (xi1, yi1), (xi2, yi2), and (xi3, yi3). Then the coordinates of the center Oi of triangle Si are (xi1+xi2+xi3, yi1+yi2+yi3). Calculate the centers of all triangles (O1, O2...On) and store them in list List1. Define the edge connecting two connected triangles S1 and S2 as a common edge. Divide all triangles into three categories (...). Figure 2 The first type: has one common side. For example, if triangle S1 has one common side, connect O1 to the midpoint of the common side. The second type: has two common sides. Connect the midpoints of the two common sides. The third type: has three common sides. Connect the center of the triangle to the midpoints of the three common sides to form the skeleton diagram GL of the indoor map. Figure 5 ).

[0078] 5. Traverse the road segments of the grid obtained in the first step. Let the road segment be li. Calculate the distance di between li and GL. If di is greater than 0.5m, discard li to obtain the road network map after the first thinning. Figure 6 ).

[0079] 6. Obtain the centroid set (C1, C2, ..., Cn) of the triangular grid from step 3. Using the road network graph G obtained in step 5 as a reference, perform path planning for any two points in the centroid set. Suppose we want to find the shortest path from Ci to Cj. In graph G, find the vertex Ci' closest to Ci and the vertex Cj' closest to Cj. Use Dijkstra's algorithm to find the shortest path pathi,j from vertex Ci' to vertex Cj' in graph G. pathi,j may contain not only vertices Ci' and Cj', but also multiple edges and vertices belonging to graph G. After traversing, we can obtain a total of [n*(n-1) / 2] paths similar to pathi,j. Remove the vertices and edges in graph G that do not belong to these [n*(n-1) / 2] paths.

[0080] The grid pattern, after the filtering process described above, retains some path segments. These path segments are then processed again to merge all mergeable path segments. This process yields a new graph G'( Figure 7 ).

[0081] 7. Save the graph G' obtained in step 6 in the database and file.

[0082] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any modifications or equivalent changes made based on the technical essence of the present invention shall still fall within the scope of protection claimed by the present invention.

Claims

1. A method for automatically generating indoor map road networks based on a star-shaped grid, characterized in that, The specific steps are as follows: Step 1: Obtain the specific two-dimensional vector data of the target indoor map and process the data; Step 1 is as follows: The regional structure data of the indoor map is loaded into memory by loading map files. The data includes: The area covered by the entire indoor map, i.e., the coordinates of the map's outer bounding box; The coordinate data of each independent area within the map, as well as its type, with areas divided into passable and impassable areas; The coordinates of the ladder nodes on the map; Step 2: Create a star-shaped grid based on the internal structure of the map; Step 2 is as follows: Based on the indoor area size of the map, set a certain interval Δd, which does not exceed 1 meter, to obtain the map boundary line. In the passable area inside the polygon enclosed by the map boundary line, points with an interval of Δd are laid out discretely and evenly. Each point is connected to the nearest point in 8 directions to form 8 paths. After all points have completed this operation, the grid diagram of the map is obtained. Step 3: Create a triangular grid; Step 3 is as follows: Obtain the coordinates of all impassable areas on the map and put them into a list to form a point set. Based on the point set, form a Delaunay triangular grid. Traverse all triangles and delete triangles that are inside impassable areas or that intersect with impassable areas. Step 4: Generate the basic skeleton diagram of the map based on the triangular grid diagram obtained in Step 3; Step 5: Based on the basic framework obtained in Step 4, perform preliminary thinning of the cross-shaped grid obtained in Step 2; Step 5 is as follows: Traverse each path segment of the grid, let the current path segment be L, use L as the comparison object to traverse each path of the skeleton graph obtained in step 4, and decide whether to keep L according to the following rules. Let S be the path currently traversed in the skeleton graph, and P(x, y) be the midpoint of line segment L. Find the shortest distance distmin from P to S. Let P be the projection point of point P onto the line containing line segment S. ’ (x) ’ ,y ’ If the coordinates of the two endpoints of S are (x1, y1) and (x2, y2), then the formula for finding distmin is: ; If distmin < Δd, then keep L; if no path satisfying the condition distmin < Δd is found until all paths in the skeleton graph have been traversed, then delete L. Step 6: Thin the cross-shaped grid obtained in Step 5 a second time based on the triangular grid obtained in Step 3; Step 6 is as follows: The set of centroids (C1, C2, ..., C3) of the triangular lattice obtained in step 3 is obtained. n Using the road network map G obtained in step 5 as a reference, path planning is performed for any two points in the centroid set, as follows: Suppose we want to find the shortest path from Ci to Cj. In graph G, find the vertex Ci' that is closest to Ci and the vertex Cj' that is closest to Cj. Find the shortest path pathi,j from vertex Ci' to vertex Cj' in graph G, where pathi,j may contain not only vertices Ci' and Cj', but also multiple edges and vertices belonging to graph G. After traversing the graph, we can obtain a total of [n*(n-1) / 2] paths similar to pathi,j. Remove the vertices and edges in graph G that do not belong to these [n*(n-1) / 2] paths. Step 7: Merge the shorter path segments in the road network map obtained in Step 6; Step 8: Save the road network of the map obtained in Step 7 in the database and file.

2. The method for automatically generating indoor map road networks based on a grid according to claim 1, characterized in that, Step 4 is as follows: If two triangles share a side, that side is called a common side. Based on the number of common sides, all triangles are divided into three categories: triangles with one common side, triangles with two common sides, and triangles with all three sides being common sides. For triangles of the first type, connect the midpoint of the common side to the vertex of the triangle opposite the common side; For the second type of triangle, connect the midpoints of the two common sides; For the third type of triangle, connect the centroid of the triangle to the midpoints of the three sides of the triangle; By connecting all the triangles according to the above rules, we can obtain the basic skeleton of the map.

3. The method for automatically generating indoor map road networks based on a star-shaped grid according to claim 1, characterized in that, Step 7 is as follows: Create and maintain two sets: a set of unmerged path segments C and a set of resulting paths R, setting three conditions regarding the path endpoints: Condition a: An endpoint is simultaneously the endpoint of three or more path segments; Condition b: The endpoint is only the endpoint of a path segment; Condition c: An endpoint is simultaneously the endpoint of two path segments, and these two path segments are not on the same straight line; First, add all the path segments obtained in step 6 to C. Then, randomly select a path segment from C and determine whether it satisfies any of the three conditions mentioned above. If it satisfies any of the conditions, let the endpoint that satisfies the condition be P0, and the other endpoint be P1, and perform the following operations: ; Using P1 as the current endpoint, select another path P1P2 with P1 as the endpoint, determine the relationship between P2 and the conditions, and perform the following operations: ; If endpoint P2 satisfies any of conditions a, b, or c, then terminate this process; otherwise, continue the process, selecting P3, P4...Pi, and performing the same operation. ; Until Pi satisfies any one of conditions a, b, or c, P0 is selected again from C, and this process is restarted until C is an empty set, resulting in the path set R, which is the final graph G'.

4. The method for automatically generating indoor map road networks based on a star-shaped grid according to claim 1, characterized in that, Step 8 is as follows: Create a roadlines table in the database to store the data of map G'. Store the coordinate information of the path in the table using the geometry type. When obtaining the map area data in step 1, the coordinate information of the independent area where the ladder node is located has already been obtained. Therefore, when saving the path information of map G', it is necessary to determine whether each path edge intersects with the area where the ladder node is located. If they intersect, the path type should be set to ladder node path and the ladder node number associated with it should be saved. The ladder node number of ordinary path should be set to empty. By saving the path of each layer in this way, the road network data of the layered indoor map can be stored. In addition to storing the data in the database, it is also necessary to generate corresponding data files, which are stored using shapefiles. The storage attributes of each road network in the data file are consistent with the attributes stored in the database. Once completed, the file can be exported.

Citation Information

Patent Citations

  • Road-network model automatic generation method

    CN104850621A

  • Methods for automatically constructing indoor maps of road networks

    CN106931978B

  • Method for automatically generating dual line network by GIS single line network

    CN109297501A

  • Method for automatically generating road line indoors, computer equipment and storage medium

    CN114359440A

  • Large-scale complex environment navigation method and system based on multi-source geographic information data

    CN115752435A