Navigation: arrived 30 m from the end (banner, drive mode), navigating on past it (the reroute turns back); the next maneuver's lanes from 1 km or 45 s at the speed driven, in drive mode a cell under the maneuver over the map ("ahead" in the profile, shown only with something in it) with the next traffic signal; signals with no route: /api/road also routes 1.5 km straight on from the last fix and gives that way's signals, the nearest one in front shown. TODO: the CAN GNSS follow done (the LTE tracker a layer to switch on), any tracker point followable later
This commit is contained in:
1 parent
ad975bcf62
commit
a6158f4083
7 files changed
+110
-15
No files matched your search
@@ -170,6 +170,17 @@ class RoutingTest < Minitest::Test
|
||||
assert_raises(Maptool::Routing::RouteError) { Maptool::Routing.road("http://x", [[17.1, 48.1]]) }
|
||||
end
|
||||
|
||||
def test_the_road_gives_the_signals_ahead_from_a_route_straight_on
|
||||
http = ->(body) { "HTTP/1.1 200 OK\r\nContent-Length: #{body.bytesize}\r\n\r\n#{body}" }
|
||||
road = JSON.generate(edges: [{ names: ["B"], road_class: "primary" }])
|
||||
route = JSON.generate(trip: { legs: [{ shape: "wdg|xA{ubdQc@w@" }] })
|
||||
along = JSON.generate(admins: [{ country_code: "SK" }], edges: [{ length: 0.4, end_shape_index: 1, end_node: { traffic_signal: true, admin_index: 0 } }])
|
||||
request = serve_once(http[road], http[route], http[along]) do |url|
|
||||
assert_equal [0.4], Maptool::Routing.road(url, [[17.1, 48.1], [17.1, 48.2]])[:signals].map(&:last)
|
||||
end
|
||||
assert_includes request, %("heading":0,"heading_tolerance":45)
|
||||
end
|
||||
|
||||
def test_bicycle_and_foot_use_their_own_costing_without_the_country_lookup
|
||||
reply = JSON.generate(trip: { summary: { length: 1.5, time: 90 }, legs: [{ shape: "wdg|xA{ubdQc@w@", maneuvers: [] }] })
|
||||
request = serve_once("HTTP/1.1 200 OK\r\nContent-Length: #{reply.bytesize}\r\n\r\n#{reply}") do |url|
|
||||
|
||||
Reference in new issue
Block a user