如何使用我自己的多模式图形快速启动Graphhopper [英] How to Quickstart Graphhopper with my own multimodal graph

查看:216
本文介绍了如何使用我自己的多模式图形快速启动Graphhopper的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在play框架中实现我自己的路由web服务(由于它是java,它是一个快速原型框架)。我还希望使用graphhopper作为路由引擎。



我的基本要求是:


  • 路由应基于我们自己的多模式图数据库(包括EDGES / LINKS和NODES以及不同的属性以从
  • 派生权重)我希望能够在运行期间为边权加权选择不同的属性(即紧急车辆可以采用路线,不允许使用普通的卡片机)

  • 图形分布在奥地利的一半大小(大约800.000边缘)。


目前我有很多问题,并不知道从哪里开始:


  1. 仅使用EncodingManager定义运输车辆类型,还是可以在路线期间更改它(无需在运行时重新生成图形)
  2. 什么是d RAMDataAccess和MMapDataAccess之间的区别?后者是否意味着图形(部分)存储在光盘上?第一个是否意味着该图只存储在内存中?

  3. 我不了解EDGE对象的NextA和NextB属性...有3个或更多EDGE的交叉点是什么?哪一个是来自其他每一个的NextB?

  4. 是否...其中nodeA始终小于nodeB ...意味着ID一直较小?图表方向(即EDGE指向另一个方向)怎么样?

  5. 更多提出的问题....

我到目前为止所做的是:


  • graphhopper文档从开发人员片段和低级API 开始,但是它说这是过时的?!?! (这是什么意思?)我还检查了graphhopper github存储库的web子文件夹,但是现在只有基于即时可用的graphhopper webservice对于那些内置的OSM数据。

  • strong>感谢提示查看单元测试,我想我会找到mor)




我非常感谢这里的任何人,如果权重参数改变,谁可以给我一些例子来建立自己的图形并使用(或者重建它)?



编辑:试图让我的观点更清晰

解决方案


在运行期间为我们的数据库选择不同的边缘权重属性


如果要在运行时选择权重你应该避免触发ex ternal数据库。它会放缓一切。而是将您拥有的权重输入GraphHopperStorage本身。每一条边都是一张大桌子上的一排。只需为每个需要的权重添加一列:

  E_CUSTOM_WEIGHT = nextEdgeEntryIndex(); 




图形分布在奥地利的一半大小(约800.000边)

不确定您对多模式图表(也是时间依赖性的?)。如果正常的路网800k不多。整个德国是十倍大,适合1gb以下

关于快速入门。只有低级API的wiki已过时。查看当前使用情况的LocationIndexTree的单元测试。 (也许你可以在之后更新wiki:))


不幸的是,我找不到任何更全面的例子,包括用MMapDataAccess构建一个图。 / p>

您只需更改配置,或者您更喜欢低级API:

  graph = new GraphHopperStorage(new MMapDirectory(),encodingManager)




这里的任何人都可以给我举例说明如何构建我自己的图并重建它,当权重参数发生变化时。

查看单元测试。很多示例如何构建图。随着'重建' - 你是什么意思?你的意思是CH准备?如果你想在运行时计算重量,CH准备是不可能的。


I would like to implement my own routing web service in play framework (due to the fact that it's java and it's a rapid prototyping framework). I also would like to use graphhopper as the routing engine.

My Basic requirements are:

  • The routing should be based on our own multimodal graph database (consisting of EDGES/LINKS and NODES and also different properties to derive weights from
  • I want to be able to select different properties for edge weighting during runtime (i.e. an emergency vehicle can take routes, normal cardrivers aren allowedto use)
  • The graph spreads over half the size of austria (approx. 800.000 edges).

At the moment I have a lot of questions, and don't really know where to begin:

  1. Is the transport vehicle type defined with EncodingManager only, or is it possible to change it during a route? (without rebuilding the graph while runtime)
  2. Whats exactly the difference between RAMDataAccess and MMapDataAccess? Does the latter mean, that the graph is (partly) stored on disc? Does the first mean the graph is only stored in Memory?
  3. I dont understand the NextA and NextB Properties of the EDGE object...what about crossings with 3 or more EDGEs? Which one is NextB from each of the other ones?
  4. Does "...where nodeA is always smaller than nodeB..." mean that the ID has always to be smaller? What about graph direction (i.e. an EDGE pointing to the other direction)?
  5. More questions to come up....

What I did so far:

  • I was going through the graphhopper docs starting with the developer snippets and the low level API but on th page it says that this is outdated?!?! (What does that mean?)

  • I also checked the web subfolder of the graphhopper github repository, but there is only a ready-to-use graphhopper webservice based on OSM data built in there.

  • Unfortunately I could not find any more comprehensive example including building a graph with MMapDataAccess (edit thanks for the tip to look into the unit tests, I think I'll find mor there)

I'd be very grateful to anybody here, who could please give me some examples how to build up my own graph and use (or rebuild it?) when weighting parameters change.

EDIT: tried to make my points clearer

解决方案

select different properties for edge weighting during runtime out of our database

If you want to select the weighting at runtime you should avoid triggering an external database. It will slowdown everything. Instead feed the weights you have into the GraphHopperStorage itself. Every edge is a row in a big table. Just add one more column per weight you need:

E_CUSTOM_WEIGHT = nextEdgeEntryIndex();

The graph spreads over half the size of austria (approx. 800.000 edges)

Not sure what you mean with multimodal graph (also timedependent?). If normal road network 800k is not much. Whole germany is ten times large and fits into under 1gb

Regarding quickstart. Just the wiki for the low level API is outdated. Have a look into the unit tests of LocationIndexTree for the current usage. (maybe you can update the wiki afterwards :))

Unfortunately I could not find any more comprehensive example including building a graph with MMapDataAccess.

you just change the config or if you prefer low level API:

graph = new GraphHopperStorage(new MMapDirectory(), encodingManager)

Anybody here can give me some examples how to build up my own graph and rebuild it,when weighting parameters change.

have a look into the unit tests. Lots of examples how to build a graph. With 'rebuilding' - what do you mean? Do you mean the CH preparation? CH preparation is not possible if you want to calculate weight at runtime.

这篇关于如何使用我自己的多模式图形快速启动Graphhopper的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆