Closed SergeyAnufriev closed 1 year ago
Because some locations cannot be reached with the specified transportation type and travel time. If you change public transport to driving, most of them will become reachable.
Plus I strongly recommend not to leave API keys in a public repository.
Please explain why some locations can not be reached
from traveltimepy import TravelTimeSdk, PublicTransport, Property, Location, Coordinates import asyncio from datetime import datetime
home_location = Location(id='47', coords=Coordinates(lat=52.590357, lng=-1.808594))
not_reachable = [Location(id='x1', coords=Coordinates(lat=53.022800, lng=-2.601700)), Location(id='x2', coords=Coordinates(lat=52.361301, lng=-0.120953)), Location(id='x3', coords=Coordinates(lat=50.436962, lng=-4.259314)), Location(id='x4', coords=Coordinates(lat=52.361301, lng=-0.120953))]
locations = [home_location] + not_reachable search_ids = {'47': ['x1', 'x2', 'x3', 'x4']}
async def main():
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) asyncio.run(main())
program output:
[TimeFilterResult(search_id='47', locations=[], unreachable=['x1', 'x2', 'x3', 'x4'])]
Process finished with exit code 0