0

`Hi! I have a dataset with latitude and longitude and a column for specific persons that have been on the address during the day. I am currently showing where they have been during the day with the code below.

But how do I connect the dots with a route following the road? and maybe even calculating the distance traveled between the points? The "hex" column is a column with a specific color for each employee name. Each employee can appear multiple times in the dataset.`

import folium
import webbrowser
import pandas as pd

for index, row in GeoSpatial1dec.iterrows():
    folium.CircleMarker([row['latitude'], row['longitude']],
        radius=10,
        popup=row['employee'],
        fill=False, fill_color = row['Hex'], fill_opacity = 1).add_to(my_map)

my_map.save("map.html")
webbrowser.open("map.html")

I tried writing a polygon but I cannot make them specific for each employee.

EB_10
  • 1
  • 2
  • Do you have geo data for the route they took or do you just have the points and want to show a possible route they may have taken? (shortest distance for example) OR do you want a straight line between points so you get a polygon? please clarify, thx – flipSTAR Jan 17 '23 at 09:20
  • @flipSTAR Thanks for answering! I have the GeoData in latitude and longitude. I would really like to show the shortest route possible! – EB_10 Jan 17 '23 at 11:51
  • Here is a discussion regarding that https://stackoverflow.com/a/60601005/13843906 I think all over stackoverflow are a lot of useful comments regarding your question, search, have a look around and get back when you have specific errors. good luck – flipSTAR Jan 17 '23 at 14:20

0 Answers0