fschwartzer commited on
Commit
287a688
1 Parent(s): ba96f19

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -7,6 +7,16 @@ import googlemaps
7
  from geopy.exc import GeocoderTimedOut
8
 
9
 
 
 
 
 
 
 
 
 
 
 
10
  # Function to calculate distance in meters between two coordinates
11
  def calculate_distance(lat1, lon1, lat2, lon2):
12
  coords_1 = (lat1, lon1)
@@ -80,7 +90,7 @@ with st.sidebar:
80
  selected_coords = st.selectbox('Selecione Coordenadas', ['Random', 'Custom'])
81
 
82
  if selected_coords == 'Custom':
83
- custom_address = st.text_input('Informe o endereço', 'Endereço desejado aqui')
84
  radius_visible = True # Show radius slider for custom coordinates
85
  # No need to initialize max_distance_all here
86
  else:
 
7
  from geopy.exc import GeocoderTimedOut
8
 
9
 
10
+ # Initialize variables to avoid NameError
11
+ selected_coords = 'Custom'
12
+ radius_visible = True
13
+ custom_address_initial = 'Av. Senador Alberto Pasqualini, 177 - Centro, Lajeado - RS, 95900-034' # Initial custom address
14
+ custom_lat = data['latitude'].mean()
15
+ custom_lon = data['longitude'].mean()
16
+ radius_in_meters = 1000
17
+ filtered_data = data # Initialize with the entire dataset
18
+
19
+
20
  # Function to calculate distance in meters between two coordinates
21
  def calculate_distance(lat1, lon1, lat2, lon2):
22
  coords_1 = (lat1, lon1)
 
90
  selected_coords = st.selectbox('Selecione Coordenadas', ['Random', 'Custom'])
91
 
92
  if selected_coords == 'Custom':
93
+ custom_address = st.text_input('Informe o endereço', custom_address_initial)
94
  radius_visible = True # Show radius slider for custom coordinates
95
  # No need to initialize max_distance_all here
96
  else: