CN101162150B - Calculating method for searching multi-city multi-province route using framing data in networking vehicle mounted guidance apparatus - Google Patents
Calculating method for searching multi-city multi-province route using framing data in networking vehicle mounted guidance apparatus Download PDFInfo
- Publication number
- CN101162150B CN101162150B CN2006101352766A CN200610135276A CN101162150B CN 101162150 B CN101162150 B CN 101162150B CN 2006101352766 A CN2006101352766 A CN 2006101352766A CN 200610135276 A CN200610135276 A CN 200610135276A CN 101162150 B CN101162150 B CN 101162150B
- Authority
- CN
- China
- Prior art keywords
- data
- map
- road
- path
- map sheet
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Navigation (AREA)
Abstract
本发明是一种联网车载导航设备中使用分幅数据搜寻跨市跨省路径的计算方法,首先将地图进行分幅切割,然后加载起点图幅和终点图幅的道路导航数据到内存中;使用基于Dijkstra的路径算法,从起点开始,发散式计算地图上各个路径点的最短路径,直到到达终点为止,在计算的过程中,如果新加载的图幅中心点距离起点或终点的直线距离超过预设值,则仅加载高等级道路的数据参与计算;若某个图幅加载的道路数据中所有路径点都算出了从起点出发可以到达的最短路径,则将该图幅的导航道路数据从内存中卸载,本发明仅加载相关图幅数据用于计算,且可以动态加载和卸载数据,这样,减少了内存的不必要占用,达到了使用小容量内存计算大型数据的目的。
The present invention is a calculation method for searching cross-city and cross-province routes using framed data in a networked vehicle navigation device. First, the map is framed and cut, and then the road navigation data of the starting point map and the end point map are loaded into the memory; Based on Dijkstra's path algorithm, starting from the starting point, the shortest path of each path point on the map is calculated divergently until reaching the end point. If the value is set, only the data of high-level roads will be loaded to participate in the calculation; if all the path points in the road data loaded in a map frame have calculated the shortest path that can be reached from the starting point, the navigation road data of the map frame will be loaded from the memory. During unloading, the present invention only loads relevant map frame data for calculation, and can dynamically load and unload data, thus reducing unnecessary memory occupation and achieving the purpose of using small-capacity memory to calculate large data.
Description
技术领域 technical field
本发明一种将导航数据分割为多个小单元进行处理,以解决嵌入式车载导航设备因为内存空间的不足而无法处理大型导航数据,从而无法搜寻大范围的跨市跨省导航路径的方法。The invention divides the navigation data into a plurality of small units for processing, so as to solve the problem that the embedded vehicle navigation device cannot process large-scale navigation data due to insufficient memory space, and thus cannot search for a large-scale cross-city and cross-province navigation path.
背景技术 Background technique
嵌入式车载导航设备应用已越来越广,但是,很多导航设备只提供某个城市或某个地区的导航功能,尚不能提供可以进行全国道路导航的功能。究其原因,是因为中国幅员辽阔,道路信息十分庞大,如果采用传统的方法处理,需要将全部的数据加载到内存中进行,这样,可能需要好几十兆甚至几百兆以上的内存,对于内存受限的嵌入式车载导航设备来说是不可行的。Embedded vehicle navigation devices have become more and more widely used. However, many navigation devices only provide navigation functions for a certain city or a certain region, and cannot yet provide the function of national road navigation. The reason is that China has a vast territory and road information is huge. If traditional methods are used to process all the data, it is necessary to load all the data into the memory. In this way, tens of megabytes or even hundreds of megabytes of memory may be required. For It is not feasible for memory-constrained embedded car navigation devices.
发明内容 Contents of the invention
本发明的目的在于提供一种联网车载导航设备中使用分幅数据搜寻跨市跨省路径的计算方法,可以将大型的道路数据划分为小单元数据块,需要时载入,不需要时卸载,按需读取地理上相连的多个单元的数据块,从而完成路径计算。The purpose of the present invention is to provide a calculation method for searching cross-city and cross-province routes using framing data in a networked vehicle navigation device, which can divide large-scale road data into small unit data blocks, load them when needed, and unload them when they are not needed. Path calculations are accomplished by reading blocks of data from geographically connected cells on demand.
本发明一种联网车载导航设备中使用分幅数据搜寻跨市跨省路径的计算方法,首先将地图进行分幅切割,将起点或终点的经度与全国地图最左边图幅的左边界经度相减,得到的差值除以图幅宽度,则可以算出该点位于全国图幅的第几列,将起点或终点的纬度与全国地图最上边图幅的上边界纬度相减,得到的差值除以图幅高度,则可以算出该起点或终点位于全国图幅的第几行,这样根据图幅编号规律,得到起点和终点所在图幅的编号,从而得到该图幅的道路导航数据区地址;然后加载起点图幅和终点图幅的道路导航数据到内存中;使用基于Dijkstra的路径算法,从起点开始,发散式计算地图上各个路径点的最短路径,遇到图幅边界,根据邻接转向信息,加载对应的邻接图幅的导航道路数据继续计算,直到到达终点为止,在计算的过程中,如果新加载的图幅中心点距离起点或终点的直线距离超过预设值,则仅加载高等级道路的数据参与计算;若某个图幅加载的道路数据中所有路径点都算出了从起点出发可以到达的最短路径,则将该图幅的导航道路数据从内存中卸载,并且记录标志,以免再次加载该图幅的数据计算,计算完成后,根据计算过程中的路径记录进行回溯,最后生成完整路径。The present invention is a calculation method for searching cross-city and cross-provincial routes using framed data in a networked vehicle navigation device. First, the map is framed and cut, and the longitude of the starting point or end point is subtracted from the longitude of the left boundary of the leftmost frame of the national map. , divide the difference obtained by the width of the map frame, then you can calculate which column the point is located in the national map frame, subtract the latitude of the starting point or end point from the latitude of the upper boundary of the topmost map frame of the national map, and divide Based on the height of the map frame, it can be calculated which row the starting point or end point is located in the national map frame, so that according to the numbering rules of the map frame, the number of the map frame where the starting point and the end point are located can be obtained, thereby obtaining the address of the road navigation data area of the map frame; Then load the road navigation data of the starting point map and the end point map into the memory; use the path algorithm based on Dijkstra, start from the starting point, and calculate the shortest path of each path point on the map in a divergent manner, and when encountering the map frame boundary, turn according to the adjacency information , load the navigation road data of the corresponding adjacent map frame and continue the calculation until the end point is reached. During the calculation process, if the straight-line distance between the center point of the newly loaded map frame and the starting point or the end point exceeds the preset value, only the high level will be loaded The road data is involved in the calculation; if all the path points in the road data loaded in a certain map frame have calculated the shortest path that can be reached from the starting point, the navigation road data of the map frame will be unloaded from the memory, and the mark will be recorded to avoid Load the data calculation of this map again. After the calculation is completed, perform backtracking according to the path records in the calculation process, and finally generate a complete path.
根据《国家基本比例尺地形图分幅和编号》,选择1∶10万的分幅标准,即每隔经差7′30″、纬差5′为1个分幅大小,将全国范围的矩形区域分隔为426行X 494列个图幅,并按照“自上而下,从左到右”的方式编号。According to the "National Basic Scale Topographic Map Framing and Numbering", the framing standard of 1:100,000 is selected, that is, every 7'30" of longitude difference and 5' of latitude difference is a frame size, and the nationwide rectangular area It is divided into 426 rows X 494 columns and numbered according to the "top-to-bottom, left-to-right" method.
所述的道路导航数据的文件格式为,在文件开头建立图幅数据索引区,索引区的图幅顺序按照编号顺序排列,索引区后即是各个图幅的道路导航数据区。The file format of the road navigation data is that an index area of map data is established at the beginning of the file, and the order of the map frames in the index area is arranged according to the order of numbers, and after the index area is the road navigation data area of each map frame.
对于图幅与图幅之间的联通道路,采用邻接转向信息进行记录,邻接转向信息的主要内容包括邻接图幅编号和邻接道路在邻接图幅内部的编号。For connecting roads between map frames, the adjacent turn information is used to record, and the main content of the adjacent turn information includes the number of the adjacent map frame and the number of the adjacent road inside the adjacent map frame.
采用本发明一种联网车载导航设备中使用分幅数据搜寻跨市跨省路径的计算方法,将全国导航道路数据分幅切割,加载起点图幅和终点图幅的道路导航数据到内存中;而在计算的过程中,仅加载计算时遇到的邻接图幅道路拓扑数据,不需要加载全部图幅的道路拓扑数据;并且在距离起点和终点较远的中间地区,可以只加载高等级道路进行计算;计算过程中可以动态加载数据和动态卸载数据。这样,提高了内存使用的效率,减少了内存的不必要占用,达到了使用小容量内存计算大型数据的目的。Adopting the computing method of searching cross-city and cross-provincial routes using framed data in a networked vehicle navigation device of the present invention, the national navigation road data is framed and cut, and the road navigation data of the starting point map frame and the end point map frame are loaded into the memory; and In the process of calculation, only the road topological data of adjacent map frames encountered in the calculation is loaded, and there is no need to load the road topological data of all map frames; and in the middle area far from the starting point and the end point, only high-level roads can be loaded for further calculation. Calculation; data can be dynamically loaded and unloaded during the calculation process. In this way, the efficiency of memory usage is improved, the unnecessary occupation of memory is reduced, and the purpose of using small-capacity memory to calculate large data is achieved.
附图说明 Description of drawings
图1为本发明中全国地图分幅切割示意图;Fig. 1 is a schematic diagram of national map framing and cutting among the present invention;
图2为本发明中全国地图分幅数据编号示意图;Fig. 2 is a schematic diagram of numbering of national map framing data in the present invention;
图3为本发明中分幅存放的导航拓扑数据的存储示意图;Fig. 3 is the storage schematic diagram of the navigation topological data that framing stores in the present invention;
图4为本发明中路径计算时导航拓扑数据的分幅加载示意图;Fig. 4 is a schematic diagram of the frame loading of navigation topology data during path calculation in the present invention;
图5为本发明中图幅内导航拓扑数据的分级存储示意图;Fig. 5 is a schematic diagram of hierarchical storage of navigation topology data in the map frame in the present invention;
图6为本发明中用于路径回溯的路径计算中间记录——图幅路径表数组示意图。FIG. 6 is a schematic diagram of the path calculation intermediate record used for path backtracking in the present invention—a map frame path table array.
具体实施方式 Detailed ways
本发明是一种联网车载导航设备中使用分幅数据搜寻跨市跨省路径的计算方法,其中该路径计算的方法,仍然是以经典的Dijkstra单源最短路径算法为基础。中华人民共和国国家标准《国家基本比例尺地形图分幅和编号——GB/T 13989-92》,为本发明提供了划分单元数据块的参考依据。The present invention is a calculation method for searching cross-city and cross-province routes using framing data in a networked vehicle navigation device, wherein the route calculation method is still based on the classic Dijkstra single-source shortest path algorithm. The National Standard of the People's Republic of China "National Basic Scale Topographic Map Framing and Numbering—GB/T 13989-92" provides a reference basis for dividing unit data blocks for the present invention.
(1)导航道路数据的分幅切割(1) Framing and cutting of navigation road data
参照国标《国家基本比例尺地形图分幅和编号》的内容,选择一个分幅标准作为道路数据分块单元的大小。例如选择1∶10万地形图的分幅大小,即每隔经差7′30″、纬差5′为1个分幅大小(也可以选择其他分幅单位,但是分幅单位不能太大或者太小,太大则每次加载需要的内存还是偏大,太小则要增加图幅读取的次数影响效率,本发明在实施时采用的是上述的分幅大小),这样,覆盖全国的可导航地图区域就可以分割成426行X 494列个图幅。Referring to the content of the national standard "National Basic Scale Topographic Map Framing and Numbering", a framing standard is selected as the size of the road data block unit. For example, choose the frame size of 1:100,000 topographic map, that is, every 7'30" of longitude difference and 5' of latitude difference is one frame size (other frame units can also be selected, but the frame unit should not be too large or If it is too small, if it is too large, the memory required for each loading is still too large, if it is too small, the number of times that the picture frame is read will be increased and the efficiency will be affected. What the present invention adopts when it is implemented is the above-mentioned frame size), like this, covering the whole country The navigable map area can be divided into 426 rows X 494 columns.
将全国道路数据按照分幅大小进行切割,并且对切割后的图幅进行有规律的编号(比如自上而下、再从左到右这样编号),在各个图幅内的道路数据进行独立的编号,这样,对于图幅与图幅之间的联通道路,可采用邻接转向信息进行记录。邻接转向信息的主要内容是(具体内容,见下文(2)中所述):Cut the national road data according to the frame size, and regularly number the cut frames (such as numbering from top to bottom, then from left to right), and independently separate the road data in each frame Numbering, so that for the connection path between the map frames, the adjacency steering information can be used to record. The main content of the adjacency steering information is (specific content, see the description in (2) below):
①邻接图幅编号。①Number of adjacent drawing sheets.
②邻接道路在邻接图幅内部的编号。②Number of adjacent roads inside the adjacent map frame.
这样,如图1所示,覆盖全国的矩形区域的经度范围是73.375°~135.125°,纬度范围是18.0833333°~53.58343°。本发明具体实施时,根据《国家基本比例尺地形图分幅和编号》,选择1∶10万的分幅标准(经差7′30″、纬差5′),将全国范围的矩形区域分隔为426行X 494列个图幅,并按照“自上而下,从左到右”的方式编号,如图2所示。In this way, as shown in FIG. 1 , the longitude range of the rectangular area covering the whole country is 73.375°-135.125°, and the latitude range is 18.0833333°-53.58343°. During the specific implementation of the present invention, according to "National Basic Scale Topographic Map Framing and Numbering", select the framing standard of 1: 100,000 (longitude difference 7' 30 ", latitude difference 5'), and the rectangular area nationwide is divided into There are 426 rows X 494 columns of picture frames, and they are numbered in a "top-to-bottom, left-to-right" manner, as shown in Figure 2.
然后,建立道路导航数据文件,在文件开头,建立图幅数据索引区,索引区的图幅顺序按照图幅编号顺序排列,索引区后即是各个图幅的道路导航数据区。Then, the road navigation data file is established. At the beginning of the file, a map data index area is established. The order of the map frames in the index area is arranged according to the order of the map frame numbers. After the index area is the road navigation data area of each map frame.
(2)分幅数据的存储方式和内容(2) Storage method and content of framing data
虽然全国数据是分幅的,但是可将所有图幅的数据组合在一个导航拓扑文件中,这样的话,为了快速的跳转到各个图幅数据进行读取,还在文件头增加了各图幅索引信息。导航拓扑文件的基本格式如图3所示,说明如下:Although the national data is framed, the data of all map frames can be combined in a navigation topology file. In this case, in order to quickly jump to the data of each map frame for reading, each map frame is added to the header of the file Index information. The basic format of the navigation topology file is shown in Figure 3 and explained as follows:
各图幅数据的快速索引,即各图幅的导航拓扑数据在文件中的起始地址。Quick index of each map frame data, that is, the starting address of the navigation topology data of each map frame in the file.
图幅内的导航拓扑详细数据,主要包括:各等级道路个数(高等级在前)、所有道路弧的权值信息和转向信息,组织方式如图5所示,说明如下:The navigation topology detailed data in the map mainly includes: the number of roads of each level (higher level first), the weight information and steering information of all road arcs, the organization method is shown in Figure 5, and the description is as follows:
等级1道路个数、等级2道路个数、......,等级m道路个数;The number of roads at
【道路弧1权值、点个数、点集...、转向个数、转向1出弧ID、转向1转向权值、(转向1出弧ID所在图幅的ID)注、转向2出弧ID、转向2转向权值,......】,【道路弧2权值、点个数、点集...、转向个数、转向1出弧ID、转向1转向权值、转向2出弧ID、转向2转向权值,......】,............,【道路弧n权值,点个数、点集...、转向个数、转向1出弧ID、转向1转向权值、转向2出弧ID、转向2转向权值......】[
道路弧数据的排列顺序,按照道路级别顺序排列,即高等级道路在前,低等级道路在后,相同等级道路的排列顺序则是随机的。这种分级组织的方式,在跨城市跨省计算时为数据的分级加载奠定了基础,后文将进行说明。The arrangement order of the road arc data is arranged according to the order of the road level, that is, the high-level roads come first, the low-level roads follow, and the arrangement order of the same-level roads is random. This hierarchical organization method lays the foundation for the hierarchical loading of data when calculating across cities and provinces, which will be explained later.
并且,如果转向出弧是其他图幅内的道路弧,用特殊的方式进行表示,例如,若以4个字节无符号整数表示道路弧ID,则实际上ID的最大值不会超过0x7fffffff,即ID的二进制最高位肯定为0,若转向出弧是邻接图幅内的ID,则将该ID的二进制最高位置为1,以表示转向出弧是邻接图幅内的道路弧,使用时只要重新将该ID的二进制最高位置为0即可还原为真实的ID,该ID是邻接道路弧在邻接图幅内的ID。Moreover, if the turning arc is a road arc in another map frame, it is represented in a special way. For example, if the road arc ID is represented by a 4-byte unsigned integer, the maximum value of the ID will not exceed 0x7fffffff in fact. That is, the highest binary bit of the ID must be 0. If the turning arc is an ID in the adjacent map frame, the highest binary bit of the ID is set to 1 to indicate that the turning arc is a road arc in the adjacent map frame. Resetting the highest binary position of the ID to 0 can restore it to the real ID, which is the ID of the adjacent road arc in the adjacent map frame.
注:括号内的数据,例如“(道路弧1转向1出弧ID所在图幅的ID)”,只有在转出的道路弧是在邻接图幅中时才会出现,即邻接转向信息中才出现。Note: The data in brackets, such as "(the ID of the map frame where the
(3)跨城市跨省计算时对数据加载的取舍——分级调用道路数据(3) The trade-off of data loading when cross-city and cross-provincial calculations—gradually call road data
计算跨城市、跨省的两地间的路径时,需要调用起点和终点中间地区的许多图幅数据,如果起点-终点之间的距离很远,可以在接近起点和接近终点的图幅上读取全部的数据,而中间地区的图幅只要读取部分高等级道路数据(高速公路、城市快速路、城市主干道、国道、省道等)即可,因为实际上车辆在距离起点或终点很远的时候一般选择大路行驶。When calculating the route between two places across cities and provinces, it is necessary to call many map data in the middle area between the starting point and the end point. If the distance between the starting point and the end point is very far, you can read it on the map frame near the starting point and the end point. Take all the data, and only need to read some high-level road data (expressways, urban expressways, urban main roads, national roads, provincial roads, etc.) When you are far away, you generally choose to drive on the main road.
如图4所示,与起点、终点附近的圆形区域有面积相交的图幅,可以加载全部的导航道路数据来计算,而2个圆形区域以外的图幅,则只需要加载高等级道路的导航数据。实施时,在计算的过程中,如果新加载的图幅中心点距离起点或终点的直线距离超过预设值,也就是圆形区域的半径(例如50km),则仅加载高等级道路的数据参与计算。As shown in Figure 4, the map frames that intersect with the circular areas near the starting point and the end point can be calculated by loading all the navigation road data, while the map frames outside the two circular areas only need to load high-level roads navigation data. During implementation, during the calculation process, if the straight-line distance between the center point of the newly loaded map frame and the start point or end point exceeds the preset value, that is, the radius of the circular area (for example, 50km), only the data of high-level roads will be loaded for participation calculate.
如何做到仅加载高等级道路数据,即分级加载和计算的具体方式见下文。How to load only high-level road data, that is, the specific method of hierarchical loading and calculation, is described below.
(4)图幅内导航道路数据的分级加载和计算(4) Hierarchical loading and calculation of navigation road data in the map frame
如前文(2)中所述,为了在计算时能够很方便的只加载高等级道路数据,对于图幅内导航道路数据的组织,采用按等级排序的方式,同时,建立了各个等级道路的个数信息,如图5所示。As mentioned in (2) above, in order to easily load only high-level road data during calculation, the organization of navigation road data in the map is sorted by level. information, as shown in Figure 5.
这样,先读取各等级道路的道路个数信息,然后,根据要加载的级别个数,计算要加载的道路总数,加载了该总数的道路数据后即停止加载。例如,某图幅的各等级道路个数为:50、100、200、500、800、50、......,现在要加载前3个级别的道路数据,则要加载的道路总数就是350条,读取了350条导航道路数据后就完成了加载,此时,加载的道路ID范围为1~350,计算时若发现某条道路的转向出弧ID超过此范围,则将该转向信息屏蔽,这样,计算时就也只会转入已加载的高等级导航道路数据。In this way, the road number information of roads of each level is first read, and then, according to the number of levels to be loaded, the total number of roads to be loaded is calculated, and the loading is stopped after the total number of road data is loaded. For example, the number of roads of each level in a map is: 50, 100, 200, 500, 800, 50, ..., now to load the road data of the first three levels, the total number of roads to be loaded is 350, after reading 350 navigation road data, the loading is completed. At this time, the loaded road ID range is 1 to 350. If the steering arc ID of a certain road exceeds this range during calculation, the steering will be executed. Information masking, so that only the loaded high-level navigation road data will be transferred to the calculation.
(5)起点、终点所在图幅的确定(5) Determination of the map frame where the start point and end point are located
将起点(终点)的经度与全国地图最左边图幅的左边界经度相减,得到的差值除以图幅宽度,则可以算出该点位于全国图幅的第几列,将起点或终点的纬度与全国地图最上边图幅的上边界纬度相减,得到的差值除以图幅高度,则可以算出该起点或终点位于全国图幅的第几行,这样根据图2中的图幅编号规律,可以推断出该点所处图幅的编号,再根据图3中各图幅数据的存储位置索引,就可以加载该点所处图幅的导航拓扑数据了。Subtract the longitude of the starting point (end point) from the longitude of the left boundary of the leftmost frame of the national map, and divide the obtained difference by the width of the frame, then you can calculate which column the point is located in the national map frame, and divide the starting point or end point Subtract the latitude from the latitude of the upper boundary of the topmost map sheet of the national map, and divide the obtained difference by the height of the map sheet, then you can calculate which row the starting point or end point is located in the national map sheet, so according to the sheet number in Figure 2 According to the law, the number of the map frame where the point is located can be deduced, and then according to the storage location index of each map frame data in Figure 3, the navigation topology data of the map frame where the point is located can be loaded.
(6)分幅法进行路径计算(6) Framing method for path calculation
本发明的路径计算的算法是基于经典的Dijkstra算法的。The path calculation algorithm of the present invention is based on the classic Dijkstra algorithm.
本发明路径计算时,先加载起点图幅的道路拓扑数据,从起点道路开始进行路径计算;当计算到图幅边界时,根据前文(2)中所述的邻接转向信息,得到邻接图幅的ID,然后加载邻接图幅道路拓扑数据(可能是只加载部分高等级导航道路数据),再以邻接道路为起始道路继续计算,一直到加载了终点图幅数据并找到到达终点的最短路径为止。这样,在计算的过程中,只需要加载计算时遇到的邻接图幅道路拓扑数据,不需要加载全国所有图幅的道路拓扑数据。During path calculation in the present invention, first load the road topology data of the starting map frame, and start path calculation from the starting point road; ID, then load the road topology data of the adjacent map (maybe only load part of the high-level navigation road data), and then continue the calculation with the adjacent road as the starting road, until the data of the end map is loaded and the shortest path to the end is found. . In this way, in the calculation process, only the road topology data of the adjacent maps encountered in the calculation need to be loaded, and there is no need to load the road topology data of all maps in the country.
如果某个图幅中所有的路径点都计算出了最短路径,则可以将计算时加载的该图幅道路拓扑数据卸载出内存,以节约空间。If the shortest path has been calculated for all the route points in a map frame, the road topology data of the map frame loaded during calculation can be unloaded from the memory to save space.
对于距离起点(终点)都较远的图幅在加载时,因为实际上车辆在距离起点或终点很远的时候一般选择大路行驶,所以可以只加载高等级道路进行计算,这样就起到了节约内存空间的作用。When loading images that are far away from the starting point (end point), because the vehicle usually chooses a large road when it is far away from the starting point or end point, it can only load high-level roads for calculation, which saves memory. The role of space.
在计算的过程中,已经算出路径的中间数据,要进行记录,以便最后进行路径的回溯,形成完整的路径。中间路径数据的记录,即可以保存在内存中,也可以暂时保存在临时文件中。以保存在内存中的数据形式为例,如图6所示。During the calculation process, the intermediate data of the path has been calculated and should be recorded so that the path can be traced back to form a complete path. The record of the intermediate path data can be stored in memory or temporarily stored in a temporary file. Take the data form stored in memory as an example, as shown in Figure 6.
(7)回溯生成路径结果(7) Backtracking to generate path results
分幅法计算路径的过程中,要保存图幅路径表数组以便最后回溯生成路径。如图6所示,每个图幅都有自己的图幅路径表,路径表的内容是:In the process of calculating the path by the framing method, it is necessary to save the map frame path table array so that the path can be generated by backtracking at the end. As shown in Figure 6, each map frame has its own map frame path table, and the contents of the path table are:
①参与计算的道路个数①Number of roads involved in the calculation
②路径信息数组指针②Path information array pointer
初始时,道路个数为0,数组指针是NULL,一旦加载了该图幅的道路拓扑数据后,生成该图幅的路径信息数组并填充该图幅的路径表内容。各图幅的路径表按照图幅编号的顺序组织为一个数组结构,计算前进行初始化,计算中填充内容,计算后再清除各图幅路径表的内容,释放路径表所指向的路径信息数组。Initially, the number of roads is 0, and the array pointer is NULL. Once the road topology data of the map frame is loaded, the path information array of the map frame is generated and the path table content of the map frame is filled. The path table of each map frame is organized into an array structure according to the order of the map frame numbers. It is initialized before calculation, filled with content during calculation, and after calculation, the content of the path table of each map frame is cleared, and the path information array pointed to by the path table is released.
各图幅的路径信息数组,记录的是图幅内各条道路弧的路径上的前一道路弧信息,前一道路弧可能是本图幅上的,也可能是邻接图幅上的。路径信息数组初始化时,各道路弧的前弧ID置为-1,表示还未计算出路径;计算过程中,随时填充道路的前弧信息,例如,若计算中确定了弧A->弧B的路径,则弧B的前弧就是弧A。The path information array of each map frame records the previous road arc information on the path of each road arc in the map frame. The previous road arc may be on this map frame or on an adjacent map frame. When the path information array is initialized, the front arc ID of each road arc is set to -1, indicating that the path has not been calculated; during the calculation process, the front arc information of the road is filled at any time, for example, if it is determined during the calculation that arc A -> arc B , then the previous arc of arc B is arc A.
计算结束后,根据路径信息数组,以到达终点的那条道路弧开始,往前回溯,生成路径。回溯时,若某道路的前弧是邻接图幅内的,则根据该道路前弧所在图幅的路径表指针,读取邻接图幅的路径表,然后从其前弧开始继续回溯;当遇到起点发出的道路时,回溯结束。After the calculation is completed, according to the path information array, start with the road arc that reaches the end point, backtrack to generate a path. When backtracking, if the front arc of a road is in the adjacent map frame, read the path table of the adjacent map frame according to the path table pointer of the map frame where the road’s front arc is located, and then continue backtracking from its front arc; Backtracking ends when the path emanating from the origin is reached.
总之,本发明的核心内容在于:将地图进行分幅切割,将起点或终点的经度与全国地图最左边图幅的左边界经度相减,得到的差值除以图幅宽度,则可以算出该点位于全国图幅的第几列,将起点或终点的纬度与全国地图最上边图幅的上边界纬度相减,得到的差值除以图幅高度,则可以算出该起点或终点位于全国图幅的第几行,这样根据图幅编号规律,得到起点和终点所在图幅的编号,从而得到该图幅的道路导航数据区地址,然后加载起点图幅和终点图幅的道路导航数据到内存中;使用基于Dijkstra的路径算法,从起点开始,发散式计算地图上各个路径点的最短路径,遇到图幅边界,根据邻接索引信息,加载对应的邻接图幅的导航道路数据继续计算,直到到达终点为止,在计算的过程中,如果新加载的图幅中心点距离起点或终点的直线距离超过预设值,则仅加载高等级道路的数据参与计算;若某个图幅加载的道路数据中所有路径点都算出了从起点出发可以到达的最短路径,则将该图幅的导航道路数据从内存中卸载,并且记录标志,以免再次加载该图幅的数据计算。计算完成后,根据计算过程中的路径记录进行回溯,最后生成完整路径。In a word, the core content of the present invention is: the map is cut into frames, the longitude of the starting point or the end point is subtracted from the longitude of the left border of the leftmost frame of the national map, and the obtained difference is divided by the width of the frame, then the value can be calculated. Which column is the point located in the national map? Subtract the latitude of the starting point or end point from the latitude of the upper boundary of the topmost map of the national map, and divide the obtained difference by the height of the map. Then it can be calculated that the starting point or end point is located in the national map In this way, according to the numbering rule of the map frame, the number of the map frame where the start point and the end point are located is obtained, so as to obtain the address of the road navigation data area of the map frame, and then load the road navigation data of the start point map frame and the end point map frame to the memory Middle; use the path algorithm based on Dijkstra, start from the starting point, calculate the shortest path of each path point on the map in a divergent manner, when encountering the border of the map frame, load the navigation road data of the corresponding adjacent map frame according to the adjacency index information and continue to calculate until Until the end point is reached, during the calculation process, if the straight-line distance between the center point of the newly loaded map frame and the starting point or the end point exceeds the preset value, only the data of high-level roads will be loaded to participate in the calculation; if the road data loaded in a certain map frame If all the waypoints in the map have calculated the shortest path that can be reached from the starting point, the navigation road data of the map frame is unloaded from the memory, and the mark is recorded to avoid loading the data calculation of the map frame again. After the calculation is completed, trace back according to the path records in the calculation process, and finally generate a complete path.
Claims (4)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2006101352766A CN101162150B (en) | 2006-11-30 | 2006-11-30 | Calculating method for searching multi-city multi-province route using framing data in networking vehicle mounted guidance apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN2006101352766A CN101162150B (en) | 2006-11-30 | 2006-11-30 | Calculating method for searching multi-city multi-province route using framing data in networking vehicle mounted guidance apparatus |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN101162150A CN101162150A (en) | 2008-04-16 |
| CN101162150B true CN101162150B (en) | 2012-03-21 |
Family
ID=39297109
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN2006101352766A Active CN101162150B (en) | 2006-11-30 | 2006-11-30 | Calculating method for searching multi-city multi-province route using framing data in networking vehicle mounted guidance apparatus |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN101162150B (en) |
Families Citing this family (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101813489A (en) * | 2009-02-20 | 2010-08-25 | 环达电脑(上海)有限公司 | Route planning device and route planning method |
| CN101561286B (en) * | 2009-05-27 | 2011-08-17 | 四川长虹电器股份有限公司 | Trans-regional map data loading and displaying method |
| JP5348052B2 (en) * | 2010-03-31 | 2013-11-20 | アイシン・エィ・ダブリュ株式会社 | Map data management apparatus, map data management method, and information terminal |
| JP6101630B2 (en) * | 2010-12-07 | 2017-03-22 | グーグル インコーポレイテッド | Road guidance method and apparatus |
| EP2795254A4 (en) * | 2011-12-19 | 2015-07-22 | Intel Corp | Navigation systems and methods |
| CN102610090A (en) * | 2012-03-06 | 2012-07-25 | 张忠义 | Parking space management method for urban road parking |
| JP6236845B2 (en) * | 2013-04-16 | 2017-11-29 | 株式会社デンソー | Map display device |
| CN104217456A (en) * | 2013-05-31 | 2014-12-17 | 高德信息技术有限公司 | Three-dimensional model data loading method and device |
| CN105336154B (en) * | 2014-08-07 | 2018-04-13 | 北京四维图新科技股份有限公司 | A kind of method and device of the number renewal of China's Real-time Traffic Information service |
| CN104406590B (en) * | 2014-11-26 | 2017-03-29 | 中国测绘科学研究院 | A kind of shortest path planning method based on category of roads |
| CN107228678B (en) * | 2016-03-23 | 2020-05-08 | 高德信息技术有限公司 | Method and device for determining travel cost to preset POI |
| CN107229990B (en) * | 2016-03-25 | 2020-10-16 | 阿里巴巴(中国)有限公司 | Route planning method and device |
| CN106767861A (en) * | 2016-11-25 | 2017-05-31 | 奇瑞商用车(安徽)有限公司 | Intelligent online air navigation aid |
| CN106959115A (en) * | 2017-01-09 | 2017-07-18 | 上海趣驾信息科技有限公司 | A kind of method and device of process city gather between generation city and city |
| CN111442783B (en) * | 2020-04-30 | 2023-06-30 | 福州吉诺网络科技有限公司 | Method and terminal for optimizing path planning |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1550756A (en) * | 2003-04-11 | 2004-12-01 | ��ʽ�������λ��Ѷ�鱨 | Process time counting method for navigation equipment and traffic information displaying method |
| WO2005068940A1 (en) * | 2004-01-16 | 2005-07-28 | Xanavi Informatics Corporation | Route search method for navigation device |
| CN1796942A (en) * | 2004-12-21 | 2006-07-05 | 厦门雅迅网络股份有限公司 | Method for calculating route of navigating cities |
-
2006
- 2006-11-30 CN CN2006101352766A patent/CN101162150B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1550756A (en) * | 2003-04-11 | 2004-12-01 | ��ʽ�������λ��Ѷ�鱨 | Process time counting method for navigation equipment and traffic information displaying method |
| WO2005068940A1 (en) * | 2004-01-16 | 2005-07-28 | Xanavi Informatics Corporation | Route search method for navigation device |
| CN1796942A (en) * | 2004-12-21 | 2006-07-05 | 厦门雅迅网络股份有限公司 | Method for calculating route of navigating cities |
Also Published As
| Publication number | Publication date |
|---|---|
| CN101162150A (en) | 2008-04-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN101162150B (en) | Calculating method for searching multi-city multi-province route using framing data in networking vehicle mounted guidance apparatus | |
| JP4669659B2 (en) | How to organize map data | |
| JP6011258B2 (en) | How to create map data | |
| US6023655A (en) | Map database apparatus | |
| JP5675751B2 (en) | Techniques for structuring navigation databases. | |
| US7197500B1 (en) | System and method for use and storage of geographic data on physical media | |
| CN105758410A (en) | Method for quickly planning and mixing paths on basis of A-star algorithms | |
| CN102607578B (en) | For making method and the device of the navigation map of regional area | |
| CN101493822A (en) | Map vector data storage method in mobile phone network navigation | |
| US7783687B2 (en) | Map data product and map data processor | |
| CN102087113B (en) | Autonomous navigation method of on-board unit | |
| KR101752598B1 (en) | Geocoding and mapping system and method using address and map data | |
| JPH11174954A (en) | Map data management method, route search device, and storage medium | |
| CN104067331A (en) | Map data structure, map data creation method, and vehicle-mounted information terminal device | |
| KR102473007B1 (en) | An apparatus for searching a pedestrian path based on a green environment and a method therefor | |
| WO2017211387A1 (en) | Gateway cost data sets for fast routing | |
| JP2008233918A (en) | Map data processing apparatus | |
| CN112800154A (en) | Electronic map construction method and device and electronic map implementation method and device | |
| JP4145596B2 (en) | Map data processor | |
| JP6141173B2 (en) | Map information and map information processing device | |
| JP3841776B2 (en) | Route search device | |
| JP7260989B2 (en) | MAP INFORMATION PROVIDING DEVICE, METHOD AND PROGRAM | |
| JP4145597B2 (en) | Map data processor | |
| CN117091620B (en) | Navigation method, navigation device, computer equipment and computer readable storage medium | |
| JP3628715B2 (en) | Route search device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| CP03 | Change of name, title or address | ||
| CP03 | Change of name, title or address |
Address after: 361006 Xiamen Torch High tech Zone Software Park Innovation Building C Area 303-E, Fujian Province Patentee after: Xiamen Yaxun Zhilian Technology Co.,Ltd. Country or region after: China Address before: 361006 information building 11F, prosperous road, Huli, Fujian, Xiamen Patentee before: XIAMEN YAXON NETWORK Co.,Ltd. Country or region before: China |
