aassiiyAA123 commited on
Commit
8db0c76
·
verified ·
1 Parent(s): 155783f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +346 -75
app.py CHANGED
@@ -1924,25 +1924,24 @@ def GlobalSurfaceWater_page():
1924
 
1925
  #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1926
  def GlobalSurfaceWater():
 
1927
  with st.expander("How to use this app"):
1928
- st.markdown("""
 
1929
  This interactive app allows you to explore and compare different datasets of Global Surface Water Extent (GSWE). How to use this web app?
1930
  - **Step 1:** Select a basemap from the dropdown menu on the right. The default basemap is `HYBRID`, a Google Satellite basemap with labels.
1931
  - **Step 2:** Select a region of interest (ROI) from the country dropdown menu or upload an ROI. The default ROI is the entire globe.
1932
  - **Step 3:** Select surface water datasets from the dropdown menu. You can select multiple datasets to display on the map.
1933
- """)
 
1934
 
1935
  col1, col2 = st.columns([3, 1])
1936
-
1937
- # Initialize a Folium map
1938
- map_instance = folium.Map(location=[25.5973518, 65.54495724], zoom_start=7)
1939
-
1940
- # Initialize the Draw plugin
1941
- draw = Draw(export=True)
1942
- draw.add_to(map_instance)
1943
 
 
 
1944
  roi = ee.FeatureCollection("users/giswqs/public/countries")
1945
- countries = sorted(roi.aggregate_array("name").getInfo())
 
1946
  countries = ["United States of America"]
1947
 
1948
  lc_basemaps = [
@@ -1957,89 +1956,353 @@ def GlobalSurfaceWater():
1957
  "Google " + b for b in list(geemap.basemaps.keys())[1:5]
1958
  ]
1959
  basemaps = google_basemaps + lc_basemaps
1960
-
1961
  with col2:
 
1962
  latitude = st.number_input("Map center latitude", -90.0, 90.0, 40.0, step=0.5)
1963
- longitude = st.number_input("Map center longitude", -180.0, 180.0, -100.0, step=0.5)
 
 
1964
  zoom = st.slider("Map zoom level", 1, 22, 4)
1965
 
1966
- select_country = st.checkbox("Select a country")
1967
- if select_country:
1968
- country = st.selectbox("Select a country from dropdown list", countries)
 
 
 
 
1969
  st.session_state["ROI"] = roi.filter(ee.Filter.eq("name", country))
1970
  else:
 
1971
  with st.expander("Click here to upload an ROI", False):
1972
- upload = st.file_uploader("Upload a GeoJSON, KML or Shapefile (as a zip file) to use as an ROI. 😇👇", type=["geojson", "kml", "zip"])
 
 
 
 
1973
  if upload:
1974
- with tempfile.NamedTemporaryFile(delete=False) as tmp:
1975
- tmp.write(upload.read())
1976
- tmp.seek(0) # Reset file pointer
1977
- gdf = gpd.read_file(tmp.name)
1978
- st.session_state["ROI"] = geemap.gdf_to_ee(gdf, geodesic=False)
1979
  else:
1980
  st.session_state["ROI"] = roi
1981
 
1982
- basemap = st.selectbox("Select a basemap", basemaps, index=basemaps.index("Google HYBRID"))
1983
-
1984
- if basemap in google_basemaps:
1985
- geemap.add_basemap(map_instance, basemap.replace("Google ", ""))
1986
- elif basemap in lc_basemaps:
1987
- if basemap == "ESA Global Land Cover 2020":
1988
- dataset = ee.ImageCollection("ESA/WorldCover/v100").first()
1989
- elif basemap == "ESRI Global Land Cover 2020":
1990
- dataset = ee.ImageCollection("projects/sat-io/open-datasets/landcover/ESRI_Global-LULC_10m").mosaic()
1991
- elif basemap == "US NLCD 2019":
1992
- dataset = ee.Image("USGS/NLCD_RELEASES/2019_REL/NLCD/2019").select("landcover")
1993
- elif basemap == "USDA NASS Cropland 2020":
1994
- dataset = ee.ImageCollection("USDA/NASS/CDL").filterDate("2010-01-01", "2020-01-01").first().select("cropland")
1995
-
1996
- if st.session_state["ROI"] is not None:
1997
- dataset = dataset.clipToCollection(st.session_state["ROI"])
1998
-
1999
- geemap.add_ee_layer(map_instance, dataset, {}, basemap)
2000
-
2001
- # Manage dataset selection
2002
- datasets = st.multiselect("Select surface water datasets", [
2003
- "ESA Land Use",
2004
- "JRC Max Water Extent",
2005
- "OpenStreetMap",
2006
- "HydroLakes",
2007
- "LAGOS",
2008
- "US NED Depressions",
2009
- "Global River Width",
2010
- ])
2011
-
2012
- # Styles dictionary for datasets
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2013
  styles = {
2014
- "ESA Land Use": {"color": "000000ff", "width": 1, "fillColor": "dca0dcff"},
2015
- "JRC Max Water Extent": {"color": "000000ff", "width": 1, "fillColor": "ffc2cbff"},
2016
- "OpenStreetMap": {"color": "000000ff", "width": 1, "fillColor": "bf03bfff"},
2017
- "HydroLakes": {"color": "000000ff", "width": 1, "fillColor": "4e0583ff"},
2018
- "LAGOS": {"color": "000000ff", "width": 1, "fillColor": "8f228fff"},
2019
- "US NED Depressions": {"color": "000000ff", "width": 1, "fillColor": "8d32e2ff"},
2020
- "Global River Width": {"color": "000000ff", "width": 1, "fillColor": "0000ffff"},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2021
  }
2022
 
2023
- for dataset_name in datasets:
2024
- dataset = ee.FeatureCollection(f"users/giswqs/MRB/{dataset_name.replace(' ', '_').lower()}_entireus")
2025
- geemap.add_ee_layer(map_instance, dataset.style(**styles[dataset_name]), {}, dataset_name)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2026
 
2027
- # Add watershed boundaries selection
2028
- wbds = ["NHD-HUC2", "NHD-HUC4", "NHD-HUC6", "NHD-HUC8", "NHD-HUC10"]
2029
- wbd_selection = st.multiselect("Select watershed boundaries", wbds)
 
 
 
 
 
 
 
 
 
 
2030
 
2031
- for huc in wbd_selection:
2032
- huc_data = ee.FeatureCollection(f"USGS/WBD/2017/{huc}")
2033
- geemap.add_ee_layer(map_instance, huc_data.style(**{"fillColor": "00000000"}), {}, huc)
2034
 
2035
- # Center and display the map
2036
- map_instance.set_center(longitude, latitude, zoom)
2037
- folium_static(map_instance, height=680) # Use folium_static to display the map in Streamlit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2038
 
2039
- # Data Sources Expander
2040
  with col2:
2041
  with st.expander("Data Sources"):
2042
- st.markdown("""
 
2043
  - [ESA Global Land Cover](https://developers.google.com/earth-engine/datasets/catalog/ESA_WorldCover_v100?hl=en)
2044
  - [ESRI Global Land Cover](https://samapriya.github.io/awesome-gee-community-datasets/projects/esrilc2020/)
2045
  - [Global River Width Dataset](https://samapriya.github.io/awesome-gee-community-datasets/projects/grwl/)
@@ -2047,8 +2310,16 @@ def GlobalSurfaceWater():
2047
  - [HydroSHEDS - HydroLAKES](https://samapriya.github.io/awesome-gee-community-datasets/projects/hydrolakes/)
2048
  - [OSM Global Surface Water](https://samapriya.github.io/awesome-gee-community-datasets/projects/osm_water/)
2049
  - [US NLCD](https://developers.google.com/earth-engine/datasets/catalog/USGS_NLCD_RELEASES_2019_REL_NLCD)
2050
- - [US NED Depressions (10m)](https://developers.google.com/earth-engine/datasets/catalog/USGS_3DEP)
2051
- """)
 
 
 
 
 
 
 
 
2052
 
2053
  #--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2054
  def Morphometric_Analysis_for_Watershedstreams_page():
 
1924
 
1925
  #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1926
  def GlobalSurfaceWater():
1927
+
1928
  with st.expander("How to use this app"):
1929
+
1930
+ markdown = """
1931
  This interactive app allows you to explore and compare different datasets of Global Surface Water Extent (GSWE). How to use this web app?
1932
  - **Step 1:** Select a basemap from the dropdown menu on the right. The default basemap is `HYBRID`, a Google Satellite basemap with labels.
1933
  - **Step 2:** Select a region of interest (ROI) from the country dropdown menu or upload an ROI. The default ROI is the entire globe.
1934
  - **Step 3:** Select surface water datasets from the dropdown menu. You can select multiple datasets to display on the map.
1935
+ """
1936
+ st.markdown(markdown)
1937
 
1938
  col1, col2 = st.columns([3, 1])
 
 
 
 
 
 
 
1939
 
1940
+ Map = geemap.Map(Draw_export=False, locate_control=True, plugin_LatLngPopup=True)
1941
+
1942
  roi = ee.FeatureCollection("users/giswqs/public/countries")
1943
+ # countries = roi.aggregate_array("name").getInfo()
1944
+ # countries.sort()
1945
  countries = ["United States of America"]
1946
 
1947
  lc_basemaps = [
 
1956
  "Google " + b for b in list(geemap.basemaps.keys())[1:5]
1957
  ]
1958
  basemaps = google_basemaps + lc_basemaps
 
1959
  with col2:
1960
+
1961
  latitude = st.number_input("Map center latitude", -90.0, 90.0, 40.0, step=0.5)
1962
+ longitude = st.number_input(
1963
+ "Map center longitude", -180.0, 180.0, -100.0, step=0.5
1964
+ )
1965
  zoom = st.slider("Map zoom level", 1, 22, 4)
1966
 
1967
+ select = st.checkbox("Select a country")
1968
+ if select:
1969
+ country = st.selectbox(
1970
+ "Select a country from dropdown list",
1971
+ countries,
1972
+ index=countries.index("United States of America"),
1973
+ )
1974
  st.session_state["ROI"] = roi.filter(ee.Filter.eq("name", country))
1975
  else:
1976
+
1977
  with st.expander("Click here to upload an ROI", False):
1978
+ upload = st.file_uploader(
1979
+ "Upload a GeoJSON, KML or Shapefile (as a zif file) to use as an ROI. 😇👇",
1980
+ type=["geojson", "kml", "zip"],
1981
+ )
1982
+
1983
  if upload:
1984
+ gdf = uploaded_file_to_gdf(upload)
1985
+ st.session_state["ROI"] = geemap.gdf_to_ee(gdf, geodesic=False)
1986
+ # Map.add_gdf(gdf, "ROI")
 
 
1987
  else:
1988
  st.session_state["ROI"] = roi
1989
 
1990
+ basemap = st.selectbox(
1991
+ "Select a basemap",
1992
+ basemaps,
1993
+ index=basemaps.index("Google HYBRID"),
1994
+ )
1995
+ if basemap in google_basemaps:
1996
+ Map.add_basemap(basemap.replace("Google ", ""))
1997
+ elif basemap in lc_basemaps:
1998
+
1999
+ if basemap == "ESA Global Land Cover 2020":
2000
+ dataset = ee.ImageCollection("ESA/WorldCover/v100").first()
2001
+ if st.session_state["ROI"] is not None:
2002
+ dataset = dataset.clipToCollection(st.session_state["ROI"])
2003
+
2004
+ Map.addLayer(dataset, {}, "ESA Landcover")
2005
+ Map.add_legend(title="ESA Landcover", builtin_legend="ESA_WorldCover")
2006
+ elif basemap == "ESRI Global Land Cover 2020":
2007
+
2008
+ esri_lulc10 = ee.ImageCollection(
2009
+ "projects/sat-io/open-datasets/landcover/ESRI_Global-LULC_10m"
2010
+ )
2011
+ legend_dict = {
2012
+ "names": [
2013
+ "Water",
2014
+ "Trees",
2015
+ "Grass",
2016
+ "Flooded Vegetation",
2017
+ "Crops",
2018
+ "Scrub/Shrub",
2019
+ "Built Area",
2020
+ "Bare Ground",
2021
+ "Snow/Ice",
2022
+ "Clouds",
2023
+ ],
2024
+ "colors": [
2025
+ "#1A5BAB",
2026
+ "#358221",
2027
+ "#A7D282",
2028
+ "#87D19E",
2029
+ "#FFDB5C",
2030
+ "#EECFA8",
2031
+ "#ED022A",
2032
+ "#EDE9E4",
2033
+ "#F2FAFF",
2034
+ "#C8C8C8",
2035
+ ],
2036
+ }
2037
+
2038
+ vis_params = {"min": 1, "max": 10, "palette": legend_dict["colors"]}
2039
+ esri_lulc10 = esri_lulc10.mosaic()
2040
+
2041
+ if st.session_state["ROI"] is not None:
2042
+ esri_lulc10 = esri_lulc10.clipToCollection(st.session_state["ROI"])
2043
+ Map.addLayer(esri_lulc10, vis_params, "ESRI Global Land Cover")
2044
+ Map.add_legend(title="ESRI Landcover", builtin_legend="ESRI_LandCover")
2045
+
2046
+ elif basemap == "US NLCD 2019":
2047
+ nlcd = ee.Image("USGS/NLCD_RELEASES/2019_REL/NLCD/2019").select(
2048
+ "landcover"
2049
+ )
2050
+ if st.session_state["ROI"] is not None:
2051
+ nlcd = nlcd.clipToCollection(st.session_state["ROI"])
2052
+ Map.addLayer(nlcd, {}, "US NLCD 2019")
2053
+ Map.add_legend(title="NLCD Land Cover", builtin_legend="NLCD")
2054
+
2055
+ elif basemap == "USDA NASS Cropland 2020":
2056
+ cropland = (
2057
+ ee.ImageCollection("USDA/NASS/CDL")
2058
+ .filterDate("2010-01-01", "2020-01-01")
2059
+ .first()
2060
+ .select("cropland")
2061
+ )
2062
+
2063
+ if st.session_state["ROI"] is not None:
2064
+ cropland = cropland.clipToCollection(st.session_state["ROI"])
2065
+
2066
+ Map.addLayer(cropland, {}, "USDA NASS Cropland 2020")
2067
+
2068
+ # elif "HydroSHEDS" in datasets:
2069
+ # hydrolakes = ee.FeatureCollection(
2070
+ # "projects/sat-io/open-datasets/HydroLakes/lake_poly_v10"
2071
+ # )
2072
+ # if st.session_state["ROI"] is not None:
2073
+ # hydrolakes = hydrolakes.filterBounds(st.session_state["ROI"])
2074
+ # Map.addLayer(hydrolakes, {"color": "#00008B"}, "HydroSHEDS - HydroLAKES")
2075
+
2076
+ # roi = ee.FeatureCollection("users/giswqs/MRB/NWI_HU8_Boundary_Simplify")
2077
+ style = {
2078
+ "color": "000000ff",
2079
+ "width": 1,
2080
+ "lineType": "solid",
2081
+ "fillColor": "00000000",
2082
+ }
2083
+
2084
+ # select_holder = col2.empty()
2085
+ with col2:
2086
+ datasets = st.multiselect(
2087
+ "Select surface water datasets",
2088
+ [
2089
+ "ESA Land Use",
2090
+ "JRC Max Water Extent",
2091
+ "OpenStreetMap",
2092
+ "HydroLakes",
2093
+ "LAGOS",
2094
+ "US NED Depressions",
2095
+ "Global River Width",
2096
+ ],
2097
+ )
2098
+
2099
+ # styles = {
2100
+ # "ESA Land Use": {
2101
+ # "color": "dca0dcff",
2102
+ # "width": width,
2103
+ # "fillColor": "e4bbe4ff",
2104
+ # },
2105
+ # "JRC Max Water Extent": {
2106
+ # "color": "ffc2cbff",
2107
+ # "width": width,
2108
+ # "fillColor": "fdd1d8ff",
2109
+ # },
2110
+ # "OpenStreetMap": {
2111
+ # "color": "bf03bfff",
2112
+ # "width": width,
2113
+ # "fillColor": "ebb2ebff",
2114
+ # },
2115
+ # "HydroLakes": {
2116
+ # "color": "4e0583ff",
2117
+ # "width": width,
2118
+ # "fillColor": "a47fbfff",
2119
+ # },
2120
+ # "LAGOS": {
2121
+ # "color": "8f228fff",
2122
+ # "width": width,
2123
+ # "fillColor": "cb99cbff",
2124
+ # },
2125
+ # "US NED Depressions": {
2126
+ # "color": "8d32e2ff",
2127
+ # "width": width,
2128
+ # "fillColor": "c394efff",
2129
+ # },
2130
+ # }
2131
+
2132
+ width = 1
2133
  styles = {
2134
+ "ESA Land Use": {
2135
+ "color": "000000ff",
2136
+ "width": width,
2137
+ "fillColor": "dca0dcff",
2138
+ },
2139
+ "JRC Max Water Extent": {
2140
+ "color": "000000ff",
2141
+ "width": width,
2142
+ "fillColor": "ffc2cbff",
2143
+ },
2144
+ "OpenStreetMap": {
2145
+ "color": "000000ff",
2146
+ "width": width,
2147
+ "fillColor": "bf03bfff",
2148
+ },
2149
+ "HydroLakes": {
2150
+ "color": "000000ff",
2151
+ "width": width,
2152
+ "fillColor": "4e0583ff",
2153
+ },
2154
+ "LAGOS": {
2155
+ "color": "000000ff",
2156
+ "width": width,
2157
+ "fillColor": "8f228fff",
2158
+ },
2159
+ "US NED Depressions": {
2160
+ "color": "000000ff",
2161
+ "width": width,
2162
+ "fillColor": "8d32e2ff",
2163
+ },
2164
+ "Global River Width": {
2165
+ "color": "000000ff",
2166
+ "width": width,
2167
+ "fillColor": "0000ffff",
2168
+ },
2169
  }
2170
 
2171
+ if "ESA Land Use" in datasets:
2172
+ dataset = ee.FeatureCollection("users/giswqs/MRB/ESA_entireUS")
2173
+ Map.addLayer(dataset.style(**styles["ESA Land Use"]), {}, "ESA Land Use")
2174
+
2175
+ if "JRC Max Water Extent" in datasets:
2176
+ dataset = ee.FeatureCollection("users/giswqs/MRB/JRC_entireUS")
2177
+ Map.addLayer(
2178
+ dataset.style(**styles["JRC Max Water Extent"]), {}, "JRC Max Water Extent"
2179
+ )
2180
+
2181
+ if "OpenStreetMap" in datasets:
2182
+ dataset = ee.FeatureCollection("users/giswqs/MRB/OSM_entireUS")
2183
+ Map.addLayer(dataset.style(**styles["OpenStreetMap"]), {}, "OpenStreetMap")
2184
+
2185
+ if "HydroLakes" in datasets:
2186
+ dataset = ee.FeatureCollection("users/giswqs/MRB/HL_entireUS")
2187
+ Map.addLayer(dataset.style(**styles["HydroLakes"]), {}, "HydroLakes")
2188
+
2189
+ if "LAGOS" in datasets:
2190
+ dataset = ee.FeatureCollection("users/giswqs/MRB/LAGOS_entireUS")
2191
+ Map.addLayer(dataset.style(**styles["LAGOS"]), {}, "LAGOS")
2192
+
2193
+ if "US NED Depressions" in datasets:
2194
+ depressions = ee.FeatureCollection("users/giswqs/MRB/US_depressions")
2195
+ Map.addLayer(
2196
+ depressions.style(**styles["US NED Depressions"]), {}, "US NED Depressions"
2197
+ )
2198
+
2199
+ if datasets:
2200
+ legend_datasets = datasets[:]
2201
+ # if "Global River Width" in legend_datasets:
2202
+ # legend_datasets.remove("Global River Width")
2203
+ legend_dict = {}
2204
+ for dataset in legend_datasets:
2205
+ legend_dict[dataset] = styles[dataset]["fillColor"][:6]
2206
+
2207
+ if len(legend_datasets) > 0:
2208
+
2209
+ Map.add_legend(title="Surface Water", legend_dict=legend_dict)
2210
+
2211
+ # if "JRC Global Surface Water" in datasets:
2212
+ # jrc = ee.Image("JRC/GSW1_3/GlobalSurfaceWater")
2213
+ # vis = {
2214
+ # "bands": ["occurrence"],
2215
+ # "min": 0.0,
2216
+ # "max": 100.0,
2217
+ # "palette": cm.palettes.coolwarm_r,
2218
+ # }
2219
+ # Map.addLayer(jrc, vis, "JRC Global Surface Water")
2220
+ # Map.add_colorbar(vis, label="Surface water occurrence (%)")
2221
+
2222
+ if "Global River Width" in datasets:
2223
+ water_mask = ee.ImageCollection(
2224
+ "projects/sat-io/open-datasets/GRWL/water_mask_v01_01"
2225
+ ).median()
2226
+
2227
+ grwl_summary = ee.FeatureCollection(
2228
+ "projects/sat-io/open-datasets/GRWL/grwl_SummaryStats_v01_01"
2229
+ )
2230
+ grwl_water_vector = ee.FeatureCollection(
2231
+ "projects/sat-io/open-datasets/GRWL/water_vector_v01_01"
2232
+ )
2233
+
2234
+ if st.session_state["ROI"] is not None:
2235
+ water_mask = water_mask.clipToCollection(st.session_state["ROI"])
2236
+ grwl_summary = grwl_summary.filterBounds(st.session_state["ROI"])
2237
+
2238
+ Map.addLayer(water_mask, {"palette": "blue"}, "GRWL RIver Mask")
2239
+ Map.addLayer(
2240
+ grwl_water_vector.style(**{"fillColor": "00000000", "color": "FF5500"}),
2241
+ {},
2242
+ "GRWL Centerline",
2243
+ False,
2244
+ )
2245
+ Map.addLayer(
2246
+ grwl_summary.style(**{"fillColor": "00000000", "color": "EE5500"}),
2247
+ {},
2248
+ "GRWL Centerline Simplified",
2249
+ )
2250
 
2251
+ show = False
2252
+ if select and country is not None:
2253
+ name = country
2254
+ style["color"] = "#000000"
2255
+ style["width"] = 2
2256
+ show = True
2257
+ elif upload:
2258
+ name = "ROI"
2259
+ style["color"] = "#FFFF00"
2260
+ style["width"] = 2
2261
+ show = True
2262
+ else:
2263
+ name = "World"
2264
 
2265
+ Map.addLayer(st.session_state["ROI"].style(**style), {}, name, show)
2266
+ Map.centerObject(st.session_state["ROI"])
 
2267
 
2268
+ with col2:
2269
+ wbds = [
2270
+ "NHD-HUC2",
2271
+ "NHD-HUC4",
2272
+ "NHD-HUC6",
2273
+ "NHD-HUC8",
2274
+ "NHD-HUC10",
2275
+ ]
2276
+ wbd = st.multiselect("Select watershed boundaries", wbds)
2277
+
2278
+ if "NHD-HUC2" in wbd:
2279
+ huc2 = ee.FeatureCollection("USGS/WBD/2017/HUC02")
2280
+ Map.addLayer(huc2.style(**{"fillColor": "00000000"}), {}, "NHD-HUC2")
2281
+
2282
+ if "NHD-HUC4" in wbd:
2283
+ huc4 = ee.FeatureCollection("USGS/WBD/2017/HUC04")
2284
+ Map.addLayer(huc4.style(**{"fillColor": "00000000"}), {}, "NHD-HUC4")
2285
+
2286
+ if "NHD-HUC6" in wbd:
2287
+ huc6 = ee.FeatureCollection("USGS/WBD/2017/HUC06")
2288
+ Map.addLayer(huc6.style(**{"fillColor": "00000000"}), {}, "NHD-HUC6")
2289
+
2290
+ if "NHD-HUC8" in wbd:
2291
+ huc8 = ee.FeatureCollection("USGS/WBD/2017/HUC08")
2292
+ Map.addLayer(huc8.style(**{"fillColor": "00000000"}), {}, "NHD-HUC8")
2293
+
2294
+ if "NHD-HUC10" in wbd:
2295
+ huc10 = ee.FeatureCollection("USGS/WBD/2017/HUC10")
2296
+ Map.addLayer(huc10.style(**{"fillColor": "00000000"}), {}, "NHD-HUC10")
2297
+
2298
+ with col1:
2299
+ Map.set_center(longitude, latitude, zoom)
2300
+ Map.to_streamlit(height=680)
2301
 
 
2302
  with col2:
2303
  with st.expander("Data Sources"):
2304
+
2305
+ desc = """
2306
  - [ESA Global Land Cover](https://developers.google.com/earth-engine/datasets/catalog/ESA_WorldCover_v100?hl=en)
2307
  - [ESRI Global Land Cover](https://samapriya.github.io/awesome-gee-community-datasets/projects/esrilc2020/)
2308
  - [Global River Width Dataset](https://samapriya.github.io/awesome-gee-community-datasets/projects/grwl/)
 
2310
  - [HydroSHEDS - HydroLAKES](https://samapriya.github.io/awesome-gee-community-datasets/projects/hydrolakes/)
2311
  - [OSM Global Surface Water](https://samapriya.github.io/awesome-gee-community-datasets/projects/osm_water/)
2312
  - [US NLCD](https://developers.google.com/earth-engine/datasets/catalog/USGS_NLCD_RELEASES_2019_REL_NLCD)
2313
+ - [US NED Depressions (10m)](https://developers.google.com/earth-engine/datasets/catalog/USGS_3DEP_10m)
2314
+ - [USDA NASS Cropland](https://developers.google.com/earth-engine/datasets/catalog/USDA_NASS_CDL)
2315
+ - [NHD Waterboday](https://samapriya.github.io/awesome-gee-community-datasets/projects/nhd)
2316
+ - [NHD-HUC2](https://developers.google.com/earth-engine/datasets/catalog/USGS_WBD_2017_HUC02)
2317
+ - [NHD-HUC4](https://developers.google.com/earth-engine/datasets/catalog/USGS_WBD_2017_HUC04)
2318
+ - [NHD-HUC6](https://developers.google.com/earth-engine/datasets/catalog/USGS_WBD_2017_HUC06)
2319
+ - [NHD-HUC8](https://developers.google.com/earth-engine/datasets/catalog/USGS_WBD_2017_HUC08)
2320
+ - [NHD-HUC10](https://developers.google.com/earth-engine/datasets/catalog/USGS_WBD_2017_HUC10)
2321
+ """
2322
+ st.markdown(desc)
2323
 
2324
  #--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2325
  def Morphometric_Analysis_for_Watershedstreams_page():