Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from folium.plugins import HeatMap
- import mysql.connector
- topmap = folium.Map([51.2192, 4.4029], tiles='stamentoner', zoom_start=14)
- cnc = mysql.connector.connect(user='root', password='root',
- host='127.0.0.1',
- database='velo')
- print(cnc)
- cursor = cnc.cursor()
- query = 'SELECT StationId, count(BikeID)as Aantal FROM Data01 INNER JOIN velostation on Data01.StationID = velostation.objectid GROUP BY StationId ORDER BY Aantal DESC LIMIT 10;'
- cursor.execute(query)
- aantalPerStat = {}
- teller = 0
- for (StationId, Aantal) in cursor:
- teller = teller + 1
- val1 = s[StationId]
- folium.Marker([s[StationId][2], s[StationId][3]], popup=str( 'nr' + str(teller) + ': ' + s[StationId][0]) ).add_to(topmap)
- topmap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement