Skip to content

Commit 77a1219

Browse files
feat: Add support for 'maximum_speed' in directions (#84)
Co-authored-by: Kenspeckle <[email protected]> Co-authored-by: Kenspeckle <[email protected]>
1 parent 15a8a21 commit 77a1219

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

openrouteservice/directions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def directions(
4747
continue_straight=None,
4848
elevation=None,
4949
extra_info=None,
50+
maximum_speed=None,
5051
suppress_warnings=None,
5152
optimized=None,
5253
optimize_waypoints=None,
@@ -166,6 +167,9 @@ def directions(
166167
Must be a list of strings. Default None.
167168
:type extra_info: list or tuple of strings
168169
170+
:param maximum_speed: The maximum speed to drive (or walk). Default None.
171+
:type maximum_speed: int
172+
169173
:param suppress_warnings: Tells the system to not return any warning messages and corresponding extra_info.
170174
For false the extra information can still be explicitly requested by adding it with the extra_info parameter.
171175
:type suppress_warnings: bool
@@ -272,6 +276,9 @@ def directions(
272276
if extra_info:
273277
params["extra_info"] = extra_info
274278

279+
if maximum_speed is not None:
280+
params["maximum_speed"] = maximum_speed
281+
275282
if suppress_warnings is not None:
276283
params["suppress_warnings"] = suppress_warnings
277284

test/test_helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"bearings": PARAM_LIST_TWO,
3939
"skip_segments": [0, 1],
4040
"elevation": "true",
41+
"maximum_speed": 95,
4142
"extra_info": ["roadaccessrestrictions"],
4243
"optimized": "false",
4344
"continue_straight": True,

0 commit comments

Comments
 (0)