Python Forum
Map with folium - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Map with folium (/thread-11248.html)



Map with folium - vandelouw - Jun-29-2018

Hi,
I'm trying to have a choropleth map of reach departments with folium.
I downloaded the 'departements-2.geojson' file on https://www.france-geojson.fr and created a csv file with some data (to test, I took just as data the number of the department).
Here is the code


iw_map = folium.Map(location=[50.666, -1.37], zoom_start=11)
iw_map.choropleth(
 geo_str='departements-2.geojson',
 data=state_data,
 columns=['code', 'donnee'],
 key_on='features.code',
 fill_color='YlGn',
 fill_opacity=0.7,
 line_opacity=0.2
)
folium.LayerControl().add_to(iw_map)
iw_map
It shows the map but not the departments, does anyone see where I'm wrong ?
Thanks !