File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ def isochrones(
30
30
interval = None ,
31
31
units = None ,
32
32
location_type = None ,
33
+ options = None ,
33
34
smoothing = None ,
34
35
attributes = None ,
35
36
validate = True ,
@@ -75,6 +76,12 @@ def isochrones(
75
76
'destination' as goal. Default 'start'.
76
77
:type location_type: string
77
78
79
+ :param options: Additional options for the isochrones request. Refer to
80
+ https://openrouteservice.org/dev/#/api-docs/v2/isochrones/{profile}/post
81
+ for detailed documentation. Expects a dict(). Will be converted to JSON
82
+ automatically.
83
+ :type options: dict
84
+
78
85
:param smoothing: Applies a level of generalisation to the isochrone polygons generated.
79
86
Value between 0 and 1, whereas a value closer to 1 will result in a more generalised shape.
80
87
:type smoothing: float
@@ -129,6 +136,9 @@ def isochrones(
129
136
if attributes : # pragma: no cover
130
137
params ["attributes" ] = attributes
131
138
139
+ if options : # pragma: no cover
140
+ params ["options" ] = options
141
+
132
142
return client .request (
133
143
"/v2/isochrones/" + profile + "/geojson" ,
134
144
{},
Original file line number Diff line number Diff line change 52
52
"location_type" : "destination" ,
53
53
"attributes" : ["area" , "reachfactor" ],
54
54
"interval" : [PARAM_INT_SMALL ],
55
+ "options" : {"avoid_features" : ["highways" , "tollways" ]},
55
56
},
56
57
"distance_matrix" : {
57
58
"locations" : PARAM_LINE ,
Original file line number Diff line number Diff line change 18
18
import responses
19
19
import test as _test
20
20
from test .test_helper import ENDPOINT_DICT
21
+ import pytest
21
22
22
23
23
24
class IsochronesTest (_test .TestCase ):
@@ -39,3 +40,8 @@ def test_isochrones(self):
39
40
40
41
self .assertEqual (1 , len (responses .calls ))
41
42
self .assertEqual (resp , query )
43
+
44
+ def test_isochrones_must_fail (self ):
45
+ query = ENDPOINT_DICT ["isochrones" ]
46
+ query .update ({"foo" : {"bar" : "baz" }})
47
+ self .assertRaises (TypeError , self .client .isochrones , ** query )
You can’t perform that action at this time.
0 commit comments