当我尝试添加GeoJson工具提示时:
choropleth.geojson.add_child(folium.features.GeoJsonTooltip(fields=['feature.properties.NTAName'], labels=False))
并获取一个断言错误:
AssertionError:字段feature.properties.NTAName在数据中不可用。从以下选项中选择:('BoroCode'、'BoroName'、'CountyFIPS'、'NTACode'、'NTAName'、'Shape_Leng'、'Shape_Area')
所讨论的JSON如下所示:
{'type': 'FeatureCollection',
'crs': {'type': 'name',
'properties': {'name': 'urn:ogc:def:crs:OGC:1.3:CRS84'}},
'features': [{'type': 'Feature',
'properties': {'BoroCode': 3,
'BoroName': 'Brooklyn',
'CountyFIPS': '047',
'NTACode': 'BK43',
'NTAName': 'Midwood',
'Shape_Leng': 27996.5910663,
'Shape_Area': 35799638.2503},
'geometry': {'type': 'Polygon',
'coordinates': [[[-73.94732672160579, 40.62916656720943],
...
我想我可能把访问文件的语法完全弄错了,但我所能想到的每一种选择都产生了相同的结果
事实证明,我必须准确地指出属性的名称,忽略所有层次结构。 这很奇怪
相关问题 更多 >
编程相关推荐