From 32166874d909d06d45acf392300787d9a1cd90a7 Mon Sep 17 00:00:00 2001 From: Biel Stela Date: Wed, 11 Dec 2024 17:16:41 +0100 Subject: [PATCH] Add cropgrids ingestion to makefile --- data/h3_data_importer/Makefile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/data/h3_data_importer/Makefile b/data/h3_data_importer/Makefile index bd7b7385c..002b222d0 100644 --- a/data/h3_data_importer/Makefile +++ b/data/h3_data_importer/Makefile @@ -25,6 +25,7 @@ WORKDIR_LIVESTOCK_PROCESSED=data/livestock_processed WORKDIR_LIVESTOCK_GHG=data/livestock_ghg WORKDIR_DEFAULT_COMMODITY=data/default_commodity WORKDIR_EARTHSTAT=data/earthstat +WORKDIR_EARTHSTAT=data/cropgrids CHECKSUMS_PATH=data_checksums @@ -46,8 +47,6 @@ all: crop: convert-mapspam-crop-production convert-mapspam-crop-harvest convert-glw3-livestock convert-livestock-processed convert-default-commodity convert-earthstat - - indicators: convert-aqueduct convert-deforestation convert-forestGHG convert-naturalCropConversion convert-nutrientLoadReduction convert-biodiversity convert-ghg-farm convert-ghg-farm-livestock contextual-layers: convert-hdi-contextual \ @@ -57,6 +56,8 @@ contextual-layers: convert-hdi-contextual \ convert-crop-flii-loss-by-human-landuse \ convert-crop-net-conversion-by-human-landuse + + ################################### # Mapspam - commodity production # ################################### @@ -91,7 +92,17 @@ convert-earthstat: download-earthstat python raster_folder_to_h3_table.py $(WORKDIR_EARTHSTAT)/production h3_grid_earthstat_global_prod production earthstat 2000 --h3-res=6 --thread-count=$(PARALLELIZATION_FACTOR) python raster_folder_to_h3_table.py $(WORKDIR_EARTHSTAT)/harvest h3_grid_earthstat_global_ha harvest_area earthstat 2000 --h3-res=6 --thread-count=$(PARALLELIZATION_FACTOR) - +# --------------------------------------------- +# CROPGRIDS - production and harvest +# --------------------------------------------- +download-cropgrids: + mkdir -p $(WORKDIR_CROPGRIDS)/production $(WORKDIR_CROPGRIDS)/harvest + aws s3 sync $(AWS_S3_BUCKET_URL)/processed/earthstat/ $(WORKDIR_CROPGRIDS) + cd $(WORKDIR_CROPGRIDS) && sha256sum --check ../../$(CHECKSUMS_PATH)/earthstat + +convert-cropgrids: download-cropgrids + python raster_folder_to_h3_table.py $(WORKDIR_CROPGRIDS)/production h3_grid_cropgrids_global_prod production cropgrids 2000 --h3-res=6 --thread-count=$(PARALLELIZATION_FACTOR) + python raster_folder_to_h3_table.py $(WORKDIR_CROPGRIDS)/harvest h3_grid_cropgrids_global_ha harvest_area cropgrids 2000 --h3-res=6 --thread-count=$(PARALLELIZATION_FACTOR) ############################################################### # Gridded Livestock of the World (GLW3) - pasture production #