Skip to content

Commit

Permalink
added case to raster.isEmpty for raster with many bands but not rep…
Browse files Browse the repository at this point in the history
…orting subdatasets
  • Loading branch information
sllynn committed Nov 20, 2023
1 parent 4631a68 commit 7488435
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@ class MosaicRasterGDAL(

if (json.contains("STATISTICS_VALID_PERCENT")) {
json("STATISTICS_VALID_PERCENT").asInstanceOf[Double] == 0.0
} else if (json.contains("bands")) {
json("bands")
.asInstanceOf[List[Map[String, Any]]]
.flatMap(i => i("metadata").asInstanceOf[Map[String, Any]].values)
.asInstanceOf[List[Map[String, Any]]]
.exists(m => m.getOrElse("STATISTICS_VALID_PERCENT", "0").toString.toDouble > 0.0)
} else if (subdatasets.nonEmpty) {
false
} else {
Expand Down

0 comments on commit 7488435

Please sign in to comment.