-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap1.py
More file actions
28 lines (22 loc) · 722 Bytes
/
map1.py
File metadata and controls
28 lines (22 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import folium
import pandas
data = pandas.read_csv("Volcanoes.txt")
lat = list(data["LAT"])
lon = list(data["LON"])
nome = list(data["NAME"])
el = list(data["ELEV"])
def colorir(eleva):
if (eleva<2000):
return 'green'
elif 2000 <= eleva < 3000:
return 'yellow'
elif (eleva >= 3000 and eleva < 4000):
return 'orange'
else:
return 'red'
map = folium.Map(location=[40.629902, -120.831001], tiles="Mapbox Bright")
fg=folium.FeatureGroup(name="My Map")
for lt, ln, nm, el in zip(lat, lon, nome, el):
fg.add_child(folium.CircleMarker(location=[lt, ln], radius=7, popup=nm, fill_color=colorir(el), color='grey', fill_opacity=0.7))
map.add_child(fg)
map.save("Map1.html")