|
import streamlit as st |
|
import json |
|
|
|
|
|
st.set_page_config(layout="wide") |
|
m = st.markdown( |
|
""" |
|
<style> |
|
div.stButton > button:first-child { |
|
background-color: #006400; |
|
color:#ffffff; |
|
} |
|
</style>""", |
|
unsafe_allow_html=True, |
|
) |
|
|
|
|
|
with open("sentinel_datasets.json") as f: |
|
data = json.load(f) |
|
|
|
|
|
st.title("Sentinel Dataset Selector") |
|
|
|
|
|
main_selection = st.selectbox("Select Sentinel Dataset Category", list(data.keys())) |
|
|
|
|
|
if main_selection: |
|
sub_options = data[main_selection]["sub_options"] |
|
sub_selection = st.selectbox("Select Specific Dataset ID", list(sub_options.keys())) |
|
|
|
|
|
if sub_selection: |
|
bands = sub_options[sub_selection] |
|
st.write("Select up to 3 bands:") |
|
|
|
|
|
selected_bands = [] |
|
|
|
|
|
for band in bands: |
|
if st.checkbox(band, key=band): |
|
selected_bands.append(band) |
|
|
|
if len(selected_bands) == 3: |
|
break |
|
|
|
|
|
if len(selected_bands) > 3: |
|
st.warning("You can select a maximum of 3 bands.") |
|
|
|
|
|
st.write("Selected Bands:", selected_bands) |
|
|