import openrouteservice
from openrouteservice.directions import directions
client = openrouteservice.Client(key='xxxxxxxx') # Specify your personal API key
rootTrain=[]
rootTest=[]
train=train[['Order No', 'Pickup Long','Pickup Lat','Destination Long','Destination Lat']]
test=test[['Order No', 'Pickup Long','Pickup Lat','Destination Long','Destination Lat']]
for i in train.index:
coords=((train.at[i,'Pickup Long'],train.at[i,'Pickup Lat']),(train.at[i,'Destination Long'],train.at[i,'Destination Lat']))
rootTrain.append(directions(client, coords))
train['root']=rootTrain
for i in test.index:
coords=((test.at[i,'Pickup Long'],test.at[i,'Pickup Lat']),(test.at[i,'Destination Long'],test.at[i,'Destination Lat']))
#test.at[i,'route']=directions(client, coords)
rootTest.append(directions(client, coords))
test['root']=rootTest
You should only loop over unique Pickup/Destinatoin Lat/Long combinations, it'll save you thousands of API requests. No need to get directions multiple times for the same route in this case.
thank you
Thank you belaziz how do you create the personal API key?
https://openrouteservice.org/dev/#/signup
1-create an account
2-verify your accountn with email
https://openrouteservice.org/dev/#/home
3-Request a token
4-Good luck
https://openrouteservice.org/dev/#/home For newbies like me follow this link, create an account after that request for a token. It is generated immediately.
Thank you so much
I GET ApiError: 500
import openrouteservice from openrouteservice.directions import directions coords = ((-1.3177546999999998,36.8303703),(-1.3004062, 36.829741)) client = openrouteservice.Client(key='my_key goes here') # Specify your personal API key routes =directions(client, coords)
I GET ApiError: 500
import openrouteservice
from openrouteservice.directions import directions
coords = ((-1.3177546999999998,36.8303703),(-1.3004062, 36.829741))
client = openrouteservice.Client(key='my_key goes here') # Specify your personal API key
routes =directions(client, coords)
you can only make 2000 requests per day, so you need to rerun your script, every 24 hours, until you collect all of the data you need or maybe you may try another key from another account. Moreover, I think that with another account, not the free one, you can get what you want.
I got the solution. The longitude needs to come before the latitude.
of course
line9:coords=((train.at[i,'Pickup Long'],train.at[i,'Pickup Lat']),(train.at[i,'Destination Long'],train.at[i,'Destination Lat']))
Perfet!
has anyone downloaded the data already? Only asking in case it is something you do not mind sharing to save people requesting tokens every day to download the same data?
your email !!
jennykathambi90@gmail.com
its ketuld@gmail.com. Thanks in advance!
christopherajulo@gmail.com. Thank you.
Hello Belaziz, I'm struggling with the errors to retrieve this data, could I have this data please, my mail is: mamadoutive4@gmail.com
chinedulaw62@gmail.com
sibrahim1396@gmail.com kindly send me the data too
mmakky1@gmail.com
thanks in advance
Please can you send to my email too
damolaoriola@gmail.com
Thanks so much in advance
Pls can you forwarforward the datdata to me
nanabaffourowusu@gmail.com
Dear belaziz, could you share the data file here with a link to some file sharing service so anybody in the competition could use it easily? Thanks!
spkibe12@gmail.com
Hi @belaziz. Would you please share the data with me as well? sburger29@gmail.com. Thank in advance!
Please do send me the data too, justenyirimana@gmail.com
can you please send the data to abhishekpatil0853@gmail.com?
Pls I am interested in the data
nanabaffourowusu@gmail
ayoub.chebbi3@gmail.com
thxxxxxxxxx
Hi! I'm also interested in the data (cacos1988@gmail.com). :)
Hi Belaziz! Thanks for sharing. Do you mind to send me the data at igbongba@gmail.com? Appreciate it
Hi Belaziz, thanks for sharing, mosesbomera@yahoo.com thanks.
Hi Belaziz!, I greatly appreciate if you could share the dataset with me... my email id is anirudh7873@gmail.com. Thanks!
Thx for sharing. Can you a copy at papaass07@gmail.com
Hello @belaziz Kindly email me the dataset, rose.wambui780@gmail.com
Or anyone who has been emailed the dataset can cc:
Hello Belaziz , can you email me the data ?
Thanks.
could anybody possibly send me the file as well?
kand3572@uni.sydney.edu.au
much appreciated!
Hi Everyone!
Could anybody send me the data file?
archimedeameck@gmail.com
Thanks by anticipation!
Hi All! Could anybody send me the data file?
namestnikov.nikita@gmail.com
Thank you in advance!
-
Can anyone please send me the data in "" ibrahima.fall@aims-senegal.org "".
Thanks.