我在比利时有2750个市中心.我需要知道每两个城市中心之间的距离. 但这导致了57MB的矩阵,只是为了记住这些距离(甚至不包括路线),因此可以进行大规模扩展.
I have 2750 city centers in Belgium. I need to know the distances between every 2 city centers. But that results in an matrix of 57MB, just to remember those distances (not even the routes), so that scales terribly.
相反,我正在考虑使用公路交叉口作为枢纽.基本上,每个城市都知道附近的城市和附近的枢纽(=公路交叉点).所有集线器都知道彼此的距离.
Instead, I am looking at using Highway intersections as hubs. Basically, every city knows it's nearby cities and it's nearby hubs (= highway intersection). All hubs know the distance to each other.
因此,可以通过cityA -> hubX -> hubY -> cityB的距离来计算从一个城市A到另一个非邻近城市B的距离.因为大多数城市通常在附近有3个枢纽,所以我可能需要查看所有9种组合并以最短的组合.但无论如何,它应该明智地扩展内存.
So the distance from 1 city A to another non-nearby city B, can be calculated by the distance of cityA -> hubX -> hubY -> cityB. Because most cities have typically 3 hubs nearby, I might need to look at all 9 combinations and take the shortest. But in any case it should scale better memory wise.
现在的问题是: 我可以将高速公路交叉口描述为一个点吗?考虑一下:高速公路由2条道路组成(双向),所以高速公路交叉点中心有4条道路(甚至不算武器)
Now the problem: Can I describe a highway intersection as a single point? Think about it: a highway consist of 2 roads (one in both direction), so a highway intersection center has 4 roads (not even counting the arms).
推荐答案一些想法:
现在是您的问题. GraphHopper使用图模型,该图模型由节点(结)和边(连接结的街道)组成.环形交叉路口仍由多个节点组成.但总的来说,应该可以将离开"节点用作"hub-id".
Now to your question. GraphHopper uses a graph model consisting of nodes (junctions) and edges (streets connecting junctions). Still a roundabout consists of multiple nodes. But in general it should be possible to use such a 'leaving' node as 'hub-id'.
我看到了两种计算这些节点的方法:
I see two approaches to calculate those nodes:
- 通过运行收缩层次结构"并选择最高的1000个节点并将它们定义为集线器,这类似于在运输节点路由'论文
- 或者您计算从一个城市到例如所有其他城市(或仅8个地理方向)并找到两条路线的最后一个公共节点以识别一些
- either by running the Contraction-Hierarchy and picking the highest 1000 nodes and define them as hubs - this would be similar to what is described in the 'transit node routing' paper
- or you calculate routes from one city to e.g. all other cities (or just 8 geographic directions) and find the last common nodes of two routes to identify some
对于这两种方法,您都必须对GraphHopper进行更深入的研究,并且可能需要较低级别的API .
For both approaches you'll have to digg a bit deeper into GraphHopper and you'll probably need the lower level API.
更多推荐
GraphHopper如何处理高速公路交叉口上的点?
发布评论