嘿!我需要获取一个特征属性(gridcode)作为以下我不知道的choropleth映射的弹出窗口。任何建议都热烈欢迎。另外,我是Python编程的新手,所以这里有点客气!任何建议都热烈欢迎。谢谢:)
import pandas as pd
import folium
import os
polygon = os.path.join('Reclassified.json')
csv = os.path.join('Reclass.csv')
data = pd.read_csv(csv)
map = folium.Map(location=[9.9733,76.2517], zoom_start=14)
map.choropleth(
geo_data=polygon,
name='choropleth',
data=data,
columns=['Id', 'gridcode'],
key_on='feature.properties.gridcode',
fill_color='Spectral',
fill_opacity=1,
line_opacity=0.05,
legend_name='Depth(m)'
)
folium.LayerControl().add_to(map)
map.save('map.html')