-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
30 lines (22 loc) · 859 Bytes
/
main.py
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
29
30
import folium
import database
m = folium.Map(location=[48.721900, 21.257537], zoom_start=14)
# change these values to modify the visualization
data = [{"type": "playground", "time": "fifteen", "color": "blue", "opacity": 0.4},
{"type": "Pošta", "time": "twenty", "color": "red", "opacity": 0.2}]
for i in data:
geo_data = {"type": "FeatureCollection", "features": []}
geo_data["features"].append({
"type": "Feature",
"id": "0",
"properties": {
"name": "visual"
},
"geometry": {
"type": "Polygon",
"coordinates":
database.retrieve(i["type"], i["time"])
}
})
m.add_child(folium.Choropleth(geo_data=geo_data, fill_opacity=i["opacity"], line_opacity=0.1, fill_color=i["color"]))
m.show_in_browser()