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(
3030 interval = None ,
3131 units = None ,
3232 location_type = None ,
33+ options = None ,
3334 smoothing = None ,
3435 attributes = None ,
3536 validate = True ,
@@ -75,6 +76,12 @@ def isochrones(
7576 'destination' as goal. Default 'start'.
7677 :type location_type: string
7778
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+
7885 :param smoothing: Applies a level of generalisation to the isochrone polygons generated.
7986 Value between 0 and 1, whereas a value closer to 1 will result in a more generalised shape.
8087 :type smoothing: float
@@ -129,6 +136,9 @@ def isochrones(
129136 if attributes : # pragma: no cover
130137 params ["attributes" ] = attributes
131138
139+ if options : # pragma: no cover
140+ params ["options" ] = options
141+
132142 return client .request (
133143 "/v2/isochrones/" + profile + "/geojson" ,
134144 {},
Original file line number Diff line number Diff line change 5252 "location_type" : "destination" ,
5353 "attributes" : ["area" , "reachfactor" ],
5454 "interval" : [PARAM_INT_SMALL ],
55+ "options" : {"avoid_features" : ["highways" , "tollways" ]},
5556 },
5657 "distance_matrix" : {
5758 "locations" : PARAM_LINE ,
Original file line number Diff line number Diff line change 1818import responses
1919import test as _test
2020from test .test_helper import ENDPOINT_DICT
21+ import pytest
2122
2223
2324class IsochronesTest (_test .TestCase ):
@@ -39,3 +40,8 @@ def test_isochrones(self):
3940
4041 self .assertEqual (1 , len (responses .calls ))
4142 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