isochrones = api.isochrones(
locations=(5.86659,45.26936),
profile='bicycle',
interval_type='time',
intervals=[i * 60 for i in (20,50,80,110)],
)
and asking for isochrones using the preference attribute (but no options attribute)
isochrones_shortest = api.isochrones(
locations=(5.86659,45.26936),
profile='bicycle',
interval_type='time',
intervals=[i * 60 for i in (20,50,80,110)],
preference="shortest",
)
both return the same result.
By adding dry_run=True we can see that the preference is not used :
Here's what I did and what I got
Asking for isochrones with default values
and asking for isochrones using the
preference
attribute (but nooptions
attribute)both return the same result. By adding
dry_run=True
we can see that the preference is not used :However, if you add any values in
options
, thepreference
is taken into account :Output :
Here's what I was expecting
I was expecting the
preference
parameter to be taken into account, as per the documentation, even ifoptions
is None.Here's what I think could be improved
After looking at the code and according to my understanding, in isochrones with Valhalla engine, the
preference
parameter is only read if theoptions
parameter is notNone
. See https://github.com/gis-ops/routingpy/blob/e5eb103bac330cefdb54aae23deb30f408815911/routingpy/routers/valhalla.py#L441A possible fix could be to do as with directions, and replace
if options
byif options or preference
on line 441 ; cf. https://github.com/gis-ops/routingpy/blob/e5eb103bac330cefdb54aae23deb30f408815911/routingpy/routers/valhalla.py#L232