首页 > 其他分享 >osrm 使用

osrm 使用

时间:2024-04-08 09:44:25浏览次数:6  
标签:turn penalties osrm 使用 thailand data latest

osrm-extract

osrm 第一步,将 osm.pbf 文件取出来需要用的数据

docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-extract -p /opt/car.lua /data/thailand-latest.osm.pbf || echo "osrm-extract failed"

执行前数据

➜  Data ls
thailand-latest.osm.pbf

执行后文件目录

➜  Data ls
thailand-latest.osm.pbf                      thailand-latest.osrm.names
thailand-latest.osrm.cnbg                    thailand-latest.osrm.nbg_nodes
thailand-latest.osrm.cnbg_to_ebg             thailand-latest.osrm.properties
thailand-latest.osrm.ebg                     thailand-latest.osrm.ramIndex
thailand-latest.osrm.ebg_nodes               thailand-latest.osrm.restrictions
thailand-latest.osrm.edges                   thailand-latest.osrm.timestamp
thailand-latest.osrm.enw                     thailand-latest.osrm.tld
thailand-latest.osrm.fileIndex               thailand-latest.osrm.tls
thailand-latest.osrm.geometry                thailand-latest.osrm.turn_duration_penalties
thailand-latest.osrm.icd                     thailand-latest.osrm.turn_penalties_index
thailand-latest.osrm.maneuver_overrides      thailand-latest.osrm.turn_weight_penalties

osrm-partition(mld)

分区

docker run -t -v "${PWD}:/data" --name=osrm-partition ghcr.io/project-osrm/osrm-backend osrm-partition /data/thailand-latest.osrm || echo "osrm-partition failed"

执行后文件目录

➜  Data ls
thailand-latest.osm.pbf                      thailand-latest.osrm.names
thailand-latest.osrm.cells                   thailand-latest.osrm.nbg_nodes
thailand-latest.osrm.cnbg                    thailand-latest.osrm.partition
thailand-latest.osrm.cnbg_to_ebg             thailand-latest.osrm.properties
thailand-latest.osrm.ebg                     thailand-latest.osrm.ramIndex
thailand-latest.osrm.ebg_nodes               thailand-latest.osrm.restrictions
thailand-latest.osrm.edges                   thailand-latest.osrm.timestamp
thailand-latest.osrm.enw                     thailand-latest.osrm.tld
thailand-latest.osrm.fileIndex               thailand-latest.osrm.tls
thailand-latest.osrm.geometry                thailand-latest.osrm.turn_duration_penalties
thailand-latest.osrm.icd                     thailand-latest.osrm.turn_penalties_index
thailand-latest.osrm.maneuver_overrides      thailand-latest.osrm.turn_weight_penalties

多了thailand-latest.osrm.cells 和 thailand-latest.osrm.partition 俩文件

osrm-customize(mld)

合并

docker run -t -v "${PWD}:/data" --name=osrm-customize ghcr.io/project-osrm/osrm-backend osrm-customize /data/thailand-latest.osrm || echo "osrm-customize failed"

执行后目录

➜  Data ls
thailand-latest.osm.pbf                      thailand-latest.osrm.mldgr
thailand-latest.osrm.cell_metrics            thailand-latest.osrm.names
thailand-latest.osrm.cells                   thailand-latest.osrm.nbg_nodes
thailand-latest.osrm.cnbg                    thailand-latest.osrm.partition
thailand-latest.osrm.cnbg_to_ebg             thailand-latest.osrm.properties
thailand-latest.osrm.datasource_names        thailand-latest.osrm.ramIndex
thailand-latest.osrm.ebg                     thailand-latest.osrm.restrictions
thailand-latest.osrm.ebg_nodes               thailand-latest.osrm.timestamp
thailand-latest.osrm.edges                   thailand-latest.osrm.tld
thailand-latest.osrm.enw                     thailand-latest.osrm.tls
thailand-latest.osrm.fileIndex               thailand-latest.osrm.turn_duration_penalties
thailand-latest.osrm.geometry                thailand-latest.osrm.turn_penalties_index
thailand-latest.osrm.icd                     thailand-latest.osrm.turn_weight_penalties
thailand-latest.osrm.maneuver_overrides

又多了几个文件

osrm-contract(ch)

计算

docker run -t -v $(pwd):/data ghcr.io/project-osrm/osrm-backend osrm-contract /data/thailand-latest.osrm || echo "osrm-contract failed"

执行后

thailand-latest.osm.pbf                      thailand-latest.osrm.maneuver_overrides
thailand-latest.osrm.cnbg                    thailand-latest.osrm.names
thailand-latest.osrm.cnbg_to_ebg             thailand-latest.osrm.nbg_nodes
thailand-latest.osrm.datasource_names        thailand-latest.osrm.properties
thailand-latest.osrm.ebg                     thailand-latest.osrm.ramIndex
thailand-latest.osrm.ebg_nodes               thailand-latest.osrm.restrictions
thailand-latest.osrm.edges                   thailand-latest.osrm.timestamp
thailand-latest.osrm.enw                     thailand-latest.osrm.tld
thailand-latest.osrm.fileIndex               thailand-latest.osrm.tls
thailand-latest.osrm.geometry                thailand-latest.osrm.turn_duration_penalties
thailand-latest.osrm.hsgr                    thailand-latest.osrm.turn_penalties_index
thailand-latest.osrm.icd                     thailand-latest.osrm.turn_weight_penalties

osrm-routed

提供服务
mld

docker run -t -i --name=osrm-routed-mld -p 6010:5000 -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-routed --algorithm mld /data/thailand-latest.osrm

ch

docker run -d -t -i -p 6020:5000 -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-routed --algorithm ch /data/thailand-latest.osrm || echo "osrm-touted failed"

问题

2024-03-01 的 osm 数据有问题,解压失败,后面再查

参考

https://afi.io/blog/introduction-to-osrm-setting-up-osrm-backend-using-docker/
https://medium.com/logistimo-engineering-blog/osrm-data-generation-and-deployment-2f5a66269342
https://github.com/Project-OSRM/osrm-backend/wiki/Traffic

标签:turn,penalties,osrm,使用,thailand,data,latest
From: https://www.cnblogs.com/elve960520/p/18120450

相关文章

  • 面试官:Zookeeper是什么,它有什么特性与使用场景?
    一、前言作为一名Java程序员,Zookeeper底层的一些原理是我们不必学会就可以搬砖工作的一种技能点,但是小奇为什么还要讲一下呢?难道就是为了浪费大家1分钟的宝贵时间,一个人1分钟,50万人就是1年,5000万人就是100年,赚了,小奇以一己之力成功搞挂一个人(血赚)。当然不是,并且小奇的文章......
  • 使用 AI 生成正则表达式,告别正则烦恼
    如果你有处理正则表达式的需求,那么这个网站(autoregex.xyz)一定要收藏好。可以根据文字描述生成正则表达式。默认是从文字到正则,不用选择。输入框中输入描述,点击”GO“按钮。等待一会儿,即可生成正则表达式。还可以解析给定的正则,说明其含义。切换成从正则到文字,然......
  • 使用微信小程序开发制作一个简易的在线预约应用
    微信小程序在线预约应用的开发可以分为以下几个步骤:项目初始化首先,我们需要在微信开发者工具中创建一个新的小程序项目。在创建项目时,可以选择使用小程序官方提供的模板,也可以选择自己从零开始开发。创建完成后,可以在项目目录下看到一些默认的文件和目录,如app.json、app.js......
  • 使用微信小程序开发制作一个简易的在线投票应用
    代码案例:微信小程序在线投票应用本案例将使用微信小程序开发工具进行开发,实现一个简易的在线投票应用。该应用的主要功能包括创建投票、参与投票、查看投票结果等。创建投票用户可以输入投票主题、选项以及投票截止日期来创建一个新的投票。首先,在小程序的页面目录中创建一......
  • 绿联 安装Frpc内网穿透并使用Nginx反向代理
    绿联安装Frpc内网穿透并使用Nginx反向代理1、前言服务器官网:雨云-新一代云服务提供商本教程使用Frps与Frpc进行内网穿透,其中Frps需要自购服务器安装,若无法购买服务器则本教程对你无用;另外还需拥有自己的域名,雨云免费二级域名好像不能申请证书;推荐购买国内的主机,使......
  • Linux 使用 crontab 定时拆分日志、清理过期文件
    @目录前言简介一、准备工作1.1创建写入脚本1.2设置执行权限1.3添加定时任务1.4配置生效二、Tomcat日志按每天分割2.1创建一个sh文件2.2设置执行权限2.3设置crontab指令,指定每日定时任务2.4配置生效总结前言请各大网友尊重本人原创知识分享,谨记本人博客:南国以南i、......
  • 驾驭数据的能力,如同使用ChatGPT一样,是现代职场人的必修课
    现代职场所比拼的除了聪明才智、过往经验之外,很多软性技能也尤为重要。现在已经不是像网络游戏开局拿着一根小木棍打天下的时代了,这将是一场武装到牙齿的较量,对于各类“装备”的驾驭能力有时候甚至可以决定胜负。ChatGPT是提升职场人工作效率的绝佳装备,相关的介绍已经很多,今天我......
  • sql server 分页语句OFFSET 和 FETCH NEXT 怎样使用?
    原文链接:https://blog.csdn.net/weixin_45659376/article/details/107336143在SqlServer2012之前,实现分页主要是使用ROW_NUMBER(),在SQLServer2012,可以使用Offset...RowsFetchNext...Rowsonly的方式去实现分页数据查询。在OrderBy子句中新增Offset-Fetch子句,用于从有......
  • 记一次在使用Asp.Net Core 8.0 中使用Entity Framework Core的Api控制器生成Rest Api
    问题描述:把实体模型建好了,数据上下文也建好了,数据库连接字符串也在appsetting.json中配置好了,服务也注入了,然后不想一个一个的写控制器的方法,想用Api控制器生成现成的CURD方法,结果一连串的报错,在网上和GitHub也看了各位的解决办法,但都是以失望的报错,现在将解决问题的方法如下。1......
  • 图像隐写工具steghide的介绍与使用
    下载下载地址windows:https://sourceforge.net/projects/steghide/下载方式kalilinux:aptinstallsteghide简介可以在jpeg、bmp、wmv、au文件中隐写信息的软件用法#将隐藏信息从载体中分离出来steghideextract-sf待提取信息的图片.jpg-p123456#-sf后面放待提取......