Skip to content

Commit

Permalink
Issue #275 add extra logging to NetCDFRDDWriter.writeToDisk
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenVerstraelen committed Mar 22, 2024
1 parent c1268bc commit 91497e0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,10 @@ object NetCDFRDDWriter {
bandNames: ArrayList[String],
crs:CRS, dimensionNames: java.util.Map[String,String],
attributes: java.util.Map[String,String]): String = {
val areas = rasters.map(raster => raster.extent.area)
logger.info(s"Writing ${rasters.size} rasters to disk. Areas: ${areas.mkString(",")}")
val maxExtent: Extent = rasters.map(_._2).reduce((a, b) => if (a.area > b.area) a else b)
logger.info(s"Cropping rasters to max extent: $maxExtent")
val equalRasters = rasters.map(raster =>
if (raster.extent != maxExtent) raster.crop(maxExtent, CropOptions(clamp = false, force = true)) else raster
)
Expand Down

0 comments on commit 91497e0

Please sign in to comment.