From d4df628a6d14b689d76448d160b37c9dae895649 Mon Sep 17 00:00:00 2001 From: elpamart Date: Thu, 21 Sep 2023 16:41:39 +0200 Subject: [PATCH] add pipe for ingesting the biodiversity indicator data --- data/h3_data_importer/Makefile | 12 ++++++++++++ data/preprocessing/README.md | 11 +++++++++++ data/preprocessing/biodiversity/Makefile | 1 + 3 files changed, 24 insertions(+) diff --git a/data/h3_data_importer/Makefile b/data/h3_data_importer/Makefile index 16aeb16f2..e5164ba7e 100644 --- a/data/h3_data_importer/Makefile +++ b/data/h3_data_importer/Makefile @@ -21,6 +21,7 @@ WORKDIR_DEFORESTATION=data/hansen_loss WORKDIR_GHG=data/forest_ghg WORKDIR_WOODPULP=data/woodpulp WORKING_NATURAL_CROP_CONVERSION=data/natural_crop_conversion +WORKDIR_BIODIVERSITY=data/biodiversity CHECKSUMS_PATH=data_checksums @@ -52,6 +53,7 @@ indicators: make convert-forestGHG make convert-satDeforestation make convert-naturalCropConversion + make convert-biodiversity contextual-layers: convert-hdi-contextual convert-blue-water-contextual @@ -234,6 +236,16 @@ convert-naturalCropConversion: download-naturalCropConversion python raster_folder_to_h3_table.py $(WORKING_NATURAL_CROP_CONVERSION) h3_grid_natural_crop_conversion_global indicator NECR 2022 --h3-res=6 --thread-count=$(PARALLELIZATION_FACTOR) +download-biodiversity: + # download and check + mkdir -p $(WORKDIR_BIODIVERSITY) + aws s3 sync $(AWS_S3_BUCKET_URL)/processed/biodiversity $(WORKDIR_BIODIVERSITY) + cd $(WORKDIR_BIODIVERSITY) && sha256sum --check ../../$(CHECKSUMS_PATH)/biodiversity + +convert-biodiversity: download-biodiversity + @echo "Converting biodiversity data... " + python raster_folder_to_h3_table.py $(WORKDIR_BIODIVERSITY) h3_grid_biodiversity_global indicator BL_LUC_S 2022 --h3-res=6 --thread-count=$(PARALLELIZATION_FACTOR) + ################################## # Satelligence data # diff --git a/data/preprocessing/README.md b/data/preprocessing/README.md index aec6bf489..12318ba8e 100644 --- a/data/preprocessing/README.md +++ b/data/preprocessing/README.md @@ -59,3 +59,14 @@ make all Read more about this pipeline in the [natural_crop_conversion/README.md](natural_crop_conversion/README.md) file. +### Biodiversity + +It contains the computation of the biodiversity - forest landscape integrity loss dataset . + +To run the pipeline, `cd biodiversity` and + +```bash +make all +``` + +Read more about this pipeline in the [biodiversity/README.md](biodiversity/README.md) file. diff --git a/data/preprocessing/biodiversity/Makefile b/data/preprocessing/biodiversity/Makefile index 11a26c7fd..ca5f6d561 100644 --- a/data/preprocessing/biodiversity/Makefile +++ b/data/preprocessing/biodiversity/Makefile @@ -15,6 +15,7 @@ download_forest_landscape_integrity_loss: "gs://landgriffon-gee-bucket/landscape_indicators_20230821/natural_crop_flii_loss_by_human_lu_50km_1000m.tif" \ $(data_dir) +# TODO- Review resampling method. We can use max resampling method to be conservative as the most intact areas are the most important to avoid. resample_forest_landscape_integrity_loss: rio warp \ $(data_dir)/natural_crop_flii_loss_by_human_lu_50km_1000m.tif \