【发布时间】:2020-10-16 18:30:40
【问题描述】:
我正在尝试为英国地方当局使用以下 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
有人可以帮忙吗?谢谢
【问题讨论】: