A kind of indoor road network structure and method for searching with layer pathfinding
Technical field
The present invention relates to a kind of indoor road network structure and method for searching, especially one kind with layer pathfinding to apply mobile whole
The indoor road network structure and method for searching with layer pathfinding at end, belongs to interior with layer pathfinding technical field.
Background technology
With the continuous reinforcement of the high speed development of mobile Internet, and mobile terminal disposal ability, location-based clothes
It is engaged in more and more used;The raising of living standards of the people simultaneously, Commercial Complex is more and more, and careat is increasing,
It is also unavoidable to reach lost in a foreign environment room.It is typically all to be based on although outdoor positioning pathfinding is very ripe
GPS and mobile phone signal synthesis positioning, these signals indoors especially basement become very small effect with regard to some have too many difficulties to cope with.
So the prefabricated indoor road network coordinate of the present invention, more convenient to be combined with the technology of indoor positioning, determine without using GPS and mobile phone signal
Position, propose a kind of efficient interior with layer method for searching..
The content of the invention
One of the technical problem to be solved in the present invention is to provide a kind of indoor road network construction method with layer pathfinding, changes and passes
The GPS and mobile phone signal synthesized positioning method of system.
The second technical problem to be solved by the present invention is to provide a kind of interior with layer method for searching:Reduce in layer and search every time
Unrelated road dot number in rope, substantially increase the efficiency of search in layer.
In order to solve the above-mentioned technical problem, the present invention is achieved by the following technical solutions:
A kind of indoor road network structure and method for searching with layer pathfinding, wherein, the indoor road network with layer pathfinding is built
Comprise the steps with method for searching:
a:First build road network information:Including structure main road dot data list, the list of structure bypass dot data, structure connection
Connectivity information list;The main road site and bypass site are referred to as road network point;Main road site connects at least two other road networks
Point, bypass site only connect an other road network point;The road network is the path of two road network points;
b:The main road site of designated floor is all put into a set A;
c:The road network point closest with starting point, terminal, the road network point found are determined according to the coordinate of starting and terminal point first
Both it had been probably that main road site is also likely to be bypass site;
d:This step is skimmed over if being main road site if starting point road network point, adds bypass site if starting point is bypass site
Into set A;
e:This step is skimmed over if being main road site if terminal road network point, adds bypass site if terminal is bypass site
Into set A;
f:Contain all This floor main road sites what set A was stated and searched in the road network for only containing related bypass site
Rope is from starting point road network point to the path of terminal road network point;Search takes minimum value, great Liang Fu according to the distance between road network point weights
Be up to two bypass sites participate in road network search every time in road network point;
g:Start increase from starting point to the through path of starting point road network point in path;
h:Through path of the last increase from terminal road network point to terminal in path;
i:G, f, h are synthesized into final path.
The road network records the distance between two road network piont marks and road network point weights.
In the step a, often row represents a main road site to the list of main road dot data, is started with " v ", is followed by a little
Ground level X, Z coordinate, with " M " terminate, be expressed as main road site.
In the step a, often row represents a bypass site to the list of bypass dot data, is started with " v ", is followed by a little
Ground level X, Z coordinate, with " F " terminate, be expressed as bypass site.
In the step a, often row represents a connectivity information to connectivity information list, is started with " p ", is followed by this
Two related road number nodes of bar connectivity information, centre are connected with "-", often go last numerical value as this information correlation
The distance between two road network points weights.
The main beneficial effect of the present invention:Due to the road network point of an other road network points will be only connected in this method in road network
Bypass site is identified as, two bypass sites is up in a large amount of bypass sites every time and participates in road network searches, the search of solution is empty
Between be substantially reduced, therefore than traditional all road network points be involved in search method efficiency improve a lot.
Brief description of the drawings
Fig. 1 is pathfinding flow chart of the present invention.
Fig. 2 is road network structure schematic diagram of the present invention;
Its medium and small rectangle node is that main road network point is communicated to two and more than two other road network points, small circular node are
Bypass site is only directly connected with an other road network points.
Fig. 3 is the search result schematic diagram of one embodiment of the invention;
Wherein 1 between road network point path, 2 be from starting point to the through path of starting point road network point, and 3 be from terminal road network point
To the through path of terminal.
Embodiment
It is described further with reference to the accompanying drawings and examples.
The present invention basic thought be:According to the difference of floor landform, road network point is organized, and road network point is recorded in road network
Location coordinate information and connectivity.At most only 2 bypass sites participate in during searching route, greatly reduce search
The quantity of road network point, improves efficiency.
Embodiment 1:
Data tissue is stored with behavior unit in layer, and an example is as follows:
v 1187.00,1079.00 M
v 1076.00,1100.00 M
v 998.00,1114.00 M
v 921.03,1129.41 M
……
v 949.00,645.00 F
v 324.00,206.00 F
v 295.00,373.00 F
v 324.00,1202.00 F
……
p 120-121 112.445541
p 119-120 129.468140
p 119-160 94.045616
p 80-81 95.754898
p 80-131 76.015106
p 50-51 137.057144
p 46-47 140.027939
p 38-39 141.014191
Above-mentioned Part I is main road network point list, and often row represents a main road site, is started with " v ", is followed by a little
XZ coordinates, last " M " is expressed as main road site;
Road network point list supplemented by above-mentioned Part II, one bypass site of often row expression, is started with " v ", is followed by a little
XZ coordinates, last " F " is expressed as bypass site;
Above-mentioned Part III is connectivity information list, and often row represents a connectivity information, is started with " p ", followed by
Two related road number nodes of this connectivity information, centre is connected with "-", and last numerical value of often going is this information phase
The distance between the two road network points closed weights.
This time the beginning and end of road network search is all located at same floor as can be seen from Figure 3, then is searched in execution level.
Step is as follows when being searched in execution level:
1)By the main road site of designated floor(Small rectangle node in Fig. 2)All it is put into a set A
2)The road network point closest with starting point, terminal is determined according to the coordinate of starting and terminal point in Fig. 3 first, this search
The road network point nearest with starting and terminal point found is all bypass site;
3)This search starting point road network point is bypass site, is added in set A;
4)This search terminal road network point is bypass site, is added in set A;
5)Contain all This floor main road sites what set A was stated and searched in the road network for only containing related bypass site
For rope from starting point road network point to the path of terminal road network point, search result is path 1;
6)Start increase from starting point to the through path 3 of starting point road network point in path;
7)Through path 2 of the last increase from terminal road network point to terminal in path;
8) by path 3, path 1, path is 2-in-1 to turn into final path, as Fig. 3 thick lines mark.