[英]How can I create an OSRM file from geojson data?
I have a geojson datafile containing highway=footway
paths, and I'd like to use OSRM to find routings between multiple points (ie, not just the most efficient path from A to B, but something like the travelling salesman).我有一个包含highway=footway
路径的 geojson 数据文件,我想使用 OSRM 来查找多个点之间的路线(即,不仅是从 A 到 B 的最有效路径,还包括旅行推销员之类的路径)。
From the OSRM documentation , I see that to use custom data rather than data from OpenStreetMap I would need an OSRM file, which I can apparently make "by running the OSRM binaries [shipped] in node_modules/osrm/lib/binding/ and default profiles".从OSRM 文档中,我看到要使用自定义数据而不是来自 OpenStreetMap 的数据,我需要一个 OSRM 文件,我显然可以“通过在 node_modules/osrm/lib/binding/ 和默认配置文件中运行 OSRM 二进制文件 [shipped] 来制作” ”。
I find that very vague and I don't know how to proceed.我觉得这很模糊,我不知道如何继续。 The documentation linked above refers to the OSRM-backend documentation, but I didn't find anything related to creating OSRM files there.上面链接的文档是指 OSRM 后端文档,但我没有找到与在那里创建 OSRM 文件相关的任何内容。 I got the node_modules/osrm
directory through npm, but there's nothing in the osrm/lib/binding
directory...我通过npm得到了node_modules/osrm
目录,但是osrm/lib/binding
目录下什么都没有……
How can I proceed to use my data for OSRM routing?如何继续使用我的数据进行 OSRM 路由? Or if there is an easier solution to what I'm trying to implement, what would it be?或者,如果有一个更简单的解决方案来解决我要实施的问题,那会是什么?
I was able to create an osrm file by following this "pipeline":我能够按照这个“管道”创建一个 osrm 文件:
$ osmconvert64 intput_file.osm --fake-author -o=output_file.osm
$ osmosis --rx input_file.osm --wb output_file.osm.pbf omitmetadata=true
$ docker run -t -v "absolute/path/to/data":/data osrm/osrm-backend osrm-extract -p /opt/profile.lua /data/file_name.osm.pbf
$ docker run -t -v "absolute/path/to/data":/data osrm/osrm-backend osrm-contract /data/file_name.osrm
data
directory and the absolute path to data should link to that directory.对于 docker 步骤,您必须创建一个data
目录,并且数据的绝对路径应链接到该目录。osrm-extract
input as for the osrm-contract
output, as OSRM will make some other files using that name, which it will try to find in the contract step. osrm-extract
输入使用的 file_name 必须与osrm-contract
输出相同,因为 OSRM 将使用该名称创建一些其他文件,它将尝试在合同步骤中找到这些文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.