File size: 1,049 Bytes
60a293b
 
 
 
 
a90f379
60a293b
20df1de
6b93bb5
60a293b
 
 
 
 
 
3e96981
20df1de
60a293b
3e96981
 
 
 
 
 
 
 
 
 
 
60a293b
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import pandas as pd
import plotly.express as px
import json
import geopandas as gpd
import folium
import streamlit as st

st.set_page_config(layout="wide")
st.title('Carte')
# Specify the path to your GeoJSON file
geojson_file_path = 'BNDA_TGO_2017-06-29_lastupdate.geojson'
geojson_data = json.load(open(geojson_file_path, "r"))
# Read the GeoJSON file using geopandas
gdf = gpd.read_file(geojson_file_path)

gdf_merged_q = pd.read_csv('merged_q.csv')
geojson = gdf_merged_q.__geo_interface__

fig = px.choropleth_mapbox(gdf_merged_q, 
                          geojson=geojson,
                           locations=gdf_merged_q.index,
                           color='scores',
                           mapbox_style="carto-positron",
                           title="Scores de Propreté Pour Les Préfectures Du Togo",
                           hover_name="adm2nm",
                           color_continuous_scale="Viridis"
                          )
fig.update_layout(margin={'r':0, 't':0, "l": 0, 'r': 0})
fig.show()

st.plotly_chart(fig)