linux - 使用 Docker 提取 Pbf 文件
问题描述
我正在尝试按照
指令状态如下
下载数据为
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
使用汽车配置文件预处理提取并在端口 5000 上启动路由引擎 HTTP 服务器
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
标志 -v "${PWD}:/data" 在 docker 容器内创建目录 /data 并使当前工作目录 "${PWD}" 在那里可用。容器内的文件 /data/berlin-latest.osm.pbf 指的是主机上的“${PWD}/berlin-latest.osm.pbf”。
但我没有将德国改为印度并下载数据文件
并将 docker 命令更改为
sudo docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/india-latest.osm.pbf
并得到错误:
terminate called after throwing an instance of 'boost::filesystem::filesystem_error' what(): boost::filesystem::status: Permission denied: "/data/india-latest.osm.pbf"
据我了解,由于某些权限问题,docker 无法提取文件。我应该怎么办?
解决方案
遵循您提到的相同步骤。我没有收到任何错误信息。您可以通过删除 docker 命令前面的 sudo 来尝试一下。
这是我看到的输出:
• • • docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/india-latest.osm.pbf
[info] Parsed 0 location-dependent features with 0 GeoJSON polygons
[info] Using script /opt/car.lua
[info] Input file: india-latest.osm.pbf
[info] Profile: car.lua
[info] Threads: 8
[info] Parsing in progress..
[info] input file generated by osmium/1.8.0
[info] timestamp: 2020-08-21T20:42:02Z
[info] Using profile api version 4
[info] Found 3 turn restriction tags:
[info] motorcar
[info] motor_vehicle
[info] vehicle
[info] Parse relations ...
[info] Parse ways and nodes ...
[info] Using profile api version 4
[info] Using profile api version 4
[info] Using profile api version 4
[info] Using profile api version 4
[info] Using profile api version 4
[info] Using profile api version 4
[info] Using profile api version 4
[info] Parsing finished after 129.569 seconds
[info] Raw input contains 126788006 nodes, 16092177 ways, and 7326 relations, 2201 restrictions
[info] Sorting used nodes ... ok, after 0.693022s
[info] Erasing duplicate nodes ... ok, after 0.097902s
[info] Sorting all nodes ... ok, after 0.20617s
[info] Building node id map ... ok, after 0.257703s
[info] Confirming/Writing used nodes ... ok, after 1.89281s
[info] Writing barrier nodes ... ok, after 0s
[info] Writing traffic light nodes ... ok, after 0s
[info] Processed 39581602 nodes
[info] Sorting edges by start ... ok, after 3.65041s
[info] Setting start coords ... ok, after 2.50387s
[info] Sorting edges by target ... ok, after 3.33254s
[info] Computing edge weights ... ok, after 8.01501s
[info] Sorting edges by renumbered start ... ok, after 3.54458s
[info] Writing used edges ... ok, after 1.30046s -- Processed 41373066 edges
[info] Writing way meta-data ... ok, after 0.011832s -- Metadata contains << 3407420 entries.
[info] Sorting used ways ... ok, after 0.010457s
[info] Collecting start/end information on 0 maneuver overrides...ok, after 0.039794s
[info] Collecting start/end information on 0 maneuver overrides...ok, after 0s
[info] Collecting start/end information on 2201 restrictions...ok, after 0.083874s
[info] Collecting start/end information on 2201 restrictions...ok, after 0.00159s
[info] writing street name index ... ok, after 0.002164s
[info] extraction finished after 155.758s
[info] Generating edge-expanded graph representation
[info] . 10% . 20% . 30% . 40% . 50% . 60% . 70% . 80% . 90% . 100%
[info] Node compression ratio: 0.148128
[info] Edge compression ratio: 0.185013
[info] graph compression removed 3348686 annotations of 3407420 in 2.54008 seconds
[info] Find segregated edges in node-based graph ...
[info] ok, after 22.5332s
[info] Segregated edges count = 97299
[info] Writing nodes for nodes-based and edges-based graphs ...
[warn] Clipped 12 segment weights to 4194302
[info] Geometry successfully removed:
compressed edges: 15309100
compressed geometries: 82748654
longest chain length: 8194
cmpr ratio: 0.185007
avg chain length: 5.40519
[info] Generating edge expanded nodes ...
[info] . 10% . 20% . 30% . 40% . 50% . 60% . 70% . 80% . 90% . 100%
[info] Expanding via-way turn restrictions ...
[info] . 10% . 20% . 30% . 40% . 50% . 60% . 70% . 80% . 90% . 100%
[info] Generated 14948742 nodes (236 of which are duplicates) and 41373000 segments in edge-expanded graph
[info] Generating edge-expanded edges
[info] [warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 631957, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=12.313006&mlon=75.129656
[warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 1025431, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=11.225002&mlon=72.773843
[warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 1025431, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=11.225002&mlon=72.773843
[warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 1025431, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=11.225002&mlon=72.773843
[warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 1025431, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=11.225002&mlon=72.773843
.[info] Using profile api version 4
[info] Using profile api version 4
10% [warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 4318270, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=9.949453&mlon=77.181601
.[warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 7481554, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=11.488963&mlon=73.002006
20% . 30% . 40% . 50% .[warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 22139276, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=15.541327&mlon=77.926129
60% . 70% .[warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 31183234, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=16.298204&mlon=81.05196
80% . 90% .[warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 38391257, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=28.610931&mlon=77.052052
[warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 38392328, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=30.720227&mlon=76.677209
[warn] Turn is a u turn but not turning to the first connected edge of the intersection. Node ID: 39135596, OSM link: http://www.openstreetmap.org/?zoom=18&mlat=23.402787&mlon=81.358654
[info] Sorting and writing 0 maneuver overrides...
[info] done.
[info] Renumbering turns
[info] Writing 0 conditional turn penalties...
[info] Generated 41373000 edge based node segments
[info] Node-based graph contains 14830339 edges
[info] Edge-expanded graph ...
[info] contains 30138979 edges
[info] Timing statistics for edge-expanded graph:
[info] Renumbering edges: 0.499508s
[info] Generating nodes: 5.43434s
[info] Generating edges: 45.995s
[info] Generating guidance turns
[info] . 10% . 20% . 30% . 40% . 50% . 60% . 70% . 80% . 90% .
[info] done.
[info] Created 119 entry classes and 19951 Bearing Classes
[info] Handled: 51 of 3324 lanes: 1.5343 %.
[info] Assigned 33989015 turn instruction types:
[info] new name: 483158 (1.42%)
[info] continue: 1414398 (4.16%)
[info] turn: 14280460 (42.01%)
[info] merge: 26879 (0.08%)
[info] on ramp: 11842 (0.03%)
[info] off ramp: 10722 (0.03%)
[info] fork: 131054 (0.39%)
[info] end of road: 6390775 (18.80%)
[info] notification: 618 (0.00%)
[info] enter roundabout: 11530 (0.03%)
[info] enter and exit roundabout: 1149 (0.00%)
[info] enter rotary: 1176 (0.00%)
[info] enter and exit rotary: 126 (0.00%)
[info] enter roundabout turn: 2333 (0.01%)
[info] (noturn): 328976 (0.97%)
[info] (suppressed): 10856840 (31.94%)
[info] roundabout: 28 (0.00%)
[info] exit roundabout: 12393 (0.04%)
[info] rotary: 9 (0.00%)
[info] exit rotary: 1258 (0.00%)
[info] exit roundabout turn: 2362 (0.01%)
[info] (stay on roundabout): 15433 (0.05%)
[info] (sliproad): 5496 (0.02%)
[info] Assigned 33989015 turn instruction modifiers:
[info] uturn: 1376359 (4.05%)
[info] sharp right: 481487 (1.42%)
[info] right: 9817870 (28.89%)
[info] slight right: 626400 (1.84%)
[info] straight: 10569160 (31.10%)
[info] slight left: 631180 (1.86%)
[info] left: 10001525 (29.43%)
[info] sharp left: 485034 (1.43%)
[info] Guidance turn annotations took 37.1287s
[info] Writing Intersection Classification Data
[info] ok, after 0.157749s
[info] Writing Turns and Lane Data...
[info] ok, after 0.105888s
[info] Saving edge-based node weights to file.
[info] Done writing. (0.101336)
[info] Computing strictly connected components ...
[info] Found 23696 SCC (6 large, 23690 small)
[info] SCC run took: 1.06626s
[info] Building r-tree ...
[info] Constructing r-tree of 41373000 segments build on-top of 39581602 coordinates
[info] finished r-tree construction in 6.08963 seconds
[info] Writing edge-based-graph edges ...
[info] ok, after 8.46229s
[info] Processed 30138979 edges
[info] Expansion: 211195 nodes/sec and 79762 edges/sec
[info] To prepare the data for routing, run: ./osrm-contract "/data/india-latest.osrm"
[info] RAM: peak bytes used: 10818285568
推荐阅读
- javascript - 如果提供的选择不是石头、纸、剪刀,如何添加错误警报?如何使整个代码更短?
- php - AJAX/PHP Uncaught ReferenceError: data is not defined
- sql - 选择查询中不必要的 1=1
- python - 扫雷,显示空单元格和所有其他空单元格逻辑和 python
- angular - Ionic keyboard.isVisible 属性不能正确控制元素的可见性
- c# - DataGridView 双缓冲在哪里调用
- reactjs - React:将每 3 个组件包装成一个 div
- makefile - 从另一个目标的结果构造一个目标
- python-3.x - pyAudio 不起作用 - OSError: [Errno -9999] 意外的主机错误
- javascript - React update a var 添加两个状态