Closed sampeters1 closed 1 year ago
Cycling + Ferry
is already present under the Ferry
transportation type, example:
results = await sdk.time_map_geojson_async(
coordinates=[Coordinates(lat=41.507609, lng=-0.128315)],
departure_time=datetime.now(),
transportation=Ferry(type="cycling+ferry"),
)
Same applies to Driving + Ferry
or simply Ferry
Currently in the process of adding support for Cycling + Public Transport
Thanks for clarifying!
Support for Cycling + Public Transport
added. Will update to newest release shortly.
Under which Class is Cycling + Public Transport
present?
Cycling(type="cycling+public_transport")
gives
ValidationError: 1 validation error for Cycling type unexpected value; permitted: 'cycling' (type=value_error.const; given=cycling+public_transport; permitted=('cycling',))
while PublicTransport(type="cycling+public_transport")
results in
ValidationError: 1 validation error for PublicTransport type unexpected value; permitted: 'public_transport', 'train', 'bus', 'coach' (type=value_error.const; given=cycling+public_transport; permitted=('public_transport', 'train', 'bus', 'coach'))
I'm using traveltimepy version 3.7.0.
@sampeters1 Sorry for the late reply.
You are getting this error, because cycling+public_transport
is not implemented under the PublicTransport
or Cycling
class.
cycling+public_transport
has it's own separate class (see the picture or the code itself):
to use it, instead of PublicTransport(type="cycling+public_transport")
or Cycling(type="cycling+public_transport")
, you would simply do CyclingPublicTransport()
.
TLDR; It's under a separate CyclingPublicTransport()
class
Let me know if you have any more questions!
I'm generating isochrones via a POST request to the TravelTime API and want to set transportation to
Cycling + Ferry
andCycling + Public Transport
. However, it seems I can only select one fromPublicTransport
,Driving
,Ferry
,Walking
,Cycling
, orDrivingTrain
.Is there no support for these combined transport types in a Python POST request?