我已经npm install osrm在Ubuntu 14.04上安装了节点osrm .这已经安装了OSRM v4.9.下一步是设置OSRM.我试图按照维基中给出的步骤进行设置 -
https://github.com/Project-OSRM/node-osrm
当我跑步时,make我得到以下错误
/bin/sh: 1: [[: not found
/bin/sh: 1: echo you need pkg-config installed: not found
make: *** [pkgconfig] Error 127
Run Code Online (Sandbox Code Playgroud)
当我跑步时./Makefile,我得到以下错误
./Makefile: line 3: shell: command not found
./Makefile: line 3: TOOL_ROOT?=/lib/binding: No such file or directory
./Makefile: line 4: TOOL_ROOT: command not found
Run Code Online (Sandbox Code Playgroud)
我甚至添加了一个shebang来使用bash,因为错误似乎是由于没有使用bash
我已安装所有必需的库并具有节点v0.12
如何成功运行https://github.com/Project-OSRM/node-osrm/blob/develop/Makefile文件?
我正在尝试在 Docker 之上设置 OSRM 服务器。我需要使用 .net core 在我的微服务项目中使用 docker-compose.yml 来配置它。
version: '3.4'
services:
test_web:
image: ${DOCKER_REGISTRY-}osrmweb
build:
context: .
dockerfile: OSRM_WEB/Dockerfile
ports:
- 1111
osrm-data:
image: irony/osrm5
volumes:
- /data
osrm:
image: irony/osrm5
volumes:
- osrm-data
ports:
- 5000:5000
command: ./start.sh Sweden http://download.geofabrik.de/europe/sweden-latest.osm.pbf
Run Code Online (Sandbox Code Playgroud)
我有这个 docker-compose.yml 文件。当我运行时docker-compose up没有错误,但容器已退出。[![ ][1]][1]
我在这个网址中看不到任何回复。
https://localhost:5000/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false
Run Code Online (Sandbox Code Playgroud)
配置中还需要做什么吗?有什么建议么?[1]: https: //i.stack.imgur.com/m9BLz.png
我们创建了 .yaml 文件来在 Kubernetes 集群中部署 osrm/osrm-backend ( https://hub.docker.com/r/osrm/osrm-backend/tags )。
我们首先在节点卷中下载 pbf 文件,然后为服务创建必要的文件,最后服务启动。
您可能会在下面找到 yaml 文件:
apiVersion: v1
kind: Service
metadata:
name: osrm-albania
labels:
app: osrm-albania
spec:
ports:
- port: 5000
targetPort: 5000
name: http
selector:
app: osrm-albania
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: osrm-albania
spec:
replicas: 1
selector:
matchLabels:
app: osrm-albania
template:
metadata:
labels:
app: osrm-albania
spec:
containers:
- name: osrm-albania
image: osrm/osrm-backend:latest
command: ["/bin/sh", "-c"]
args: ["osrm-extract -p /opt/car.lua /data/albania-latest.osm.pbf && osrm-partition /data/albania-latest.osrm && osrm-customize /data/albania-latest.osrm …Run Code Online (Sandbox Code Playgroud) 下面是使用 R 中的包查找从“纽约世贸中心一号”到“纽约麦迪逊广场公园”的路线、旅行时间和旅行距离的示例osrm。(我是从R 中的 Road Routing中学到的 )。这里的行车时间是 10.37 分钟。
我想创建一个用于可视化的视频。
问:如何创建车辆(由标记表示)沿路线从“纽约世贸中心一号”移动到“纽约麦迪逊广场公园”的动画?
理想情况下,我们应该知道每个路段的速度。但是让我们假设车辆在两个位置之间以恒定速度(= 距离/时间)不停地移动。
我们也可以简单地使用tmap代替传单来创建动画。
library(sf)
library(dplyr)
library(tidygeocoder)
library(osrm)
# 1. One World Trade Center, NYC
# 2. Madison Square Park, NYC
adresses <- c("285 Fulton St, New York, NY 10007",
"11 Madison Ave, New York, NY 10010")
# geocode the two addresses & transform to {sf} data structure
data <- tidygeocoder::geo(adresses, method = "osm") %>%
st_as_sf(coords = c("long", "lat"), crs = 4326)
osroute <- …Run Code Online (Sandbox Code Playgroud) 这是关于如何创建沿路线从 A 到 B 的车辆移动动画的后续问题?. 我可以学习如何为沿路线从 A 到 B 移动的车辆设置动画。谢谢您的帮助!
但是是否可以通过添加时间线(带有显示瞬时时间和相应事件的移动标记)来制作一个自我解释的视频(对于假设的客户)。 时间线示例
例如 - 这是一个示例事件序列 -
library(sf)
library(dplyr)
library(tidygeocoder)
library(osrm)
library(lubridate)
# adresses
adresses <- c("285 Fulton St, New York, NY 10007", # One World Trade Center
"11 Madison Ave, New York, NY 10010",
"Rockefeller Center, 45 Rockefeller Plaza, New York, NY 10111")
# geocoded addresses
geocoded_addresses <- tidygeocoder::geo(adresses, method = "osm") %>%
st_as_sf(coords = c("long", "lat"), crs = 4326)
# reference time
t <- as_datetime("2021-08-23 …Run Code Online (Sandbox Code Playgroud) 我正在尝试提取 OSRM 数据但遇到麻烦。在上一个问题(尝试提取 osrm 数据时 lua error)中,我遇到了错误。所以除了 Docker 之外,我不会尝试做同样的事情。我正在使用带有硅芯片的较新 Mac。我首先安装了 Docker(https://docs.docker.com/desktop/install/mac-install/;然后在终端中docker pull osrm/osrm-backend)。我从https://download.geofabrik.de/north-america.html下载北美数据。我为实例分配了 50GB 内存以及几个核心。如果在终端中运行,docker run -t -v /Users/[name]/osrm-backend/docker:/data osrm/osrm-backend osrm-extract -p /opt/car.lua /data/north-america-latest.osm.pbf我会得到:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[info] Parsed 0 location-dependent features with 0 GeoJSON polygons
[info] Using script /opt/car.lua
[info] Input file: north-america-latest.osm.pbf
[info] Profile: car.lua
[info] Threads: 5
[info] Parsing in …Run Code Online (Sandbox Code Playgroud) 在这个Mapbox博客文章中,Lauren Budorick分享了他们如何使用OSRM开发路由引擎,该OSRM使用高程数据为骑行者提供更好的路线...... 令人惊叹!
我还想在插入外部(用户生成的)数据时探索OSRM路由的潜力,但我仍然很难掌握OSRM配置文件的工作原理.我认为我得到了一个主要的想法,即每一种方式(或节点?)都通过管道传输到一些功能中,而这些功能一直都很好地分析了这条路是多么好.
但就是这样,我脑子里有很多缺失的部分,就像Lauren在她的个人资料中使用的每个功能一样.如果有人能指出一些关于如何运作的更详细的信息,你会让我的下周更加容易:)
另外,在Lauren的帖子中,source_function她在里面加载了一个./srtm_bayarea.asc文件.那个.asc文件是什么样的?如何生成一个文件,例如,存储在pgsql数据库中的数据?我们可以使用其他格式,比如GeoJSON吗?
然后,当segment_function她使用像source.lon和那样的东西时target.lat,那些是指存储在asc文件中的原始数据吗?或者该文件是否被处理成一些标准,以映射所有内容以符合它?
正如你所看到的,我是一个完整的路由新手,也许是一般的GIS,但我想更多地了解围绕OSRM生态系统的这些标准和工具.你能和我分享一些小技巧吗?
有了ORSM,共有3种配置文件,分别用于不同的运输方式,自行车,步行和汽车。这些随OSRM一起提供。
根据1年前的以下帖子,OSRM不支持多个配置文件:
OSM路由(OSRM):是否需要为不同的配置文件复制所有数据?
但是在官方文档中,URL中有一个配置文件参数,用于从运行中的OSRM实例中检索路由:
http://project-osrm.org/docs/v5.6.4/api/#general-options
路径如下所示:
http://router.project-osrm.org/route/v1/driving/
如果没有在网址中进行驾车,步行或骑行,则不会检索到路线,因此API需要使用其中的一条路线。但是,如果我在服务器上编译汽车的路线,然后在网址中使用/ foot /来检索路线,它仍会检索基于汽车的路线,完全忽略“脚”。
OSRM的任何人都可以解释为什么撤消了多配置文件支持这样有用的功能,而上述URL中的驱动点是,无论如何它都会被忽略,而似乎只是使用附加到正在运行的OSRM实例上的配置文件?
解决多个配置文件问题的方法似乎是为每个配置文件托管路由机器的并行副本并寻址不同的IP,那么,URL中“配置文件”的意义又是什么呢?
osrm ×10
docker ×3
lua ×2
r ×2
r-sf ×2
tmap ×2
asp.net-core ×1
dockerfile ×1
ggmap ×1
installation ×1
kubernetes ×1
linux ×1
makefile ×1
node.js ×1
osm.pbf ×1
osmium ×1
r-sp ×1