gregoiredavid / france-geojson

Contours des régions, départements, arrondissements, cantons et communes de France (métropole et départements d'outre-mer) au format GeoJSON
https://france-geojson.gregoiredavid.fr
729 stars 409 forks source link

An exemple of use with python Folium #35

Closed cedmfr closed 3 years ago

cedmfr commented 3 years ago

Dear author, can you provide an example of use with python folium to show the French regions similarly as you show on you webmap page (just background color, dark borders) but no data into choropleth data field ? Merci beaucoup,

gregoiredavid commented 3 years ago

I'm sorry, I'm not familiar with python folium. However, since this repo contains regular geojson files you should be able to use them with any tutorial about python folium based on geojson files. Simply replace the geojson files used in the tutorial by one from this repository.

Here's an example based on this tutorial : https://python-visualization.github.io/folium/quickstart.html#GeoJSON/TopoJSON-Overlays

url = 'https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/regions-version-simplifiee.geojson'

m = folium.Map(
    location=[2.4609,46.5588],
    zoom_start=3
)

folium.GeoJson(
    url,
    name='geojson'
).add_to(m)

folium.LayerControl().add_to(m)

m

Best regards