Open-EO / openeo-geopyspark-driver

OpenEO driver for GeoPySpark (Geotrellis)
Apache License 2.0
26 stars 4 forks source link

apply_neighborhood: assertion error in parcel delineation #434

Closed jdries closed 1 year ago

jdries commented 1 year ago

An error happens in the parcel delineation notebook https://github.com/openEOPlatform/parcel-delineation

j-99db98fcbfa147df8b8b979096516cc7

Error seems to happen in the regrid call after applying the udf: https://github.com/Open-EO/openeo-geotrellis-extensions/blob/5f1c9632dc07fa88dc82262fb2dff43c54089f16/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/OpenEOProcesses.scala#L772

Created Sentinelhub datacube sentinel-2-l2a with 736 keys and metadata TileLayerMetadata(uint16,LayoutDefinition(Extent(639420.0, 5672490.0, 647100.0, 5685290.0),CellSize(10.0,10.0),3x5 tiles,768x1280 pixels),Extent(639426.1015781774, 5673966.967184049, 646714.7219281539, 5685281.087556898),EPSG:32631,KeyBounds(SpaceTimeKey(0,0,1546300800000),SpaceTimeKey(2,4,1569801600000))) and SpacePartitioner(KeyBounds(SpaceTimeKey(0,0,1546300800000),SpaceTimeKey(2,4,1569801600000)))


Stage error: Job aborted due to stage failure: Task 11 in stage 13.0 failed 4 times, most recent failure: Lost task 11.3 in stage 13.0 (TID 164) (epod052.vgt.vito.be executor 47): java.lang.AssertionError: assertion failed: Row/col intervals must begin before they end
    at scala.Predef$.assert(Predef.scala:223)
    at geotrellis.spark.regrid.Regrid$Interval.<init>(Regrid.scala:34)
    at geotrellis.spark.regrid.Regrid$Interval.intersect(Regrid.scala:38)
    at geotrellis.spark.regrid.Regrid$.$anonfun$apply$6(Regrid.scala:119)
    at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
    at scala.collection.Iterator.foreach(Iterator.scala:943)
    at scala.collection.Iterator.foreach$(Iterator.scala:943)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
    at scala.collection.IterableLike.foreach(IterableLike.scala:74)
    at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
    at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
    at scala.collection.TraversableLike.map(TraversableLike.scala:286)
    at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
    at scala.collection.AbstractTraversable.map(Traversable.scala:108)
    at geotrellis.spark.regrid.Regrid$.$anonfun$apply$4(Regrid.scala:111)
    at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
    at scala.collection.Iterator.foreach(Iterator.scala:943)
bossie commented 1 year ago

TODO: write a unit test that provokes this (but tickets re: CDSE have priority).

jdries commented 1 year ago

fixed & updated unit test, was caused by negative spatial keys caused by buffering input extent