当我尝试使用Folium包映射下面的链接代码以生成坐标列表的聚集标记弹出窗口时,出现以下错误:
assert isinstance(figure,figure),('You cannot render this Element' “如果它不在图形中。”)
我的集群策略成功地运行了,没有任何错误。当我通过在一个单独的jupyter单元格中实际调用map名称来生成map时,我得到了一个错误。我想不出解决办法。你知道吗
charterdropped.crs = sdshape.crs
charterdropped = charterdropped.to_crs(epsg='4326')
cjson = charterdropped.to_json()
mappo = folium.Map([37.7556, -122.4399], zoom_start = 7)
mappo.choropleth(
geo_data=districtchanged,
data=districtchanged,
columns=['FIPS', '% Total Population: White Alone'],
key_on='feature.properties.FIPS',
legend_name='White people',
fill_color='YlGn',
fill_opacity=0.4,
highlight=True)
points = folium.features.GeoJson(cjson)
mappo.add_child(points)
#Cluster Method
marker_cluster = MarkerCluster().add_to(mappo)
for each in charterdropped[0:len(charterdropped)].iterrows():
folium.Marker(
location=[each[1]['latitude'], each[1]['longitude']],
popup=folium.Popup(
folium.IFrame(
html=each[1]['SCH_NAME'])
).add_to(marker_cluster))
目前没有回答
相关问题 更多 >
编程相关推荐