【问题标题】:UK geojson displays blank folium map英国 geojson 显示空白叶图
【发布时间】: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

有人可以帮忙吗?谢谢

【问题讨论】:

    标签: geojson folium


    【解决方案1】:

    你可以看看这个答案:question about Mapbox bright。我认为您对名称“Mapbox Bright”的图块有疑问。

    【讨论】:

    • 显示了边界,但没有将我的数据作为热图包含在内
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-27
    • 1970-01-01
    • 2018-10-05
    • 2012-03-29
    相关资源
    最近更新 更多