Created
July 25, 2018 21:50
-
-
Save rcgalbo/029b914e627922632bc2cfdf4e6092f8 to your computer and use it in GitHub Desktop.
Plotting an interactive heatmap of lat, long
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import folium | |
def plot_heatmap(data): | |
''' | |
Args: | |
takes a list of lists [[lat, long]] | |
Returns: | |
Folium map object with heatmap overlay | |
''' | |
heatmap = folium.Map(tiles="CartoDBpositron", prefer_canvas=True) | |
hm = plugins.HeatMap(data) | |
heatmap.add_child(hm) | |
heatmap.fit_bounds(heatmap.get_bounds()) | |
return heatmap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment