Spaces:
Running
Running
Update new_app.py
Browse files- new_app.py +15 -12
new_app.py
CHANGED
|
@@ -94,18 +94,21 @@ if state.img is None:
|
|
| 94 |
col1, col2, col3 = st.columns([0.8, 1.8, 1.0]) # adjust ratios to taste
|
| 95 |
|
| 96 |
with col3:
|
| 97 |
-
|
| 98 |
-
st.
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
with col2:
|
| 111 |
if state.coords_submitted:
|
|
|
|
| 94 |
col1, col2, col3 = st.columns([0.8, 1.8, 1.0]) # adjust ratios to taste
|
| 95 |
|
| 96 |
with col3:
|
| 97 |
+
st.subheader('Enter latitude/longitude coordinates:')
|
| 98 |
+
with st.form("coords_form"):
|
| 99 |
+
c1, c2 = st.columns(2)
|
| 100 |
+
with c1:
|
| 101 |
+
lat_input = st.number_input('Latitude', value=float(state.lat), min_value=-90., max_value=90., step=.01)
|
| 102 |
+
st.write('The current lat/long are:')
|
| 103 |
+
with c2:
|
| 104 |
+
lng_input = st.number_input('Longitude', value=float(state.lng), min_value=-180., max_value=180., step=.01)
|
| 105 |
+
st.write(f"{state.lat:.2f}, {state.lng:.2f}")
|
| 106 |
+
submitted = st.form_submit_button("Get Image and Prediction")
|
| 107 |
+
|
| 108 |
+
if submitted:
|
| 109 |
+
api_key = os.getenv("goog_api", "")
|
| 110 |
+
state.lat, state.lng = float(lat_input), float(lng_input)
|
| 111 |
+
state.img = fetch_satellite_tile(state.lat, state.lng, api_key=api_key)
|
| 112 |
|
| 113 |
with col2:
|
| 114 |
if state.coords_submitted:
|