Commit
·
ec73f7a
1
Parent(s):
e535f06
V2.2
Browse files
app.py
CHANGED
|
@@ -40,18 +40,23 @@ def display_map():
|
|
| 40 |
m = folium.Map(location=[44.84474, -0.60711], zoom_start=12)
|
| 41 |
for item in data:
|
| 42 |
try:
|
| 43 |
-
#
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
continue
|
| 53 |
folium_static(m)
|
| 54 |
|
|
|
|
| 55 |
# Fonction pour l'onglet "Dialoguer avec l'assistant IA RSE bziiit"
|
| 56 |
def display_dialogue():
|
| 57 |
st.markdown("# Patientez quelques heures encore... :)")
|
|
|
|
| 40 |
m = folium.Map(location=[44.84474, -0.60711], zoom_start=12)
|
| 41 |
for item in data:
|
| 42 |
try:
|
| 43 |
+
# Assumant que 'point_geo' est une liste [lon, lat]
|
| 44 |
+
point_geo = item.get('point_geo', [])
|
| 45 |
+
if point_geo:
|
| 46 |
+
# Extraction de lon et lat par indexation de la liste
|
| 47 |
+
lon, lat = point_geo
|
| 48 |
+
lat, lon = float(lat), float(lon)
|
| 49 |
+
# Vérification que lat et lon sont valides
|
| 50 |
+
if lat and lon:
|
| 51 |
+
folium.Marker([lat, lon], popup=item.get("nom_courant_denomination", "Sans nom")).add_to(m)
|
| 52 |
+
except (ValueError, TypeError, IndexError):
|
| 53 |
+
# Cette exception attrape les erreurs de conversion en float,
|
| 54 |
+
# les cas où point_geo n'est pas dans le format attendu,
|
| 55 |
+
# ou les index ne sont pas présents dans la liste
|
| 56 |
continue
|
| 57 |
folium_static(m)
|
| 58 |
|
| 59 |
+
|
| 60 |
# Fonction pour l'onglet "Dialoguer avec l'assistant IA RSE bziiit"
|
| 61 |
def display_dialogue():
|
| 62 |
st.markdown("# Patientez quelques heures encore... :)")
|