Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,12 @@ from streamlit_folium import folium_static
|
|
| 6 |
|
| 7 |
# Load data
|
| 8 |
data = {
|
| 9 |
-
'Name': ['Location_A', 'Location_B', 'Location_C', 'Location_D', 'Location_E'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
'latitude': np.random.uniform(40.7, 40.8, size=25), # Assuming latitude range between 40.7 and 40.8
|
| 11 |
'longitude': np.random.uniform(-74.0, -73.9, size=25) # Assuming longitude range between -74.0 and -73.9
|
| 12 |
}
|
|
@@ -32,7 +37,7 @@ m = folium.Map(location=(filtered_data['latitude'].mean(), filtered_data['longit
|
|
| 32 |
for index, row in filtered_data.iterrows():
|
| 33 |
folium.Marker([row['latitude'], row['longitude']], popup=row['Name']).add_to(m)
|
| 34 |
|
| 35 |
-
polygon_coords = [ [np.random.uniform(40.7, 40.8, size=
|
| 36 |
|
| 37 |
# Create a polygon object
|
| 38 |
polygon = folium.Polygon(locations=polygon_coords, color='blue', fill=True, fill_color='blue', fill_opacity=0.3)
|
|
|
|
| 6 |
|
| 7 |
# Load data
|
| 8 |
data = {
|
| 9 |
+
'Name': ['Location_A', 'Location_B', 'Location_C', 'Location_D', 'Location_E',
|
| 10 |
+
'Location_A', 'Location_B', 'Location_C', 'Location_D', 'Location_E',
|
| 11 |
+
'Location_A', 'Location_B', 'Location_C', 'Location_D', 'Location_E',
|
| 12 |
+
'Location_A', 'Location_B', 'Location_C', 'Location_D', 'Location_E',
|
| 13 |
+
'Location_A', 'Location_B', 'Location_C', 'Location_D', 'Location_E',
|
| 14 |
+
],
|
| 15 |
'latitude': np.random.uniform(40.7, 40.8, size=25), # Assuming latitude range between 40.7 and 40.8
|
| 16 |
'longitude': np.random.uniform(-74.0, -73.9, size=25) # Assuming longitude range between -74.0 and -73.9
|
| 17 |
}
|
|
|
|
| 37 |
for index, row in filtered_data.iterrows():
|
| 38 |
folium.Marker([row['latitude'], row['longitude']], popup=row['Name']).add_to(m)
|
| 39 |
|
| 40 |
+
polygon_coords = [ [np.random.uniform(40.7, 40.8, size=6)[i], np.random.uniform(-74.0, -73.9, size=6)[i]] for i in range(6)]
|
| 41 |
|
| 42 |
# Create a polygon object
|
| 43 |
polygon = folium.Polygon(locations=polygon_coords, color='blue', fill=True, fill_color='blue', fill_opacity=0.3)
|