traveltime-dev / traveltime-python-sdk

TravelTime SDK for Python programming language
https://docs.traveltime.com/
MIT License
19 stars 4 forks source link

time_filter_proto_async returns empty results #120

Closed kwood closed 5 days ago

kwood commented 1 month ago

Hi!

Thanks for building this great Python SDK!

I'm having trouble with the time_filter_proto_async example from the README:

In [19]:     travel_times = await sdk.time_filter_proto_async(
    ...:         origin=Coordinates(lat=51.425709, lng=-0.122061),
    ...:         destinations=[
    ...:             Coordinates(lat=51.348605, lng=-0.314783),
    ...:             Coordinates(lat=51.337205, lng=-0.315793)
    ...:         ],
    ...:         transportation=ProtoTransportation.DRIVING_FERRY,
    ...:         travel_time=7200,
    ...:         country=ProtoCountry.UNITED_KINGDOM,
    ...:         properties=[PropertyProto.DISTANCE],
    ...:     )

In [20]: print(travel_times)
travel_times=[] distances=[]

As you can see, it doesn't return any results, both for my own location data and for the data used in the README sample.

For what it's worth, the time_filter_fast_async example works fine:

In [18]:     locations = [
    ...:         Location(id="London center", coords=Coordinates(lat=51.508930, lng=-0.131387)),
    ...:         Location(id="Hyde Park", coords=Coordinates(lat=51.508824, lng=-0.167093)),
    ...:         Location(id="ZSL London Zoo", coords=Coordinates(lat=51.536067, lng=-0.153596))
    ...:     ]
    ...:
    ...:     results = await sdk.time_filter_fast_async(
    ...:         locations=locations,
    ...:         search_ids={
    ...:             "London center": ["Hyde Park", "ZSL London Zoo"],
    ...:             "ZSL London Zoo": ["Hyde Park", "London center"],
    ...:         },
    ...:         transportation=Transportation(type="public_transport"),
    ...:         one_to_many=False
    ...:     )
    ...:
    ...:     print(results)
    [TimeFilterFastResult(search_id='London center', locations=[Location(id='Hyde Park', properties=Properties(travel_time=1408, distance=None, fares=None)), Location(id='ZSL London Zoo', properties=Properties(travel_time=1690, distance=None, fares=None))], unreachable=[]), TimeFilterFastResult(search_id='ZSL London Zoo', locations=[Location(id='Hyde Park', properties=Properties(travel_time=1872, distance=None, fares=None)), Location(id='London center', properties=Properties(travel_time=1848, distance=None, fares=None))], unreachable=[])]
danielnaumau commented 1 month ago

Hi,

Unfortunately for running proto requests you need to have a specific plan, by default this feature is not available.

chris-traveltime commented 1 month ago

Hi Kevin,

If you'd like to test the proto service then please just email us at support@traveltime.com and we'll enable it on your API key.

Thanks, Chris