A kind of indoor build and method for searching with the road network of layer pathfinding
Technical field
The present invention relates to a kind of indoor to build and method for searching with the road network of layer pathfinding, especially a kind of indoor being applied in mobile terminal build and method for searching with the road network of layer pathfinding, belong to indoor with layer pathfinding technical field.
Background technology
Along with the high speed development of mobile Internet, and the continuous reinforcement of mobile terminal processing power, location Based service is more and more to be used; The raising of living standards of the people simultaneously, Commercial Complex gets more and more, and careat is increasing, and it is also unavoidable for arriving indoor the getting lost of a foreign environment.Although outdoor positioning pathfinding is very ripe, is generally all comprehensively locate based on GPS and mobile phone signal, these signals in indoor especially basement become very small effect and had too many difficulties to cope with regard to some.So the prefabricated indoor road network coordinate of the present invention, the more convenient combine with technique with indoor positioning, does not use GPS and mobile phone signal location, proposes a kind of indoor with layer method for searching efficiently.
Summary of the invention
One of the technical problem to be solved in the present invention is to provide the road network construction method of a kind of indoor with layer pathfinding, changes traditional GPS and mobile phone signal synthesized positioning method.
Two of the technical problem to be solved in the present invention is to provide a kind of indoor with floor method for searching: reduce the irrelevant road dot number in each search in floor, substantially increase the efficiency of search in layer.
In order to solve the problems of the technologies described above, the present invention is achieved by the following technical solutions:
Indoor, with a road network construction method for layer pathfinding, is characterized in that, described indoor comprise the steps: with the road network construction method of layer pathfinding
A: build the list of main road dot data, the list of main road dot data is capable expression main road site often, with " v " beginning, after ground level X, Z coordinate of and then point, terminate with " M ", be expressed as main road site;
B: build the list of bypass dot data, the list of bypass dot data is capable expression bypass site often, with " v " beginning, after ground level X, Z coordinate of and then point, terminate with " F ", be expressed as bypass site;
C: build connectivity information list, connectivity information list is capable expression connectivity information often, start with " p ", and then the Liang Ge road number node that this connectivity information is relevant below, middle be connected with "-", last numerical value of often going is the distance weights between this information two road network points of being correlated with.
A kind of indoor with layer method for searching, it is characterized in that: described indoor comprise the steps: with layer method for searching
A: first build road network information;
B: the main road site of designated floor is all put in a set A;
C: first determine the road network point nearest with starting point, terminal according to the coordinate of starting and terminal point, the road network found point both may be main road site also may be bypass site;
D: if starting point road network point is main road site, skim over this step, if starting point is bypass site, adds in set A by bypass site;
E: if terminal road network point is main road site, skim over this step, if terminal is bypass site, adds in set A by bypass site;
F: that states in set A contains in all This floor main road sites and the road network only containing relevant bypass site the path searched for from starting point road network point to terminal road network point;
G: path start increase from starting point to the through path of starting point road network point;
H: the last increase in path is from terminal road network point to the through path of terminal;
I: g, f, h are synthesized final path.
Described road network point comprises main road site and bypass site; Main road site is communicated with at least two other road network points, and bypass site is only communicated with other road network point.
Described road network is the path of two road network points, records the distance weights between two road network piont marks and road network point.
Described search gets minimum value according to the distance weights between road network point, has at most two bypass sites to participate in road network search in a large amount of bypass site at every turn.
The main beneficial effect of the present invention: owing to being bypass site by the road network point identification being only communicated with other road network point in road network in this method, there are at most two bypass sites to participate in road network search in a large amount of bypass site at every turn, the search volume solved reduces greatly, and the method efficiency therefore all participating in searching for than traditional all road network points improves a lot.
Accompanying drawing explanation
Fig. 1 is pathfinding process flow diagram 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 site is communicated to two and other road network point plural, and to be that bypass site is only direct be connected with other a road network point small circular node.
Fig. 3 is the Search Results schematic diagram of one embodiment of the invention;
Wherein 1 is path between road network point, and 2 is the through path from starting point to starting point road network point, and 3 is the through path from terminal road network point to terminal.
Embodiment
Be described further below in conjunction with drawings and Examples.
Basic thought of the present invention is: according to the difference of floor landform, organizes road network point, and in road network, record location coordinate information and the connectivity of road network point.Only have at most 2 bypass sites to participate in during searching route, greatly reduce the quantity of search road network point, improve efficiency.
Embodiment 1:
In layer, Organization of Data stores with behavior unit, and an example is as follows:
v1187.00,1079.00M
v1076.00,1100.00M
v998.00,1114.00M
v921.03,1129.41M
……
v949.00,645.00F
v324.00,206.00F
v295.00,373.00F
v324.00,1202.00F
……
p120-121112.445541
p119-120129.468140
p119-16094.045616
p80-8195.754898
p80-13176.015106
p50-51137.057144
p46-47140.027939
p38-39141.014191
Above-mentioned Part I is the list of main road site, often capable expression main road site, with " v " beginning, after the XZ coordinate of and then point, last " M " is expressed as main road site;
Above-mentioned Part II is the list of bypass site, often capable expression bypass site, with " v " beginning, after the XZ coordinate of and then point, last " F " is expressed as bypass site;
Above-mentioned Part III is connectivity information list, often capable expression connectivity information, with " p " beginning, after Liang Ge road number node that and then this connectivity information is relevant, middle be connected with "-", last numerical value of often going is the distance weights between this information two road network points of being correlated with.
This time the starting point of road network search and terminal are all positioned at same floor, then search in execution level as can be seen from Figure 3.In execution level, during search, step is as follows:
1) the main road site (the medium and small rectangle node of Fig. 2) of designated floor is all put in a set A
2) first determine the road network point nearest with starting point, terminal according to the coordinate of starting and terminal point in Fig. 3, this searches for 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) that states in set A contains in all This floor main road sites and the road network only containing relevant bypass site the path searched for from starting point road network point to terminal road network point, and Search Results is path 1;
6) path start increase from starting point to the through path 3 of starting point road network point;
7) the last increase in path is from terminal road network point to the through path 2 of terminal;
8) by path 3, path 1, path is 2-in-1 becomes final path, as Fig. 3 thick line mark.