简体   繁体   English

我可以构建供离线使用的开源路由机器吗?

[英]Can I build the Open Source Routing Machine for Offline Use?

I'm planning to create a trajectory generator for an autonomous vehicle, and I want to extract the trajectory from OSRM. 我打算为自动驾驶汽车创建轨迹生成器,并且我想从OSRM中提取轨迹。 I've already exported the OSM map I want to work on (about ~300h and has well defined roads) and I've also prepared the OSRM back-end in my Linux. 我已经导出了我想处理的OSM映射(大约300h,并且道路清晰),并且我还在Linux中准备了OSRM后端。

Is there a way that I can have an interface (offline) and extract the trajectory (lines and angles) that the routing machine outputs? 有没有办法让我有一个界面(离线)并提取路由机输出的轨迹(直线和角度)?

Any assistance on this question will do. 在这个问题上的任何帮助都可以。 Thank you very much. 非常感谢你。

You can build OSRM backend in your own machine, see instructions here . 您可以在自己的计算机上构建OSRM后端,请参见此处的说明。

When you calculate a route between two points (viaroute service), the server response by default sets to true the parameter geometry, where you have the trajectory of the route. 当计算两点之间的路线时(通过路线服务),默认情况下,服务器响应会将参数几何设置为true,在该位置您具有路线的轨迹。 If you want to know how to parse the JSON answer and the geometry, have a look as an example to the implementation of the frontend of OSRM . 如果您想知道如何解析JSON答案和几何图形,请看一下OSRM前端实现的示例。 Take also into account that the geometry of the route is returned by default compressed (geometry is a list of [lat, lng] pairs). 还应考虑默认情况下压缩返回的路线的几何形状(几何形状是[lat,lng]对的列表)。

Cheers! 干杯!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM