I would like to clusterize my points. Unfortunately I cannot do it with my code it loos like.
import pandas as pd
import folium
from folium import FeatureGroup
from folium.plugins import MarkerCluster
map = folium.Map(location=[51.86762,0.8624], tiles='OpenStreetMap', zoom_start=8)
mCluster = MarkerCluster(control = False).add_to(map)
fc=folium.FeatureGroup(name="CF",overlay=True)
df = pd.read_csv("cf_geo.csv")
for i,row in df.iterrows():
lat =df.at[i, 'lat']
lng = df.at[i, 'lng']
sp = df.at[i, 'sp']
popup = df.at[i,'sp'] +'<br>' + str(df.at[i, 'street']) + '<br>' + str(df.at[i, 'post code'])
fc.add_child(folium.Marker(location=[lat,lng], popup=popup, icon =
folium.Icon(color='green')))
mCluster.add_child(fc)
All my items are gone.
I tried these hints:
and other, general sources show rather the most simple way:
https://www.youtube.com/watch?v=n7HUBNmXB5Y&ab_channel=LearningSoftwareSkills
How to add Cluster markers to Choropleth with Folium
How can I make the makrercluster working for the child elements of the folium library?