Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon Bazin
nf26-metar
Commits
91259e12
Commit
91259e12
authored
Jun 22, 2019
by
Oscar Roisin
Browse files
add indicators to map
parent
042e25f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
map.py
View file @
91259e12
import
folium
import
matplotlib.pyplot
as
plt
from
cassandra.cluster
import
Cluster
from
datetime
import
datetime
import
numpy
as
np
from
kmeans
import
verifyDateInPeriod
import
loading
...
...
@@ -60,7 +57,10 @@ def mapIndicator(date, indicators):
m
=
folium
.
Map
(
location
=
[
64.2815
,
27.6753
])
# Add Marker for each station
for
d
in
data
:
folium
.
Marker
([
d
[
'lat'
],
d
[
'lon'
]],
popup
=
f
"
{
d
[
'station'
]
}
"
).
add_to
(
m
)
text
=
''
for
key
,
value
in
d
.
items
():
text
=
text
+
'<br><b>'
+
key
+
'</b> : '
+
str
(
value
)
folium
.
Marker
([
d
[
'lat'
],
d
[
'lon'
]],
popup
=
f
"
{
text
}
"
).
add_to
(
m
)
# Save map
m
.
save
(
file_name
)
print
(
f
"La carte a été enregistrée à
{
file_name
}
"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment