Spaces:
Sleeping
Sleeping
johnbradley
commited on
Commit
·
9f5a064
1
Parent(s):
2230d5f
Add app to demo LatLonCover
Browse fileshttps://github.com/Imageomics/LatLonCover
- README.md +3 -3
- app.py +28 -0
- requirements.txt +3 -0
README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
colorTo: purple
|
6 |
sdk: streamlit
|
7 |
sdk_version: 1.25.0
|
|
|
1 |
---
|
2 |
+
title: LatLonCoverDemo
|
3 |
+
emoji: 🐠
|
4 |
+
colorFrom: red
|
5 |
colorTo: purple
|
6 |
sdk: streamlit
|
7 |
sdk_version: 1.25.0
|
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
from cover.classify import add_classifications
|
4 |
+
|
5 |
+
st.title("LatLonCover Demo")
|
6 |
+
st.subheader('Add land coverage data to a CSV :sunglasses:')
|
7 |
+
st.markdown("[Learn more about LatLonCover.](https://github.com/Imageomics/LatLonCover)")
|
8 |
+
|
9 |
+
st.text("Upload a CSV file with latitude and longitude columns.")
|
10 |
+
|
11 |
+
col1, col2 = st.columns(2)
|
12 |
+
|
13 |
+
with col1:
|
14 |
+
lat_col = st.text_input('Enter the latitude column name', 'Lat')
|
15 |
+
|
16 |
+
with col2:
|
17 |
+
# Using "Long" to match Andromeda column name
|
18 |
+
lon_col = st.text_input('Enter the longitude column name', 'Long')
|
19 |
+
|
20 |
+
uploaded_file = st.file_uploader("Choose a CSV file")
|
21 |
+
if uploaded_file is not None:
|
22 |
+
df = pd.read_csv(uploaded_file)
|
23 |
+
|
24 |
+
with st.spinner('Fetching land coverage data...'):
|
25 |
+
add_classifications(df, lat_col=lat_col, lon_col=lon_col)
|
26 |
+
st.download_button('Download CSV', df.to_csv(), file_name="LatLonCover.csv")
|
27 |
+
|
28 |
+
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
pandas
|
3 |
+
latloncover @ git+https://github.com/Imageomics/LatLonCover.git@cropspace-api
|