GraphHopper如何处理高速公路交叉口上的点?

编程入门 行业动态 更新时间:2024-10-22 14:31:08
本文介绍了GraphHopper如何处理高速公路交叉口上的点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在比利时有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).

推荐答案

一些想法:

  • 您可以通过MapDB或磁盘将这些距离存储在堆外或盘上 GraphHopper其简单的DataAccess实现使其与RAM无关
  • 您可以使用浮点数,它应该只有〜30MB甚至很短,仅用公里数即可.
  • 您可以尝试按需路由,而无需存储,因为它只需几毫秒即可计算出一条路由.禁用指令,计算点数使其速度提高两倍.您甚至可以禁用计算距离,而仅使用path.weight-这将为您带来另一个良好的加速效果,但需要使用较低级别的GraphHopper,并且仅在知道您的操作后才建议使用.
  • you can store those distances off-heap or on-disc via MapDB or GraphHopper its simplistic DataAccess implementations making it RAM-independent
  • you can use float which should be only ~30MB or even short and just use the kilometers
  • you could try on demand routing, without storing, as it takes only a few ms to calculate a route. Disable instructions and calculating points makes it even twice as fast. You could even disable calculating the distance and just use path.weight - this will give you another good speedup but requires a bit lower level GraphHopper usage and is only recommended if you know what you do.
  • 现在是您的问题. 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如何处理高速公路交叉口上的点?

    本文发布于:2023-10-29 08:07:30,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1539167.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:交叉口   如何处理   高速公路   GraphHopper

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!