fschwartzer commited on
Commit
b5290a2
1 Parent(s): 1c4c92b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -13
app.py CHANGED
@@ -16,22 +16,24 @@ def calculate_distance(lat1, lon1, lat2, lon2):
16
  coords_2 = (lat2, lon2)
17
  return geodesic(coords_1, coords_2).meters
18
 
19
- # Display a title
20
- st.title('Geospatial Dashboard')
 
 
21
 
22
- # Dropdown to select specific coordinates
23
- selected_coords = st.selectbox('Select Coordinates', ['Random', 'Custom'])
24
- if selected_coords == 'Custom':
25
- custom_lat = st.number_input('Enter Latitude', value=0.0)
26
- custom_lon = st.number_input('Enter Longitude', value=0.0)
27
- else:
28
- custom_lat, custom_lon = 0.0, 0.0
29
 
30
- # Slider for setting the zoom level
31
- zoom_level = st.slider('Zoom Level', min_value=1, max_value=15, value=5)
32
 
33
- # Slider to set the radius in meters
34
- radius_in_meters = st.slider('Select Radius (in meters)', min_value=100, max_value=5000, value=1000)
35
 
36
  # Filter data based on the radius
37
  if selected_coords == 'Custom':
 
16
  coords_2 = (lat2, lon2)
17
  return geodesic(coords_1, coords_2).meters
18
 
19
+ # Create a sidebar for controls
20
+ with st.sidebar:
21
+ # Display a title
22
+ st.title('Geospatial Dashboard')
23
 
24
+ # Dropdown to select specific coordinates
25
+ selected_coords = st.selectbox('Select Coordinates', ['Random', 'Custom'])
26
+ if selected_coords == 'Custom':
27
+ custom_lat = st.number_input('Enter Latitude', value=0.0)
28
+ custom_lon = st.number_input('Enter Longitude', value=0.0)
29
+ else:
30
+ custom_lat, custom_lon = 0.0, 0.0
31
 
32
+ # Slider for setting the zoom level
33
+ zoom_level = st.slider('Zoom Level', min_value=1, max_value=15, value=5)
34
 
35
+ # Slider to set the radius in meters
36
+ radius_in_meters = st.slider('Select Radius (in meters)', min_value=100, max_value=5000, value=1000)
37
 
38
  # Filter data based on the radius
39
  if selected_coords == 'Custom':