Open-EO / openeo-geotrellis-extensions

Java/Scala extensions for Geotrellis, for use with OpenEO GeoPySpark backend.
Apache License 2.0
5 stars 3 forks source link

test merge_cubes with EmptyMultibandTile #173

Closed jdries closed 10 months ago

jdries commented 1 year ago

Example notebook: https://github.com/Open-EO/openeo-community-examples/blob/main/python/BasicSentinelMerge/sentinel_merge.ipynb

Comment out the lines of 'linear_interpolation'.

An attempt to fix is there, but the apply_neighborhood seems not happy when trying to regrid. It looks as if only the 2 SAR bands are present, here, so bandcount is off.

java.lang.IllegalArgumentException: Band 2 does not exist
    at geotrellis.raster.ArrayMultibandTile.band(ArrayMultibandTile.scala:119)
    at geotrellis.raster.stitch.Stitcher$MultibandTileStitcher$.$anonfun$stitch$6(Stitcher.scala:102)
    at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:158)
    at geotrellis.raster.stitch.Stitcher$MultibandTileStitcher$.$anonfun$stitch$5(Stitcher.scala:101)
    at geotrellis.raster.stitch.Stitcher$MultibandTileStitcher$.$anonfun$stitch$5$adapted(Stitcher.scala:100)
    at scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:985)
    at scala.collection.Iterator.foreach(Iterator.scala:943)
    at scala.collection.Iterator.foreach$(Iterator.scala:943)
    at org.apache.spark.util.collection.CompactBuffer$$anon$1.foreach(CompactBuffer.scala:115)
    at scala.collection.IterableLike.foreach(IterableLike.scala:74)
    at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
    at org.apache.spark.util.collection.CompactBuffer.foreach(CompactBuffer.scala:32)
    at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:984)
    at geotrellis.raster.stitch.Stitcher$MultibandTileStitcher$.stitch(Stitcher.scala:100)
    at geotrellis.raster.stitch.Stitcher$MultibandTileStitcher$.stitch(Stitcher.scala:80)
    at geotrellis.spark.regrid.Regrid$.$anonfun$apply$7(Regrid.scala:131)
    at org.apache.spark.rdd.PairRDDFunctions.$anonfun$mapValues$3(PairRDDFunctions.scala:752)
    at scala.collection.Iterator$$anon$10.next(Iterator.scala:461)
    at scala.collection.Iterator$$anon$11.nextCur(Iterator.scala:486)
EmileSonneveld commented 11 months ago

I tried checking out all code to just before 16/06/2023 and running the graph without linear interpolation, but got no error. I tried to make the cloud mask very very restrictive, so almost no tiles would pass. I do get a protobuf error when running a aggregate_temporal_period->(array_interpolate_linear)->apply_dimension graph. With array_interpolate_linear there is no error

jdries commented 11 months ago

This one seems related to, or almost a duplicate of: https://github.com/Open-EO/openeo-geotrellis-extensions/issues/201

EmileSonneveld commented 10 months ago

Indeed implemented in #201