@@ -14,7 +14,6 @@ Feature: Profile API version 3
1414 find_access_tag = require("lib/access").find_access_tag
1515 limit = require("lib/maxspeed").limit
1616
17-
1817 function setup()
1918 return {
2019 properties = {
@@ -23,7 +22,8 @@ Feature: Profile API version 3
2322 continue_straight_at_waypoint = true,
2423 weight_name = 'test_version2',
2524 weight_precision = 2
26- }
25+ },
26+ relation_types = Sequence { "route" }
2727 }
2828 end
2929
@@ -39,30 +39,15 @@ Feature: Profile API version 3
3939 result.forward_speed = 36
4040 result.backward_speed = 36
4141
42- for _, r in ipairs(relations) do
43- for k, v in pairs(r) do
44- print('data_' .. k .. '_value_' .. v)
45- end
42+ local rel_id_list = relations:get_relations(way)
43+ for i, rel_id in ipairs(rel_id_list) do
44+ local rel = relations:relation(rel_id)
45+ local role = rel:get_role(way)
46+ print('role_' .. role)
4647 end
4748 print ('process_way ' .. way:id() .. ' ' .. result.name)
4849 end
4950
50- function process_relation(profile, relation, result)
51- local t = relation:get_value_by_key("type")
52- if t == "route" then
53- for _, m in ipairs(relation:members()) do
54- if m:role() == "north" then
55- result[m]['direction'] = 'north'
56- print('direction_north')
57- end
58- end
59-
60- print('route_relation')
61- end
62-
63- print ('process_relation ' .. relation:id())
64- end
65-
6651 function process_turn (profile, turn)
6752 print('process_turn', turn.angle, turn.turn_type, turn.direction_modifier, turn.has_traffic_light)
6853 turn.weight = turn.angle == 0 and 0 or 4.2
@@ -103,14 +88,11 @@ Feature: Profile API version 3
10388
10489 When I run "osrm-extract --profile {profile_file} {osm_file}"
10590 Then it should exit successfully
106- And stdout should contain "process_relation"
107- And stdout should contain "route_relation"
108- And stdout should contain "direction_north"
109- And stdout should contain "data_direction_value_north"
11091 And stdout should contain "process_node"
11192 And stdout should contain "process_way"
11293 And stdout should contain "process_turn"
11394 And stdout should contain "process_segment"
95+ And stdout should contain "role_north"
11496
11597 When I route I should get
11698 | from | to | route | time |
0 commit comments