Skip to content

Commit

Permalink
GTC-2573 Replace mangroves with v3
Browse files Browse the repository at this point in the history
  • Loading branch information
manukala6 committed Oct 25, 2023
1 parent f0f0a86 commit 1c76455
Show file tree
Hide file tree
Showing 24 changed files with 70 additions and 104 deletions.
10 changes: 3 additions & 7 deletions src/main/resources/raster-catalog-default.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/v202302/raster/epsg-4326/{grid_size}/{row_count}/iucn_cat/geotiff/{tile_id}.tif"
"source_uri":"s3://gfw-data-lake/wdpa_protected_areas/v202308/raster/epsg-4326/{grid_size}/{row_count}/iucn_cat/geotiff/{tile_id}.tif"
},
{
"name":"gfw_oil_gas",
Expand Down Expand Up @@ -40,10 +40,6 @@
"name":"inpe_amazonia_prodes",
"source_uri":"s3://gfw-data-lake/inpe_amazonia_prodes/v20201201/raster/epsg-4326/{grid_size}/{row_count}/year/geotiff/{tile_id}.tif"
},
{
"name":"gmw_global_mangrove_extent_1996",
"source_uri":"s3://gfw-data-lake/gmw_global_mangrove_extent_1996/v2/raster/epsg-4326/{grid_size}/{row_count}/is/geotiff/{tile_id}.tif"
},
{
"name":"gfw_deadwood_carbon",
"source_uri":"s3://gfw-data-lake/gfw_deadwood_carbon/v20200824/raster/epsg-4326/{grid_size}/{row_count}/Mg_CO2_ha-1/geotiff/{tile_id}.tif"
Expand Down Expand Up @@ -197,8 +193,8 @@
"source_uri":"s3://gfw-data-lake/gfw_peatlands/v20200807/raster/epsg-4326/{grid_size}/{row_count}/is/geotiff/{tile_id}.tif"
},
{
"name":"gmw_global_mangrove_extent_2016",
"source_uri":"s3://gfw-data-lake/gmw_global_mangrove_extent_2016/v20201210/raster/epsg-4326/{grid_size}/{row_count}/is/geotiff/{tile_id}.tif"
"name": "gmw_global_mangrove_extent",
"source_uri":"s3://gfw-data-lake/gmw_global_mangrove_extent/v3/raster/epsg-4326/{grid_size}/{row_count}/is/geotiff/{tile_id}.tif"
},
{
"name":"umd_regional_primary_forest_2001",
Expand Down
8 changes: 2 additions & 6 deletions src/main/resources/raster-catalog-pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"source_uri":"s3://gfw-data-lake/inpe_amazonia_prodes/v20201201/raster/epsg-4326/{grid_size}/{row_count}/year/gdal-geotiff/{tile_id}.tif"
},
{
"name":"gmw_global_mangrove_extent_1996",
"source_uri":"s3://gfw-data-lake/gmw_global_mangrove_extent_1996/v2/raster/epsg-4326/{grid_size}/{row_count}/is/gdal-geotiff/{tile_id}.tif"
"name":"gmw_global_mangrove_extent",
"source_uri":"s3://gfw-data-lake/gmw_global_mangrove_extent/v3/raster/epsg-4326/{grid_size}/{row_count}/is/gdal-geotiff/{tile_id}.tif"
},
{
"name":"gfw_deadwood_carbon",
Expand Down Expand Up @@ -212,10 +212,6 @@
"name":"gfw_peatlands",
"source_uri":"s3://gfw-data-lake/gfw_peatlands/v20200807/raster/epsg-4326/{grid_size}/{row_count}/is/gdal-geotiff/{tile_id}.tif"
},
{
"name":"gmw_global_mangrove_extent_2016",
"source_uri":"s3://gfw-data-lake/gmw_global_mangrove_extent_2016/v20201210/raster/epsg-4326/{grid_size}/{row_count}/is/gdal-geotiff/{tile_id}.tif"
},
{
"name":"umd_regional_primary_forest_2001",
"source_uri":"s3://gfw-data-lake/umd_regional_primary_forest_2001/v201901/raster/epsg-4326/{grid_size}/{row_count}/is/gdal-geotiff/{tile_id}.tif"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package org.globalforestwatch.layers

import org.globalforestwatch.grids.GridTile

case class Mangroves2016(gridTile: GridTile, kwargs: Map[String, Any])
case class Mangroves(gridTile: GridTile, kwargs: Map[String, Any])
extends BooleanLayer
with OptionalILayer {

val datasetName = "gmw_global_mangrove_extent_2016"
val datasetName = "gmw_global_mangrove_extent"
val uri: String =
uriForGrid(gridTile, kwargs)
}
11 changes: 0 additions & 11 deletions src/main/scala/org/globalforestwatch/layers/Mangroves1996.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ object AnnualUpdateMinimalDF {
"tsc_tree_cover_loss_drivers__driver",
"is__birdlife_alliance_for_zero_extinction_sites",
"gfw_planted_forests__type",
"is__gmw_global_mangrove_extent_1996",
"is__gmw_global_mangrove_extent_2016",
"is__gmw_global_mangrove_extent",
"is__umd_regional_primary_forest_2001",
"is__wwf_tiger_conservation_landscapes",
"is__landmark_indigenous_and_community_lands",
Expand All @@ -34,8 +33,7 @@ object AnnualUpdateMinimalDF {
"tsc_tree_cover_loss_drivers__type",
"is__birdlife_alliance_for_zero_extinction_site",
"gfw_plantation__type",
"is__gmw_mangroves_1996",
"is__gmw_mangroves_2016",
"is__gmw_mangroves",
"is__gfw_tiger_landscape",
"is__landmark_land_right",
"is__gfw_land_right",
Expand All @@ -61,8 +59,7 @@ object AnnualUpdateMinimalDF {
$"data_group.primaryForest" as "is__umd_regional_primary_forest_2001",
$"data_group.aze" as "is__birdlife_alliance_for_zero_extinction_sites",
$"data_group.plantedForests" as "gfw_planted_forests__type",
$"data_group.mangroves1996" as "is__gmw_global_mangrove_extent_1996",
$"data_group.mangroves2016" as "is__gmw_global_mangrove_extent_2016",
$"data_group.mangroves" as "is__gmw_global_mangrove_extent",
$"data_group.tigerLandscapes" as "is__wwf_tiger_conservation_landscapes",
$"data_group.landmark" as "is__landmark_indigenous_and_community_lands",
$"data_group.keyBiodiversityAreas" as "is__birdlife_key_biodiversity_areas",
Expand Down Expand Up @@ -104,8 +101,7 @@ object AnnualUpdateMinimalDF {
$"data_group.drivers" as "tsc_tree_cover_loss_drivers__type",
$"data_group.aze" as "is__birdlife_alliance_for_zero_extinction_site",
$"data_group.plantedForests" as "gfw_plantation__type",
$"data_group.mangroves1996" as "is__gmw_mangroves_1996",
$"data_group.mangroves2016" as "is__gmw_mangroves_2016",
$"data_group.mangroves" as "is__gmw_mangroves",
$"data_group.tigerLandscapes" as "is__gfw_tiger_landscape",
$"data_group.landmark" as "is__landmark_land_right",
$"data_group.landmark" as "is__gfw_land_right",
Expand Down Expand Up @@ -252,8 +248,7 @@ object AnnualUpdateMinimalDF {
max($"is__birdlife_alliance_for_zero_extinction_sites") as "is__birdlife_alliance_for_zero_extinction_sites",
max(length($"gfw_planted_forests__type"))
.cast("boolean") as "gfw_planted_forests__type",
max($"is__gmw_global_mangrove_extent_1996") as "is__gmw_global_mangrove_extent_1996",
max($"is__gmw_global_mangrove_extent_2016") as "is__gmw_global_mangrove_extent_2016",
max($"is__gmw_global_mangrove_extent") as "is__gmw_global_mangrove_extent",
max($"is__wwf_tiger_conservation_landscapes") as "is__wwf_tiger_conservation_landscapes",
max($"is__landmark_indigenous_and_community_lands") as "is__landmark_indigenous_and_community_lands",
max($"is__birdlife_key_biodiversity_areas") as "is__birdlife_key_biodiversity_areas",
Expand All @@ -271,8 +266,7 @@ object AnnualUpdateMinimalDF {
max($"is__birdlife_alliance_for_zero_extinction_site") as "is__birdlife_alliance_for_zero_extinction_site",
max(length($"gfw_plantation__type"))
.cast("boolean") as "gfw_plantation__type",
max($"is__gmw_mangroves_1996") as "is__gmw_mangroves_1996",
max($"is__gmw_mangroves_2016") as "is__gmw_mangroves_2016",
max($"is__gmw_mangroves") as "is__gmw_mangroves",
max($"is__gfw_tiger_landscape") as "is__gfw_tiger_landscape",
max($"is__landmark_land_right") as "is__landmark_land_right",
max($"is__gfw_land_right") as "is__gfw_land_right",
Expand Down Expand Up @@ -310,8 +304,7 @@ object AnnualUpdateMinimalDF {
max($"is__umd_regional_primary_forest_2001") as "is__umd_regional_primary_forest_2001",
max($"is__birdlife_alliance_for_zero_extinction_sites") as "is__birdlife_alliance_for_zero_extinction_sites",
max($"gfw_planted_forests__type") as "gfw_planted_forests__type",
max($"is__gmw_global_mangrove_extent_1996") as "is__gmw_global_mangrove_extent_1996",
max($"is__gmw_global_mangrove_extent_2016") as "is__gmw_global_mangrove_extent_2016",
max($"is__gmw_global_mangrove_extent") as "is__gmw_global_mangrove_extent",
max($"is__wwf_tiger_conservation_landscapes") as "is__wwf_tiger_conservation_landscapes",
max($"is__landmark_indigenous_and_community_lands") as "is__landmark_indigenous_and_community_lands",
max($"is__birdlife_key_biodiversity_areas") as "is__birdlife_key_biodiversity_areas",
Expand All @@ -328,8 +321,7 @@ object AnnualUpdateMinimalDF {
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",
max($"gfw_plantation__type") as "gfw_plantation__type",
max($"is__gmw_mangroves_1996") as "is__gmw_mangroves_1996",
max($"is__gmw_mangroves_2016") as "is__gmw_mangroves_2016",
max($"is__gmw_mangroves") as "is__gmw_mangroves",
max($"is__gfw_tiger_landscape") as "is__gfw_tiger_landscape",
max($"is__landmark_land_right") as "is__landmark_land_right",
max($"is__gfw_land_right") as "is__gfw_land_right",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ case class AnnualUpdateMinimalDataGroup(lossYear: Integer,
wdpa: String,
aze: Boolean,
plantedForests: String,
mangroves1996: Boolean,
mangroves2016: Boolean,
mangroves: Boolean,
tigerLandscapes: Boolean,
landmark: Boolean,
keyBiodiversityAreas: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ case class AnnualUpdateMinimalGridSources(gridTile: GridTile, kwargs: Map[String
val protectedAreas: ProtectedAreas = ProtectedAreas(gridTile, kwargs)
val aze: Aze = Aze(gridTile, kwargs)
val plantedForests: PlantedForests = PlantedForests(gridTile, kwargs)
val mangroves1996: Mangroves1996 = Mangroves1996(gridTile, kwargs)
val mangroves2016: Mangroves2016 = Mangroves2016(gridTile, kwargs)
val mangroves: Mangroves = Mangroves(gridTile, kwargs)
val tigerLandscapes: TigerLandscapes = TigerLandscapes(gridTile, kwargs)
val landmark: Landmark = Landmark(gridTile, kwargs)
val keyBiodiversityAreas: KeyBiodiversityAreas = KeyBiodiversityAreas(gridTile, kwargs)
Expand Down Expand Up @@ -72,8 +71,7 @@ case class AnnualUpdateMinimalGridSources(gridTile: GridTile, kwargs: Map[String
val wdpaTile = protectedAreas.fetchWindow(windowKey, windowLayout)
val azeTile = aze.fetchWindow(windowKey, windowLayout)
val plantedForestsTile = plantedForests.fetchWindow(windowKey, windowLayout)
val mangroves1996Tile = mangroves1996.fetchWindow(windowKey, windowLayout)
val mangroves2016Tile = mangroves2016.fetchWindow(windowKey, windowLayout)
val mangrovesTile = mangroves.fetchWindow(windowKey, windowLayout)
val tigerLandscapesTile = tigerLandscapes.fetchWindow(windowKey, windowLayout)
val landmarkTile = landmark.fetchWindow(windowKey, windowLayout)
val keyBiodiversityAreasTile = keyBiodiversityAreas.fetchWindow(windowKey, windowLayout)
Expand Down Expand Up @@ -111,8 +109,7 @@ case class AnnualUpdateMinimalGridSources(gridTile: GridTile, kwargs: Map[String
wdpaTile,
azeTile,
plantedForestsTile,
mangroves1996Tile,
mangroves2016Tile,
mangrovesTile,
tigerLandscapesTile,
landmarkTile,
keyBiodiversityAreasTile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ object AnnualUpdateMinimalSummary {
val wdpa: String = raster.tile.wdpa.getData(col, row)
val aze: Boolean = raster.tile.aze.getData(col, row)
val plantedForests: String = raster.tile.plantedForests.getData(col, row)
val mangroves1996: Boolean = raster.tile.mangroves1996.getData(col, row)
val mangroves2016: Boolean = raster.tile.mangroves2016.getData(col, row)
val mangroves: Boolean = raster.tile.mangroves.getData(col, row)
val tigerLandscapes: Boolean =
raster.tile.tigerLandscapes.getData(col, row)
val landmark: Boolean = raster.tile.landmark.getData(col, row)
Expand Down Expand Up @@ -123,8 +122,7 @@ object AnnualUpdateMinimalSummary {
wdpa,
aze,
plantedForests,
mangroves1996,
mangroves2016,
mangroves,
tigerLandscapes,
landmark,
keyBiodiversityAreas,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ case class AnnualUpdateMinimalTile(
wdpa: ProtectedAreas#OptionalITile,
aze: Aze#OptionalITile,
plantedForests: PlantedForests#OptionalITile,
mangroves1996: Mangroves1996#OptionalITile,
mangroves2016: Mangroves2016#OptionalITile,
mangroves: Mangroves#OptionalITile,
tigerLandscapes: TigerLandscapes#OptionalITile,
landmark: Landmark#OptionalITile,
keyBiodiversityAreas: KeyBiodiversityAreas#OptionalITile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object FireAlertsDF {
"idn_forest_area__class",
"per_forest_concessions__type",
"is__gfw_oil_gas",
"is__gmw_global_mangrove_extent_2016",
"is__gmw_global_mangrove_extent",
"is__ifl_intact_forest_landscapes_2016",
"ibge_bra_biomes__name",

Expand All @@ -37,7 +37,7 @@ object FireAlertsDF {
"is__peatland",
"idn_forest_area__type",
"per_forest_concession__type",
"is__gmw_mangroves_2016",
"is__gmw_mangroves",
"is__ifl_intact_forest_landscape_2016",
"bra_biome__name"
)
Expand Down Expand Up @@ -68,7 +68,7 @@ object FireAlertsDF {
$"data_group.indonesiaForestArea" as "idn_forest_area__class",
$"data_group.peruForestConcessions" as "per_forest_concessions__type",
$"data_group.oilGas" as "is__gfw_oil_gas",
$"data_group.mangroves2016" as "is__gmw_global_mangrove_extent_2016",
$"data_group.mangroves" as "is__gmw_global_mangrove_extent",
$"data_group.intactForestLandscapes2016" as "is__ifl_intact_forest_landscapes_2016",
$"data_group.braBiomes" as "ibge_bra_biomes__name",

Expand All @@ -82,7 +82,7 @@ object FireAlertsDF {
$"data_group.peatlands" as "is__peatland",
$"data_group.indonesiaForestArea" as "idn_forest_area__type",
$"data_group.peruForestConcessions" as "per_forest_concession__type",
$"data_group.mangroves2016" as "is__gmw_mangroves_2016",
$"data_group.mangroves" as "is__gmw_mangroves",
$"data_group.intactForestLandscapes2016" as "is__ifl_intact_forest_landscape_2016",
$"data_group.braBiomes" as "bra_biome__name"
)
Expand Down Expand Up @@ -201,7 +201,7 @@ object FireAlertsDF {
max(length($"per_forest_concessions__type"))
.cast("boolean") as "per_forest_concessions__type",
max("is__gfw_oil_gas") as "is__gfw_oil_gas",
max("is__gmw_global_mangrove_extent_2016") as "is__gmw_global_mangrove_extent_2016",
max("is__gmw_global_mangrove_extent") as "is__gmw_global_mangrove_extent",
max("is__ifl_intact_forest_landscapes_2016") as "is__ifl_intact_forest_landscapes_2016",
max(length($"ibge_bra_biomes__name")).cast("boolean") as "ibge_bra_biomes__name",

Expand All @@ -217,7 +217,7 @@ object FireAlertsDF {
.cast("boolean") as "idn_forest_area__type",
max(length($"per_forest_concession__type"))
.cast("boolean") as "per_forest_concession__type",
max("is__gmw_mangroves_2016") as "is__gmw_mangroves_2016",
max("is__gmw_mangroves") as "is__gmw_mangroves",
max("is__ifl_intact_forest_landscape_2016") as "is__ifl_intact_forest_landscape_2016",
max(length($"bra_biome__name")).cast("boolean") as "bra_biome__name"
)
Expand Down Expand Up @@ -253,7 +253,7 @@ object FireAlertsDF {
max("idn_forest_area__class") as "idn_forest_area__class",
max("per_forest_concessions__type") as "per_forest_concessions__type",
max("is__gfw_oil_gas") as "is__gfw_oil_gas",
max("is__gmw_global_mangrove_extent_2016") as "is__gmw_global_mangrove_extent_2016",
max("is__gmw_global_mangrove_extent") as "is__gmw_global_mangrove_extent",
max("is__ifl_intact_forest_landscapes_2016") as "is__ifl_intact_forest_landscapes_2016",
max("ibge_bra_biomes__name") as "ibge_bra_biomes__name",

Expand All @@ -266,7 +266,7 @@ object FireAlertsDF {
max("is__peatland") as "is__peatland",
max("idn_forest_area__type") as "idn_forest_area__type",
max("per_forest_concession__type") as "per_forest_concession__type",
max("is__gmw_mangroves_2016") as "is__gmw_mangroves_2016",
max("is__gmw_mangroves") as "is__gmw_mangroves",
max("is__ifl_intact_forest_landscape_2016") as "is__ifl_intact_forest_landscape_2016",
max("bra_biome__name") as "bra_biome__name"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ case class FireAlertsDataGroup(threshold: Integer,
indonesiaForestArea: String,
peruForestConcessions: String,
oilGas: Boolean,
mangroves2016: Boolean,
mangroves: Boolean,
intactForestLandscapes2016: Boolean,
braBiomes: String)
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ case class FireAlertsGridSources(gridTile: GridTile, kwargs: Map[String, Any]) e
val oilGas: OilGas = OilGas(gridTile, kwargs)
val logging: Logging = Logging(gridTile, kwargs)
val braBiomes: BrazilBiomes = BrazilBiomes(gridTile, kwargs)
val mangroves2016: Mangroves2016 = Mangroves2016(gridTile, kwargs)
val mangroves: Mangroves = Mangroves(gridTile, kwargs)
val intactForestLandscapes2016: IntactForestLandscapes2016 = IntactForestLandscapes2016(gridTile, kwargs)
val peruForestConcessions: PeruForestConcessions = PeruForestConcessions(gridTile, kwargs)
val protectedAreas: ProtectedAreas = ProtectedAreas(gridTile, kwargs)
Expand All @@ -49,7 +49,7 @@ case class FireAlertsGridSources(gridTile: GridTile, kwargs: Map[String, Any]) e
val indonesiaForestAreaTile = indonesiaForestArea.fetchWindow(windowKey, windowLayout)
val peruForestConcessionsTile = peruForestConcessions.fetchWindow(windowKey, windowLayout)
val oilGasTile = oilGas.fetchWindow(windowKey, windowLayout)
val mangroves2016Tile = mangroves2016.fetchWindow(windowKey, windowLayout)
val mangrovesTile = mangroves.fetchWindow(windowKey, windowLayout)
val intactForestLandscapes2016Tile =
intactForestLandscapes2016.fetchWindow(windowKey, windowLayout)
val braBiomesTile =
Expand All @@ -75,7 +75,7 @@ case class FireAlertsGridSources(gridTile: GridTile, kwargs: Map[String, Any]) e
indonesiaForestAreaTile,
peruForestConcessionsTile,
oilGasTile,
mangroves2016Tile,
mangrovesTile,
intactForestLandscapes2016Tile,
braBiomesTile,
tcd2000Tile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ object FireAlertsSummary {
val peruForestConcessions: String =
raster.tile.peruForestConcessions.getData(col, row)
val oilGas: Boolean = raster.tile.oilGas.getData(col, row)
val mangroves2016: Boolean =
raster.tile.mangroves2016.getData(col, row)
val mangroves: Boolean =
raster.tile.mangroves.getData(col, row)
val intactForestLandscapes2016: Boolean =
raster.tile.intactForestLandscapes2016.getData(col, row)
val braBiomes: String = raster.tile.brazilBiomes.getData(col, row)
Expand Down Expand Up @@ -86,7 +86,7 @@ object FireAlertsSummary {
indonesiaForestArea,
peruForestConcessions,
oilGas,
mangroves2016,
mangroves,
intactForestLandscapes2016,
braBiomes,
)
Expand Down
Loading

0 comments on commit 1c76455

Please sign in to comment.