python-visualization / folium

Python Data. Leaflet.js Maps.
https://python-visualization.github.io/folium/
MIT License
6.91k stars 2.22k forks source link

Folium Heatmap doesn't render more than 66k points #859

Closed quincymac closed 6 years ago

quincymac commented 6 years ago

Please add a code sample or a nbviewer link, copy-pastable if possible


#I have split up my pandas dataframe into two chunks
#Chunk one is converted to numpy array then made into a list of coords
heat_1 = heat_df.iloc[:65000,:]
data_chunk1 = heat_1.as_matrix(['Latitude','Longitude']).tolist()

#Same again for chunk 2
heat_2 = heat_df.iloc[65000:100000,:]
data_chunk2 = heat_2.as_matrix(['Latitude','Longitude']).tolist()

#now I try and generate the heatmap
#this works beautifully for less than 66k points
from folium.plugins import HeatMap
m = folium.Map([50., 1.], tiles='stamentoner', zoom_start=6)
HeatMap(data_chunk1).add_to(m)
HeatMap(data_chunk2).add_to(m)
m

Problem description

I would like to plot more than 66,000 data points using the heatmap visualisation. After some experimentation I find that 66,150 points seems to be the upper limit.

In an attempt to create a work-around I have broken the data into two chunks and incrementally added this to the map. This approach only works where total data points <66k.

Expected Output

A nice heatmap with more than 66k points

Output of folium.__version__0.5.0

folium==0.5.0

quincymac commented 6 years ago

Looks like it's some strange limitation due to my Chrome/Jupyter notebook setup. It actually does the computation because I can save the .html

This issue is closed as not a Folium issue

Conengmo commented 6 years ago

Thanks for investigating your own issue. This seems related to other issues that where posted before, all about maps failing in Chrome/Jupyter. For example #812.