fschwartzer commited on
Commit
044f186
1 Parent(s): 62d940d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -81,16 +81,16 @@ with st.sidebar:
81
  custom_lat = st.number_input('Enter Latitude', value=filtered_data['latitude'].mean())
82
  custom_lon = st.number_input('Enter Longitude', value=filtered_data['longitude'].mean())
83
  radius_visible = True # Show radius slider for custom coordinates
 
84
  else:
85
  custom_lat, custom_lon = data['latitude'].mean(), data['longitude'].mean()
86
  radius_visible = False # Hide radius slider for random coordinates
 
87
 
88
  # Slider for setting the zoom level
89
  if selected_coords == 'Custom':
90
  zoom_level = st.slider('Nível de zoom', min_value=1, max_value=15, value=zoom_level)
91
  else:
92
- # Find the maximum distance between coordinates for the entire dataset
93
- max_distance_all = 0 # Initialize max_distance_all
94
  for index, row in data.iterrows():
95
  distance_all = calculate_distance(row['latitude'], row['longitude'], data['latitude'].mean(), data['longitude'].mean())
96
  if distance_all > max_distance_all:
@@ -102,7 +102,6 @@ with st.sidebar:
102
  # Slider for setting the zoom level based on the entire dataset
103
  zoom_level = st.slider('Nível de zoom', min_value=1, max_value=15, value=zoom_level_all)
104
 
105
-
106
  # Conditionally render the radius slider
107
  if radius_visible:
108
  radius_in_meters = st.slider('Selecione raio (em metros)', min_value=100, max_value=5000, value=1000)
 
81
  custom_lat = st.number_input('Enter Latitude', value=filtered_data['latitude'].mean())
82
  custom_lon = st.number_input('Enter Longitude', value=filtered_data['longitude'].mean())
83
  radius_visible = True # Show radius slider for custom coordinates
84
+ # No need to initialize max_distance_all here
85
  else:
86
  custom_lat, custom_lon = data['latitude'].mean(), data['longitude'].mean()
87
  radius_visible = False # Hide radius slider for random coordinates
88
+ max_distance_all = 0 # Initialize max_distance_all here
89
 
90
  # Slider for setting the zoom level
91
  if selected_coords == 'Custom':
92
  zoom_level = st.slider('Nível de zoom', min_value=1, max_value=15, value=zoom_level)
93
  else:
 
 
94
  for index, row in data.iterrows():
95
  distance_all = calculate_distance(row['latitude'], row['longitude'], data['latitude'].mean(), data['longitude'].mean())
96
  if distance_all > max_distance_all:
 
102
  # Slider for setting the zoom level based on the entire dataset
103
  zoom_level = st.slider('Nível de zoom', min_value=1, max_value=15, value=zoom_level_all)
104
 
 
105
  # Conditionally render the radius slider
106
  if radius_visible:
107
  radius_in_meters = st.slider('Selecione raio (em metros)', min_value=100, max_value=5000, value=1000)