Pandas Dataframe

Is there any example of using client.directions and placing pandas latitude and longitude in the method. Any help would be greatly appreciated.

Here is my code

for EC_lon,EC_lat,WC_lon,WC_lat in zip(EC["Longitude"].values.tolist(),
                                       EC["Latitude"].values.tolist(),
                                       WC["Longitude"].values.tolist(),
                                       WC["Latitude"].values.tolist()):
    client.directions(coordinates=[[EC_lon,EC_lat],[WC_lon,WC_lat]],
                          profile='driving-car',
                          format='geojson')

Hey,

for an example on how to use the openrouteservice python client, have a look at the examples in the github repo.
If you have further questions regarding the openrouteservice python client, feel free to ask them.

If you have questions regarding python and pandas, please redirect them to the appropriate forums, channels and other sources on the web.

Best regards

Sure just an example of using a pandas data frame I see in the example their mostly use Tuples for the coordinates

Got it to work:

locations = DF[['Longitude','Latitude']] 

locations = locations.values.tolist()

isochrones = client.isochrones(locations = locations,
                 profile='driving-hgv',
                 range=[900, 1800, 2700, 3600],  ### 900 / 60 = 15 minutes 
                 units="km",
                 attributes = ['area', 'reachfactor', 'total_pop'])

for iso in isochrones['features']:
    folium.features.GeoJson(iso,style_function=styl_func).add_to(Map)
2 Likes