Route elevation profile (climb, descent, max grade) from the terrain tiles, and reach (isochrones) in the route panel
This commit is contained in:
1 parent
b80575828a
commit
cca985d2b9
10 files changed
+274
-26
No files matched your search
@@ -90,6 +90,16 @@ class RoutingTest < Minitest::Test
|
||||
assert_raises(Maptool::Routing::Unavailable) { Maptool::Routing.route("", [[1, 2], [3, 4]], {}) }
|
||||
end
|
||||
|
||||
def test_isochrone_asks_valhalla_for_each_time_and_checks_them
|
||||
reply = JSON.generate(type: "FeatureCollection", features: [])
|
||||
request = serve_once("HTTP/1.1 200 OK\r\nContent-Length: #{reply.bytesize}\r\n\r\n#{reply}") do |url|
|
||||
assert_equal "FeatureCollection", Maptool::Routing.isochrone(url, [17.1, 48.1], [60, 30, 60], Maptool::Routing::DEFAULT_VEHICLE)["type"]
|
||||
end
|
||||
assert_includes request, %("contours":[{"time":30},{"time":60}])
|
||||
assert_raises(Maptool::Routing::RouteError) { Maptool::Routing.isochrone("http://x", [17.1, 48.1], [600], {}) }
|
||||
assert_raises(Maptool::Routing::RouteError) { Maptool::Routing.isochrone("http://x", nil, [30], {}) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Answers one HTTP request with `response`; returns what was received.
|
||||
|
||||
Reference in new issue
Block a user