import pandas as pd
import folium
# Read the Excel file with the latitudes and longitudes
data = pd.read_excel('your_excel_file.xlsx')
# Create a map centered on Iran
iran_map = folium.Map(location=[32.4279, 53.6880], zoom_start=5)
# Loop through the data and add markers for each location
for i, row in data.iterrows():
folium.Marker([row['Latitude'], row['Longitude']],
popup=row['Location']).add_to(iran_map)
# Add a line to connect the markers
locations = data[['Latitude', 'Longitude']].values.tolist()
folium.PolyLine(locations, color='red').add_to(iran_map)
# Show the map
iran_map
1条答案
按热度按时间b4lqfgs41#
试试这个方法;