Skip to content

Commit aac4f8c

Browse files
authored
Merge pull request #2 from CamiloMatus/main
feat: integrate GPW 30m Canopy Height into Batch 2 exports
2 parents 482d411 + de33b24 commit aac4f8c

4 files changed

Lines changed: 69 additions & 6 deletions

File tree

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"githubPullRequests.ignoredPullRequestBranches": [
3+
"main"
4+
]
5+
}

CPU_GEE-Data_Cube_Generator-F2A.ipynb

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"\n",
1111
"## Introduction\n",
1212
"\n",
13-
"This Colab notebook is designed to process and analyze geospatial data using Google Earth Engine (GEE). It focuses on deriving topographic, climatic, and spectral information for a specified region of interest (ROI). By leveraging GEE's powerful cloud computing capabilities, this workflow enables efficient data handling and export of key environmental variables for further analysis.\n",
13+
"This Colab notebook is designed to process and analyze geospatial data using Google Earth Engine (GEE). It focuses on deriving topographic, climatic, vegetation structure and spectral information for a specified region of interest (ROI). By leveraging GEE's powerful cloud computing capabilities, this workflow enables efficient data handling and export of key environmental variables for further analysis.\n",
1414
"\n",
1515
"\n",
1616
"### What Does This Notebook Do?:\n",
@@ -24,6 +24,7 @@
2424
"\n",
2525
"- Topographic Variables: Elevation, slope, aspect, landforms, and topographic position index (TPI).\n",
2626
"- Climate Variables: Total precipitation and average temperature over a defined period.\n",
27+
"- Structural Variables: Vegetation Height derived from the GPW dataset (30 m resolution). This dataset provides wall-to-wall coverage of all terrestrial ecosystems, used here to represent pre-fire standing fuel from the prior calendar year.\n",
2728
"- Spectral Indices: NDVI, NDBI, NDWI, and EVI derived from Sentinel-2 imagery.\n",
2829
"- Sentinel-2 Variables: Red, Green, Blue, R1, R2, R3, NIR, R4, SWIR1, and SWIR2 bands with cloud correction included.\n",
2930
"- Radar Data: VV and VH polarizations from Sentinel-1 with slope correction applied.\n",
@@ -610,14 +611,39 @@
610611
"climate_variables = apply_region_mask(ee.Image([precipitation, temperature]), region)"
611612
]
612613
},
614+
{
615+
"cell_type": "markdown",
616+
"metadata": {},
617+
"source": [
618+
"### Vegetation Height"
619+
]
620+
},
621+
{
622+
"cell_type": "code",
623+
"execution_count": null,
624+
"metadata": {},
625+
"outputs": [],
626+
"source": [
627+
"# GPW provides median vegetation height for all terrestrial ecosystems (not limited to short veg)\n",
628+
"veg_height_collection = ee.ImageCollection(\"projects/global-pasture-watch/assets/gsvh-30m/v1/short-veg-height_m\")\n",
629+
"veg_height = apply_region_mask(\n",
630+
" veg_height_collection.filterDate(f'{season_year-1}-01-01', f'{season_year}-01-01') \\\n",
631+
" .median() \\\n",
632+
" # The dataset stores values as scaled integers; multiply by 0.1 to convert to meters\n",
633+
" .multiply(0.1) \\\n",
634+
" .rename('veg_height') \\\n",
635+
" .toFloat(),\n",
636+
" region\n",
637+
")"
638+
]
639+
},
613640
{
614641
"cell_type": "markdown",
615642
"metadata": {
616643
"id": "EcDMs62JWgIb"
617644
},
618645
"source": [
619-
"### Sentinel-2 Processing\n",
620-
"\n"
646+
"### Sentinel-2 Processing"
621647
]
622648
},
623649
{
@@ -1091,6 +1117,7 @@
10911117
" (tpi, 'TPI', 'tpi', region), # 05 minutes aprox\n",
10921118
" (landform, 'Landform', 'landform', region), # 03 minutes aprox\n",
10931119
" (climate_variables, 'Climate Variables', 'climate_variables', region), # 06 minutes aprox\n",
1120+
" (veg_height, 'Vegetation Height', 'veg_height', region), # 06 minutes aprox\n",
10941121
"]\n",
10951122
"\n",
10961123
"batch_3 = [\n",

GPU_and_CPU_GEE-Data_Cube_Generator-F2A.ipynb

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"\n",
1111
"## Introduction\n",
1212
"\n",
13-
"This Colab notebook is designed to process and analyze geospatial data using Google Earth Engine (GEE). It focuses on deriving topographic, climatic, and spectral information for a specified region of interest (ROI). By leveraging GEE's powerful cloud computing capabilities, this workflow enables efficient data handling and export of key environmental variables for further analysis.\n",
13+
"This Colab notebook is designed to process and analyze geospatial data using Google Earth Engine (GEE). It focuses on deriving topographic, climatic, vegetation structure and spectral information for a specified region of interest (ROI). By leveraging GEE's powerful cloud computing capabilities, this workflow enables efficient data handling and export of key environmental variables for further analysis.\n",
1414
"\n",
1515
"\n",
1616
"### What Does This Notebook Do?:\n",
@@ -24,6 +24,7 @@
2424
"\n",
2525
"- Topographic Variables: Elevation, slope, aspect, landforms, and topographic position index (TPI).\n",
2626
"- Climate Variables: Total precipitation and average temperature over a defined period.\n",
27+
"- Structural Variables: Vegetation Height derived from the GPW dataset (30 m resolution). This dataset provides wall-to-wall coverage of all terrestrial ecosystems, used here to represent pre-fire standing fuel from the prior calendar year.\n",
2728
"- Spectral Indices: NDVI, NDBI, NDWI, and EVI derived from Sentinel-2 imagery.\n",
2829
"- Sentinel-2 Variables: Red, Green, Blue, R1, R2, R3, NIR, R4, SWIR1, and SWIR2 bands with cloud correction included.\n",
2930
"- Radar Data: VV and VH polarizations from Sentinel-1 with slope correction applied.\n",
@@ -633,6 +634,32 @@
633634
"climate_variables = apply_region_mask(ee.Image([precipitation, temperature]), region)"
634635
]
635636
},
637+
{
638+
"cell_type": "markdown",
639+
"metadata": {},
640+
"source": [
641+
"# Vegetation Height\n"
642+
]
643+
},
644+
{
645+
"cell_type": "code",
646+
"execution_count": null,
647+
"metadata": {},
648+
"outputs": [],
649+
"source": [
650+
"# GPW provides median vegetation height for all terrestrial ecosystems (not limited to short veg)\n",
651+
"veg_height_collection = ee.ImageCollection(\"projects/global-pasture-watch/assets/gsvh-30m/v1/short-veg-height_m\")\n",
652+
"veg_height = apply_region_mask(\n",
653+
" veg_height_collection.filterDate(f'{season_year-1}-01-01', f'{season_year}-01-01') \\\n",
654+
" .median() \\\n",
655+
" # The dataset stores values as scaled integers; multiply by 0.1 to convert to meters\n",
656+
" .multiply(0.1) \\\n",
657+
" .rename('veg_height') \\\n",
658+
" .toFloat(),\n",
659+
" region\n",
660+
")"
661+
]
662+
},
636663
{
637664
"cell_type": "markdown",
638665
"metadata": {
@@ -1055,6 +1082,7 @@
10551082
" 'tpi': tpi,\n",
10561083
" 'nasadem_variables': nasadem_variables,\n",
10571084
" 'climate_variables': climate_variables,\n",
1085+
" 'veg_height': veg_height,\n",
10581086
" 'sentinel2_collections': sentinel2_collections,\n",
10591087
" 'sentinel2_index_variables_collections': sentinel2_index_variables_collections,\n",
10601088
" 'sentinel1_collections': sentinel1_collections,\n",
@@ -1065,7 +1093,7 @@
10651093
"with open('/content/processed_data.pkl', 'wb') as f:\n",
10661094
" pickle.dump(data, f)\n",
10671095
"\n",
1068-
"print(\"Data Serilized and saved as processed_data.pkl\")"
1096+
"print(\"Data Serialized and saved as processed_data.pkl\")"
10691097
]
10701098
},
10711099
{
@@ -1141,8 +1169,9 @@
11411169
"# Access the variables\n",
11421170
"landform = data['landform']\n",
11431171
"tpi = data['tpi']\n",
1144-
"nasadem_variables = data['elevation_variables']\n",
1172+
"nasadem_variables = data['nasadem_variables']\n",
11451173
"climate_variables = data['climate_variables']\n",
1174+
"veg_height = data['veg_height'] \n",
11461175
"sentinel2_collections = data['sentinel2_collections']\n",
11471176
"sentinel2_index_variables_collections = data['sentinel2_index_variables_collections']\n",
11481177
"sentinel1_collections = data['sentinel1_collections']\n",
@@ -1233,6 +1262,7 @@
12331262
" (tpi, 'TPI', 'tpi', region), # 05 minutes aprox\n",
12341263
" (landform, 'Landform', 'landform', region), # 03 minutes aprox\n",
12351264
" (climate_variables, 'Climate Variables', 'climate_variables', region), # 06 minutes aprox\n",
1265+
" (veg_height, 'Vegetation Height', 'veg_height', region), # 06 minutes aprox\n",
12361266
"]\n",
12371267
"\n",
12381268
"batch_3 = [\n",

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This repository contains two Google Colab notebooks designed for geospatial data
66

77
- **Topographic Variables**: Elevation, slope, aspect, landforms, and TP.
88
- **Climatic Variables**: Total precipitation and average temperature over defined periods.
9+
- **Structural Variables**: Vegetation Height (Canopy).
910
- **Spectral Indices**: NDVI, NDBI, NDWI, EVI from Sentinel-2 imagery.
1011
- **Sentinel-2 Variables**: Includes Red, Green, Blue, and additional spectral bands.
1112
- **Radar Data**: Sentinel-1 VV and VH polarizations with slope correction.

0 commit comments

Comments
 (0)