Spaces:
Running
Running
LaurentTRIPIED
commited on
Commit
•
bf92384
1
Parent(s):
554c057
Pytorch V0.15
Browse files
app.py
CHANGED
@@ -12,13 +12,14 @@ def get_data():
|
|
12 |
records = data.get("records", [])
|
13 |
cleaned_data = []
|
14 |
for record in records:
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
fields["
|
|
|
22 |
cleaned_data.append(fields)
|
23 |
return cleaned_data
|
24 |
else:
|
@@ -42,7 +43,7 @@ def display_organisations_engagees(data):
|
|
42 |
def display_map(data):
|
43 |
m = folium.Map(location=[44.837789, -0.57918], zoom_start=12)
|
44 |
for item in data:
|
45 |
-
# Utilise les coordonnées
|
46 |
if "latitude" in item and "longitude" in item:
|
47 |
folium.Marker(
|
48 |
[item["latitude"], item["longitude"]],
|
|
|
12 |
records = data.get("records", [])
|
13 |
cleaned_data = []
|
14 |
for record in records:
|
15 |
+
fields = record.get("fields", {})
|
16 |
+
point_geo = fields.get("point_geo")
|
17 |
+
if isinstance(point_geo, dict): # S'assure que point_geo est un dictionnaire
|
18 |
+
lat = point_geo.get("lat")
|
19 |
+
lon = point_geo.get("lon")
|
20 |
+
if lat and lon:
|
21 |
+
fields["latitude"] = lat
|
22 |
+
fields["longitude"] = lon
|
23 |
cleaned_data.append(fields)
|
24 |
return cleaned_data
|
25 |
else:
|
|
|
43 |
def display_map(data):
|
44 |
m = folium.Map(location=[44.837789, -0.57918], zoom_start=12)
|
45 |
for item in data:
|
46 |
+
# Utilise les coordonnées extraites
|
47 |
if "latitude" in item and "longitude" in item:
|
48 |
folium.Marker(
|
49 |
[item["latitude"], item["longitude"]],
|