diff --git a/src/main/resources/raster-catalog-default.json b/src/main/resources/raster-catalog-default.json index 26052040..53869cfc 100644 --- a/src/main/resources/raster-catalog-default.json +++ b/src/main/resources/raster-catalog-default.json @@ -268,8 +268,6 @@ "name":"gfw_forest_flux_full_extent_net_flux", "source_uri": "s3://gfw-data-lake/gfw_forest_flux_full_extent_net_flux/v20240402/raster/epsg-4326/{grid_size}/{row_count}/Mg_CO2e_ha-1/geotiff/{tile_id}.tif" }, - - { "name":"gfw_forest_flux_aboveground_carbon_stock_in_emissions_year", "source_uri":"s3://gfw-data-lake/gfw_forest_flux_aboveground_carbon_stock_in_emissions_year/v20240308/raster/epsg-4326/{grid_size}/{row_count}/Mg_C_ha-1/geotiff/{tile_id}.tif" @@ -310,7 +308,6 @@ "name":"gfw_soil_carbon_stock_2000", "source_uri": "s3://gfw-data-lake/gfw_soil_carbon_stock_2000/v20231108/raster/epsg-4326/{grid_size}/{row_count}/Mg_C_ha-1/geotiff/{tile_id}.tif" }, - { "name":"gfw_forest_flux_soil_carbon_stock_2000_stdev", "source_uri":"s3://gfw-data-lake/gfw_forest_flux_soil_carbon_stock_2000_stdev/v20231108/raster/epsg-4326/{grid_size}/{row_count}/Mg_C_ha-1/geotiff/{tile_id}.tif" diff --git a/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalDF.scala b/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalDF.scala index 8af8fc0b..19f0a557 100644 --- a/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalDF.scala +++ b/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalDF.scala @@ -28,6 +28,7 @@ object AnnualUpdateMinimalDF { "is__ifl_intact_forest_landscapes_2000", "wri_tropical_tree_cover__decile", "umd_global_land_cover__ipcc_class", + "sbtn_natural_forests__class", // TODO delete next data update "umd_tree_cover_density__threshold", @@ -76,6 +77,7 @@ object AnnualUpdateMinimalDF { $"data_group.intactForestLandscapes2000" as "is__ifl_intact_forest_landscapes_2000", $"data_group.tmlDensity" as "wri_tropical_tree_cover__decile", $"data_group.landCover" as "umd_global_land_cover__ipcc_class", + $"data_group.naturalForests" as "sbtn_natural_forests__class", $"data.treecoverExtent2000" as "umd_tree_cover_extent_2000__ha", $"data.treecoverExtent2010" as "umd_tree_cover_extent_2010__ha", @@ -261,6 +263,7 @@ object AnnualUpdateMinimalDF { max($"is__gfw_managed_forests") as "is__gfw_managed_forests", max($"umd_tree_cover_gain__period") as "umd_tree_cover_gain__period", max($"is__ifl_intact_forest_landscapes_2000") as "is__ifl_intact_forest_landscapes_2000", + max($"sbtn_natural_forests__class") as "sbtn_natural_forests__class", max(length($"tsc_tree_cover_loss_drivers__type")).cast("boolean") as "tsc_tree_cover_loss_drivers__type", max($"is__birdlife_alliance_for_zero_extinction_site") as "is__birdlife_alliance_for_zero_extinction_site", @@ -318,6 +321,7 @@ object AnnualUpdateMinimalDF { max($"is__gfw_managed_forests") as "is__gfw_managed_forests", max($"umd_tree_cover_gain__period") as "umd_tree_cover_gain__period", max($"is__ifl_intact_forest_landscapes_2000") as "is__ifl_intact_forest_landscapes_2000", + max($"sbtn_natural_forests__class") as "sbtn_natural_forests__class", max($"tsc_tree_cover_loss_drivers__type") as "tsc_tree_cover_loss_drivers__type", max($"is__birdlife_alliance_for_zero_extinction_site") as "is__birdlife_alliance_for_zero_extinction_site", diff --git a/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalDataGroup.scala b/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalDataGroup.scala index 9be18be4..45c33062 100644 --- a/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalDataGroup.scala +++ b/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalDataGroup.scala @@ -22,5 +22,6 @@ case class AnnualUpdateMinimalDataGroup(lossYear: Integer, gainPeriod: String, intactForestLandscapes2000: Boolean, landCover: String, - tmlDensity: Int + tmlDensity: Int, + naturalForests: String ) diff --git a/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalGridSources.scala b/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalGridSources.scala index 42cc6f1e..728e8ece 100644 --- a/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalGridSources.scala +++ b/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalGridSources.scala @@ -47,6 +47,7 @@ case class AnnualUpdateMinimalGridSources(gridTile: GridTile, kwargs: Map[String val abovegroundCarbon2000: AbovegroundCarbon2000 = AbovegroundCarbon2000(gridTile, kwargs = kwargs) val belowgroundCarbon2000: BelowgroundCarbon2000 = BelowgroundCarbon2000(gridTile, kwargs = kwargs) val mangroveBiomassExtent: MangroveBiomassExtent = MangroveBiomassExtent(gridTile, kwargs) + val naturalForests: SBTNNaturalForests = SBTNNaturalForests(gridTile, kwargs) def readWindow( windowKey: SpatialKey, windowLayout: LayoutDefinition @@ -97,8 +98,8 @@ case class AnnualUpdateMinimalGridSources(gridTile: GridTile, kwargs: Map[String val plantationsPre2000Tile = plantationsPre2000.fetchWindow(windowKey, windowLayout) val abovegroundCarbon2000Tile = abovegroundCarbon2000.fetchWindow(windowKey, windowLayout) val belowgroundCarbon2000Tile = belowgroundCarbon2000.fetchWindow(windowKey, windowLayout) - val mangroveBiomassExtentTile = - mangroveBiomassExtent.fetchWindow(windowKey, windowLayout) + val mangroveBiomassExtentTile = mangroveBiomassExtent.fetchWindow(windowKey, windowLayout) + val naturalForestsTile = naturalForests.fetchWindow(windowKey, windowLayout) val tile = AnnualUpdateMinimalTile( lossTile, @@ -137,6 +138,7 @@ case class AnnualUpdateMinimalGridSources(gridTile: GridTile, kwargs: Map[String abovegroundCarbon2000Tile, belowgroundCarbon2000Tile, mangroveBiomassExtentTile, + naturalForestsTile ) Raster(tile, windowKey.extent(windowLayout)) diff --git a/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalSummary.scala b/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalSummary.scala index dc08accf..765e2d74 100644 --- a/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalSummary.scala +++ b/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalSummary.scala @@ -6,7 +6,6 @@ import geotrellis.raster.summary.GridVisitor import org.globalforestwatch.summarystats.Summary import org.globalforestwatch.util.Geodesy import org.globalforestwatch.util.Implicits._ - /** LossData Summary by year */ case class AnnualUpdateMinimalSummary( stats: Map[AnnualUpdateMinimalDataGroup, AnnualUpdateMinimalData] = Map.empty @@ -48,30 +47,22 @@ object AnnualUpdateMinimalSummary { val plantedForests: String = raster.tile.plantedForests.getData(col, row) val mangroves1996: Boolean = raster.tile.mangroves1996.getData(col, row) val mangroves2020: Boolean = raster.tile.mangroves2020.getData(col, row) - val tigerLandscapes: Boolean = - raster.tile.tigerLandscapes.getData(col, row) + val tigerLandscapes: Boolean = raster.tile.tigerLandscapes.getData(col, row) val landmark: Boolean = raster.tile.landmark.getData(col, row) - val keyBiodiversityAreas: Boolean = - raster.tile.keyBiodiversityAreas.getData(col, row) + val keyBiodiversityAreas: Boolean = raster.tile.keyBiodiversityAreas.getData(col, row) val mining: Boolean = raster.tile.mining.getData(col, row) val peatlands: Boolean = raster.tile.peatlands.getData(col, row) val oilPalm: Boolean = raster.tile.oilPalm.getData(col, row) - val idnForestMoratorium: Boolean = - raster.tile.idnForestMoratorium.getData(col, row) + val idnForestMoratorium: Boolean = raster.tile.idnForestMoratorium.getData(col, row) val woodFiber: Boolean = raster.tile.woodFiber.getData(col, row) - val resourceRights: Boolean = - raster.tile.resourceRights.getData(col, row) + val resourceRights: Boolean = raster.tile.resourceRights.getData(col, row) val logging: Boolean = raster.tile.logging.getData(col, row) - val intactForestLandscapes2000: Boolean = - raster.tile.intactForestLandscapes2000.getData(col, row) - val treeCoverLossFromFires: Boolean = - raster.tile.treeCoverLossFromFires.getData(col, row) - val tropicalTreeCover: Int = - raster.tile.tropicalTreeCover.getData(col, row) - val umdGlobalLandCover: String = - raster.tile.umdGlobalLandCover.getData(col, row) - val plantationsPre2000: Boolean = - raster.tile.plantationsPre2000.getData(col, row) + val intactForestLandscapes2000: Boolean = raster.tile.intactForestLandscapes2000.getData(col, row) + val treeCoverLossFromFires: Boolean = raster.tile.treeCoverLossFromFires.getData(col, row) + val tropicalTreeCover: Int = raster.tile.tropicalTreeCover.getData(col, row) + val umdGlobalLandCover: String = raster.tile.umdGlobalLandCover.getData(col, row) + val plantationsPre2000: Boolean = raster.tile.plantationsPre2000.getData(col, row) + val naturalForests: String = raster.tile.naturalForests.getData(col, row) val lat: Double = raster.rasterExtent.gridRowToMap(row) val area: Double = Geodesy.pixelArea(lat, raster.cellSize) // uses Pixel's center coordiate. +- raster.cellSize.height/2 doesn't make much of a difference @@ -85,10 +76,8 @@ object AnnualUpdateMinimalSummary { val grossEmissionsCo2eNonCo2: Float = raster.tile.grossEmissionsCo2eNonCo2.getData(col, row) val grossEmissionsCo2eCo2Only: Float = raster.tile.grossEmissionsCo2eCo2Only.getData(col, row) - val grossCumulAbovegroundRemovalsCo2: Float = - raster.tile.grossCumulAbovegroundRemovalsCo2.getData(col, row) - val grossCumulBelowgroundRemovalsCo2: Float = - raster.tile.grossCumulBelowgroundRemovalsCo2.getData(col, row) + val grossCumulAbovegroundRemovalsCo2: Float = raster.tile.grossCumulAbovegroundRemovalsCo2.getData(col, row) + val grossCumulBelowgroundRemovalsCo2: Float = raster.tile.grossCumulBelowgroundRemovalsCo2.getData(col, row) val netFluxCo2: Float = raster.tile.netFluxCo2.getData(col, row) val soilCarbon2000PerHa: Float = raster.tile.soilCarbon2000.getData(col, row) val abovegroundCarbon2000PerHa: Float = raster.tile.abovegroundCarbon2000.getData(col, row) @@ -135,6 +124,7 @@ object AnnualUpdateMinimalSummary { intactForestLandscapes2000, umdGlobalLandCover, tropicalTreeCover, + naturalForests ) val summary: AnnualUpdateMinimalData = diff --git a/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalTile.scala b/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalTile.scala index af79ff18..5924cead 100644 --- a/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalTile.scala +++ b/src/main/scala/org/globalforestwatch/summarystats/annualupdate_minimal/AnnualUpdateMinimalTile.scala @@ -45,6 +45,7 @@ case class AnnualUpdateMinimalTile( abovegroundCarbon2000: AbovegroundCarbon2000#OptionalFTile, belowgroundCarbon2000: BelowgroundCarbon2000#OptionalFTile, mangroveBiomassExtent: MangroveBiomassExtent#OptionalITile, + naturalForests: SBTNNaturalForests#OptionalITile ) extends CellGrid[Int] { def cellType: CellType = loss.cellType def cols: Int = loss.cols