OSRM避开轮渡路线

时间:2019-06-03 12:09:01

标签: lua routing openstreetmap osrm

我正在运行本地OSRM后端,并尝试自定义配置文件,以避免带有渡轮的路线,但我不太清楚应该覆盖哪些参数。

我在profiles/car.lua中为此添加了“轮渡”:

 avoid = Set {
  'area',
  -- 'toll',    -- uncomment this to avoid tolls
  'reversible',
  'impassable',
  'hov_lanes',
  'steps', 'ferry',
  'construction',
  'proposed'
},

并为此:

   access_tag_blacklist = Set {
  'no',
  'agricultural',
  'forestry',
  'emergency',
  'psv',
  'customers',
  'private',
  'delivery',
   'ferry',
  'destination'
},

-- tags disallow access to in combination with highway=service
service_access_tag_blacklist = Set {
    'private'
},

restricted_access_tag_list = Set {
  'private',
  'delivery',
  'destination',
  'customers','ferry'
},

但是在用osrm-extract --profile profiles/car.lua data/export.osm重新运行所有服务器之后,我得到了相同的结果

有什么想法可能做错了什么,或者我缺少什么?

谢谢!

1 个答案:

答案 0 :(得分:1)

ferry添加到访问标签列表将不起作用,因为ferry既不是access的有效密钥也不是有效值。相反,轮渡是route的一种特殊类型。

我对OSRM配置文件不熟悉。但是profiles/car.lua包含了轮渡路线的速度:

route_speeds = {
  ferry = 5,
  shuttle_train = 10
},

尝试将其设置为非常大的值。这样做的好处是,如果OSRM 是到达目的地的唯一选择,它将采取轮渡路线。

相关问题