From f37a8ac885013be7a430da5d28661eb77e2f84ca Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Fri, 25 Oct 2024 11:41:26 -0400 Subject: [PATCH] Add data repository --- pages/00_home.py | 1 + pages/01_morocco.py | 6 +++--- pages/02_libya.py | 6 +++--- pages/03_maui.py | 6 +++--- pages/04_helen.py | 6 +++--- pages/05_milton.py | 7 +++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pages/00_home.py b/pages/00_home.py index 765ffb3..ba71cfb 100644 --- a/pages/00_home.py +++ b/pages/00_home.py @@ -14,6 +14,7 @@ def Page(): - Web App: - GitHub: - Hugging Face: + - Data Repository: """ diff --git a/pages/01_morocco.py b/pages/01_morocco.py index 8b78e4a..8cf8cd6 100644 --- a/pages/01_morocco.py +++ b/pages/01_morocco.py @@ -104,7 +104,7 @@ def reset_map(change): reset.value = False date_picker.value = pd.to_datetime("2021-01-01").date() m.remove_layer(m.find_layer("Footprint")) - m.controls = m.controls[:-1] + m.add_gdf( m.footprint, layer_name="Footprint", @@ -120,7 +120,7 @@ def reset_map(change): def change_dataset(change): default_geojson = f"{url}/datasets/{change.new}_union.geojson" m.layers = m.layers[:2] - m.controls = m.controls[:-1] + basename = os.path.basename(default_geojson) tempdir = tempfile.gettempdir() tmp_geojson = os.path.join(tempdir, basename) @@ -142,7 +142,7 @@ def change_date(change): sub_catalog_ids = sub_gdf["catalog_id"].values.tolist() image.options = sub_catalog_ids m.remove_layer(m.find_layer("Footprint")) - m.controls = m.controls[:-1] + m.add_gdf( sub_gdf, layer_name="Footprint", diff --git a/pages/02_libya.py b/pages/02_libya.py index 40860fd..289940b 100644 --- a/pages/02_libya.py +++ b/pages/02_libya.py @@ -104,7 +104,7 @@ def reset_map(change): reset.value = False date_picker.value = pd.to_datetime("2021-01-01").date() m.remove_layer(m.find_layer("Footprint")) - m.controls = m.controls[:-1] + m.add_gdf( m.footprint, layer_name="Footprint", @@ -120,7 +120,7 @@ def reset_map(change): def change_dataset(change): default_geojson = f"{url}/datasets/{change.new}_union.geojson" m.layers = m.layers[:2] - m.controls = m.controls[:-1] + basename = os.path.basename(default_geojson) tempdir = tempfile.gettempdir() tmp_geojson = os.path.join(tempdir, basename) @@ -142,7 +142,7 @@ def change_date(change): sub_catalog_ids = sub_gdf["catalog_id"].values.tolist() image.options = sub_catalog_ids m.remove_layer(m.find_layer("Footprint")) - m.controls = m.controls[:-1] + m.add_gdf( sub_gdf, layer_name="Footprint", diff --git a/pages/03_maui.py b/pages/03_maui.py index fbd5f68..0062a2c 100644 --- a/pages/03_maui.py +++ b/pages/03_maui.py @@ -104,7 +104,7 @@ def reset_map(change): reset.value = False date_picker.value = pd.to_datetime("2021-01-01").date() m.remove_layer(m.find_layer("Footprint")) - m.controls = m.controls[:-1] + m.add_gdf( m.footprint, layer_name="Footprint", @@ -120,7 +120,7 @@ def reset_map(change): def change_dataset(change): default_geojson = f"{url}/datasets/{change.new}_union.geojson" m.layers = m.layers[:2] - m.controls = m.controls[:-1] + basename = os.path.basename(default_geojson) tempdir = tempfile.gettempdir() tmp_geojson = os.path.join(tempdir, basename) @@ -142,7 +142,7 @@ def change_date(change): sub_catalog_ids = sub_gdf["catalog_id"].values.tolist() image.options = sub_catalog_ids m.remove_layer(m.find_layer("Footprint")) - m.controls = m.controls[:-1] + m.add_gdf( sub_gdf, layer_name="Footprint", diff --git a/pages/04_helen.py b/pages/04_helen.py index 833e8b4..ae59d15 100644 --- a/pages/04_helen.py +++ b/pages/04_helen.py @@ -104,7 +104,7 @@ def reset_map(change): reset.value = False date_picker.value = pd.to_datetime("2021-01-01").date() m.remove_layer(m.find_layer("Footprint")) - m.controls = m.controls[:-1] + m.add_gdf( m.footprint, layer_name="Footprint", @@ -120,7 +120,7 @@ def reset_map(change): def change_dataset(change): default_geojson = f"{url}/datasets/{change.new}_union.geojson" m.layers = m.layers[:2] - m.controls = m.controls[:-1] + basename = os.path.basename(default_geojson) tempdir = tempfile.gettempdir() tmp_geojson = os.path.join(tempdir, basename) @@ -142,7 +142,7 @@ def change_date(change): sub_catalog_ids = sub_gdf["catalog_id"].values.tolist() image.options = sub_catalog_ids m.remove_layer(m.find_layer("Footprint")) - m.controls = m.controls[:-1] + m.add_gdf( sub_gdf, layer_name="Footprint", diff --git a/pages/05_milton.py b/pages/05_milton.py index ab16bb6..34997dd 100644 --- a/pages/05_milton.py +++ b/pages/05_milton.py @@ -104,7 +104,7 @@ def reset_map(change): reset.value = False date_picker.value = pd.to_datetime("2021-01-01").date() m.remove_layer(m.find_layer("Footprint")) - m.controls = m.controls[:-1] + m.add_gdf( m.footprint, layer_name="Footprint", @@ -120,7 +120,7 @@ def reset_map(change): def change_dataset(change): default_geojson = f"{url}/datasets/{change.new}_union.geojson" m.layers = m.layers[:2] - m.controls = m.controls[:-1] + basename = os.path.basename(default_geojson) tempdir = tempfile.gettempdir() tmp_geojson = os.path.join(tempdir, basename) @@ -142,8 +142,7 @@ def change_date(change): sub_catalog_ids = sub_gdf["catalog_id"].values.tolist() image.options = sub_catalog_ids m.remove_layer(m.find_layer("Footprint")) - m.controls = m.controls[:-1] - m.controls = m.controls[:-1] + m.add_gdf( sub_gdf, layer_name="Footprint",