Skip to content

Commit

Permalink
Added 4 more commodities, just missing SUGC (sugarcane)
Browse files Browse the repository at this point in the history
  • Loading branch information
danscales committed Dec 22, 2024
1 parent 0623507 commit 662d047
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
24 changes: 20 additions & 4 deletions src/main/resources/raster-catalog-pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,33 @@
"name":"col_frontera_agricola",
"source_uri":"s3://gfw-data-lake/col_frontera_agricola/v2024/raster/epsg-4326/{grid_size}/{row_count}/category/gdal-geotiff/{tile_id}.tif"
},
{
"name":"mapspam_yield_coco",
"source_uri":"s3://gfw-data-lake/mapspam_yield_coco/v2020/raster/epsg-4326/{grid_size}/{row_count}/yield/gdal-geotiff/{tile_id}.tif"
},
{
"name":"gfw_forest_flux_full_extent_gross_emissions_co2_only_biomass_soil",
"source_uri": "s3://gfw-data-lake/gfw_forest_flux_full_extent_gross_emissions_co2_only_biomass_soil/v20240402/raster/epsg-4326/{grid_size}/{row_count}/Mg_CO2_ha-1/geotiff/{tile_id}.tif"
},
{
"name":"gfw_forest_flux_full_extent_gross_emissions_non_co2_biomass_soil",
"source_uri": "s3://gfw-data-lake/gfw_forest_flux_full_extent_gross_emissions_non_co2_biomass_soil/v20240402/raster/epsg-4326/{grid_size}/{row_count}/Mg_CO2e_ha-1/geotiff/{tile_id}.tif"
},
{
"name":"mapspam_yield_coco",
"source_uri":"s3://gfw-data-lake/mapspam_yield_coco/v2020/raster/epsg-4326/{grid_size}/{row_count}/yield/gdal-geotiff/{tile_id}.tif"
},
{
"name":"mapspam_yield_coff",
"source_uri":"s3://gfw-data-lake/mapspam_yield_coff/v2020/raster/epsg-4326/{grid_size}/{row_count}/yield/gdal-geotiff/{tile_id}.tif"
},
{
"name":"mapspam_yield_oilp",
"source_uri":"s3://gfw-data-lake/mapspam_yield_oilp/v2020/raster/epsg-4326/{grid_size}/{row_count}/yield/gdal-geotiff/{tile_id}.tif"
},
{
"name":"mapspam_yield_rubb",
"source_uri":"s3://gfw-data-lake/mapspam_yield_rubb/v2020/raster/epsg-4326/{grid_size}/{row_count}/yield/gdal-geotiff/{tile_id}.tif"
},
{
"name":"mapspam_yield_soyb",
"source_uri":"s3://gfw-data-lake/mapspam_yield_soyb/v2020/raster/epsg-4326/{grid_size}/{row_count}/yield/gdal-geotiff/{tile_id}.tif"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ case class GHGGridSources(gridTile: GridTile, kwargs: Map[String, Any])
val grossEmissionsCo2eNonCo2: GrossEmissionsNonCo2Co2eBiomassSoil = GrossEmissionsNonCo2Co2eBiomassSoil(gridTile, kwargs = kwargs)
val grossEmissionsCo2eCo2Only: GrossEmissionsCo2OnlyCo2BiomassSoil = GrossEmissionsCo2OnlyCo2BiomassSoil(gridTile, kwargs = kwargs)
val mapspamCOCOYield: MapspamYield = MapspamYield("COCO", gridTile, kwargs = kwargs)
val mapspamCOFFYield: MapspamYield = MapspamYield("COFF", gridTile, kwargs = kwargs)
val mapspamOILPYield: MapspamYield = MapspamYield("OILP", gridTile, kwargs = kwargs)
val mapspamRUBBYield: MapspamYield = MapspamYield("RUBB", gridTile, kwargs = kwargs)
val mapspamSOYBYield: MapspamYield = MapspamYield("SOYB", gridTile, kwargs = kwargs)

def readWindow(
windowKey: SpatialKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ object GHGSummary {
}

// Get default yield based on commodity
var cropYield = raster.tile.cocoYield.getData(col, row)
var cropYield = raster.tile.soybYield.getData(col, row)
println(s"Yield ${cropYield}, (${col}, ${row})")
if (cropYield == 0) {
println("Empty cocoa yield")
val backupArray = kwargs("backupYield").asInstanceOf[Broadcast[Array[Row]]].value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ case class GHGTile(
lazy val grossEmissionsCo2eNonCo2 = sources.grossEmissionsCo2eNonCo2.fetchWindow(windowKey, windowLayout)
lazy val grossEmissionsCo2eCo2Only = sources.grossEmissionsCo2eCo2Only.fetchWindow(windowKey, windowLayout)
lazy val cocoYield = sources.mapspamCOCOYield.fetchWindow(windowKey, windowLayout)
lazy val coffYield = sources.mapspamCOFFYield.fetchWindow(windowKey, windowLayout)
lazy val oilpYield = sources.mapspamOILPYield.fetchWindow(windowKey, windowLayout)
lazy val rubbYield = sources.mapspamRUBBYield.fetchWindow(windowKey, windowLayout)
lazy val soybYield = sources.mapspamSOYBYield.fetchWindow(windowKey, windowLayout)

def cellType: CellType = loss.cellType

Expand Down

0 comments on commit 662d047

Please sign in to comment.