Python Forum

Full Version: Map with folium
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 !