Skip to content

Commit

Permalink
Merge pull request #203 from wri/feature/palm_risk_2023
Browse files Browse the repository at this point in the history
GTC-2620 Palm risk 2023 update
  • Loading branch information
manukala6 authored Dec 14, 2023
2 parents 2ac9fca + 18dfdba commit 8d5edad
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/main/resources/raster-catalog-pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"name":"wdpa_protected_areas",
"source_uri":"s3://gfw-data-lake/wdpa_protected_areas/v202208/raster/epsg-4326/{grid_size}/{row_count}/iucn_cat/gdal-geotiff/{tile_id}.tif"
"source_uri":"s3://gfw-data-lake/wdpa_protected_areas/v202308/raster/epsg-4326/{grid_size}/{row_count}/iucn_cat/gdal-geotiff/{tile_id}.tif"
},
{
"name":"detailed_wdpa_protected_areas",
Expand Down Expand Up @@ -118,7 +118,7 @@
},
{
"name":"gfw_peatlands",
"source_uri":"s3://gfw-data-lake/gfw_peatlands/v20200807/raster/epsg-4326/{grid_size}/{row_count}/Mg_CO2_ha/gdal-geotiff/{tile_id}.tif"
"source_uri":"s3://gfw-data-lake/gfw_peatlands/v20230315/raster/epsg-4326/{grid_size}/{row_count}/Mg_CO2_ha/gdal-geotiff/{tile_id}.tif"
},
{
"name":"gfw_deadwood_carbon",
Expand Down Expand Up @@ -230,7 +230,7 @@
},
{
"name":"gfw_planted_forests",
"source_uri":"s3://gfw-data-lake/gfw_planted_forests/v20201209/raster/epsg-4326/{grid_size}/{row_count}/type/gdal-geotiff/{tile_id}.tif"
"source_uri":"s3://gfw-data-lake/gfw_planted_forests/v20230911/raster/epsg-4326/{grid_size}/{row_count}/type/gdal-geotiff/{tile_id}.tif"
},
{
"name":"per_forest_concessions",
Expand Down
19 changes: 10 additions & 9 deletions src/main/scala/org/globalforestwatch/layers/PlantedForests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ case class PlantedForests(gridTile: GridTile, kwargs: Map[String, Any]) extends

def lookup(value: Int): String = value match {
case 1 => "Fruit"
case 2 => "Fruit Mix"
case 3 => "Oil Palm "
case 4 => "Oil Palm Mix"
case 2 => "Fruit mix"
case 3 => "Oil palm "
case 4 => "Oil palm mix"
case 5 => "Other"
case 6 => "Rubber"
case 7 => "Rubber Mix"
case 8 => "Unknown"
case 9 => "Unknown Mix"
case 10 => "Wood fiber / Timber"
case 11 => "Wood fiber / Timber Mix"
case 6 => "Other mix"
case 7 => "Rubber"
case 8 => "Rubber mix"
case 9 => "Unknown"
case 10 => "Unknown mix"
case 11 => "Wood fiber or timber"
case 12 => "Wood fiber or timber Mix"
case _ => ""
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ object ForestChangeDiagnosticAnalysis extends SummaryAnalysis {
// March. So, the most recent data relates to soy planted late
// in previous year. So, we should only intersect with tree
// cover loss from previous year.
tree_cover_loss_soy_yearly = data.tree_cover_loss_soy_yearly.limitToMaxYear(2021)
tree_cover_loss_soy_yearly = data.tree_cover_loss_soy_yearly.limitToMaxYear(2022)
)
}
}
Expand Down Expand Up @@ -201,7 +201,7 @@ object ForestChangeDiagnosticAnalysis extends SummaryAnalysis {
usingIndex = true
)

// This fire data is an input to the palm risk tool, so limit data to 2021 to sync
// This fire data is an input to the palm risk tool, so limit data to 2022 to sync
// with the palm risk tool.
joinedRDD.rdd
.map { case (poly, points) =>
Expand All @@ -220,7 +220,7 @@ object ForestChangeDiagnosticAnalysis extends SummaryAnalysis {
}
.reduceByKey(_ merge _)
.mapValues { fires =>
aggregateFireData(fires.merge(ForestChangeDiagnosticDataLossYearly.prefilled)).limitToMaxYear(2021)
aggregateFireData(fires.merge(ForestChangeDiagnosticDataLossYearly.prefilled)).limitToMaxYear(2022)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ case class ForestChangeDiagnosticData(
*/
def withUpdatedCommodityRisk(): ForestChangeDiagnosticData = {

/* Exclude the last year, limit data to 2021 to sync with palm risk tool:
/* Exclude the last year, limit data to 2022 to sync with palm risk tool:
commodity_threat_deforestation, commodity_threat_peat, commodity_threat_protected_areas use year n and year n-1.
Including information from the current year would under-represent these values as it's in progress.
*/
val minLossYear = ForestChangeDiagnosticDataLossYearly.prefilled.value.keys.min
val maxLossYear = 2021
val maxLossYear = 2022
val years: List[Int] = List.range(minLossYear + 1, maxLossYear + 1)

val forestValueIndicator: ForestChangeDiagnosticDataValueYearly =
Expand Down

This file was deleted.

Loading

0 comments on commit 8d5edad

Please sign in to comment.