Spaces:
Runtime error
Runtime error
LaurentTRIPIED
commited on
Commit
·
7dd3dfa
1
Parent(s):
96ddef0
Pytorch v.36
Browse files- localisation.py +3 -8
localisation.py
CHANGED
@@ -15,7 +15,6 @@ def get_data():
|
|
15 |
fields = record.get("fields", {})
|
16 |
geoloc = fields.get("geolocalisation")
|
17 |
if geoloc:
|
18 |
-
# S'assurer que geoloc est une liste avec au moins deux éléments
|
19 |
lat, lon = geoloc[0], geoloc[1]
|
20 |
cleaned_data.append({"lat": lat, "lon": lon, "name": fields.get("nom_courant_denomination", "Inconnu")})
|
21 |
return cleaned_data
|
@@ -26,12 +25,7 @@ def get_data():
|
|
26 |
st.error(f"Error occurred: {e}")
|
27 |
return []
|
28 |
|
29 |
-
def display_map():
|
30 |
-
data = get_data()
|
31 |
-
if not data:
|
32 |
-
st.write("No data available to display on the map.")
|
33 |
-
return
|
34 |
-
|
35 |
# Initialiser la carte au centre de Bordeaux
|
36 |
m = folium.Map(location=[44.837789, -0.57918], zoom_start=12)
|
37 |
|
@@ -46,4 +40,5 @@ def display_map():
|
|
46 |
folium_static(m)
|
47 |
|
48 |
if __name__ == "__main__":
|
49 |
-
|
|
|
|
15 |
fields = record.get("fields", {})
|
16 |
geoloc = fields.get("geolocalisation")
|
17 |
if geoloc:
|
|
|
18 |
lat, lon = geoloc[0], geoloc[1]
|
19 |
cleaned_data.append({"lat": lat, "lon": lon, "name": fields.get("nom_courant_denomination", "Inconnu")})
|
20 |
return cleaned_data
|
|
|
25 |
st.error(f"Error occurred: {e}")
|
26 |
return []
|
27 |
|
28 |
+
def display_map(data):
|
|
|
|
|
|
|
|
|
|
|
29 |
# Initialiser la carte au centre de Bordeaux
|
30 |
m = folium.Map(location=[44.837789, -0.57918], zoom_start=12)
|
31 |
|
|
|
40 |
folium_static(m)
|
41 |
|
42 |
if __name__ == "__main__":
|
43 |
+
data = get_data()
|
44 |
+
display_map(data)
|