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

bug: merge_cubes without linear interpolation #201

Closed jdries closed 10 months ago

jdries commented 1 year ago

Error message: The number of bands in the metadata 12/1 does not match the actual band count in the cubes (left/right): 2/1. You can fix this by explicitly specifying correct band labels.'

Repository: https://git.vito.be/projects/NCA/repos/extentmapping/browse?at=refs%2Fheads%2Ftests

Example notebook: https://git.vito.be/projects/NCA/repos/extentmapping/browse/notebooks/retrieve_S1_S2_timeseries_via_openeo.ipynb?at=refs%2Fheads%2Ftests

The example notebook directly replicates the error – or see last job: j-3e198f201d7b49028bd665b41e85256e

The 12 band cube originates from merging Sentinel-2 and Sentinel-1. It seems like areas without Sentinel-2 data still are not properly filled with nodata bands somehow.

EmileSonneveld commented 11 months ago

This is the error I got when running the graph:

py4j.protocol.Py4JJavaError: An error occurred while calling o1790.aggregateTemporal.
: java.lang.UnsupportedOperationException: empty.reduceLeft
    at scala.collection.LinearSeqOptimized.reduceLeft(LinearSeqOptimized.scala:139)
    at scala.collection.LinearSeqOptimized.reduceLeft$(LinearSeqOptimized.scala:138)
    at scala.collection.immutable.List.reduceLeft(List.scala:91)
    at scala.collection.TraversableOnce.reduce(TraversableOnce.scala:254)
    at scala.collection.TraversableOnce.reduce$(TraversableOnce.scala:254)
    at scala.collection.AbstractTraversable.reduce(Traversable.scala:108)
    at org.openeo.geotrellis.OpenEOProcesses.aggregateTemporal(OpenEOProcesses.scala:394)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
    at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:374)
    at py4j.Gateway.invoke(Gateway.java:282)
    at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
    at py4j.commands.CallCommand.execute(CallCommand.java:79)
    at py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:182)
    at py4j.ClientServerConnection.run(ClientServerConnection.java:106)
    at java.base/java.lang.Thread.run(Thread.java:829)
EmileSonneveld commented 11 months ago

The empty.reduceLeft error was unrelated. (I took a too short time interval)

I'll try out a simple fix on openeo-dev to see if that solves the issue. If so, there are still some unit tests needed.

EmileSonneveld commented 11 months ago

The simple fix did the trick for Marcel his process graph. I would still like to add some nicer tests to this ticket before closing it.