我正在尝试将以下geojson用于英国地方当局,但它显示空白地图。
我的表格以相同的方式列出了大多数地方政府。不知道它的key_on参考是唯一的问题还是更多。
到目前为止,我的代码如下:
threshold_scale = np.linspace(df_ctbl['Population'].min(), df_ctbl['Population'].max(), 6, dtype=int)
threshold_scale = threshold_scale.tolist() # change the numpy array to a list
threshold_scale[-1] = threshold_scale[-1] + 1 # make sure that the last value of the list is greater than the maximum immigration
# let Folium determine the scale.
londonf_map = folium.Map(location=[latitudeld, longitudeld], zoom_start=4, tiles='Mapbox Bright')
londonf_map.choropleth(
geo_data=uk_geo,
data=df_ctbl,
columns=['Local Authorityp', 'Population'],
key_on= 'properties.lad13nm',
threshold_scale=threshold_scale,
fill_color='YlOrRd',
fill_opacity=0.7,
line_opacity=0.2,
legend_name='UK Population in 2019',
reset=True
)
londonf_map
有人可以帮忙吗?谢谢