Skip to content

Commit ddd8f0e

Browse files
committed
Add failing unit test for issue 333, error in rf_agg_local_mean
Signed-off-by: Jason T. Brown <[email protected]>
1 parent 92afa34 commit ddd8f0e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

core/src/test/scala/org/locationtech/rasterframes/RasterFunctionsSpec.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,23 @@ class RasterFunctionsSpec extends TestEnvironment with RasterMatchers {
525525
checkDocs("rf_agg_local_max")
526526
}
527527

528+
ignore("should compute local mean") {
529+
checkDocs("rf_agg_local_mean")
530+
// https://github.com/locationtech/rasterframes/issues/333
531+
val df = Seq(two, three, one, six).toDF("tile")
532+
.withColumn("id", monotonically_increasing_id())
533+
df.select(rf_agg_local_mean($"tile")).first() should be(three.toArrayTile())
534+
535+
df.selectExpr("rf_agg_local_mean(tile)").as[Tile].first() should be(three.toArrayTile())
536+
537+
noException should be thrownBy {
538+
df.groupBy($"id")
539+
.agg(rf_agg_local_mean($"tile"))
540+
.collect()
541+
}
542+
543+
}
544+
528545
it("should compute local data cell counts") {
529546
val df = Seq(two, randNDPRT, nd).toDF("tile")
530547
val t1 = df.select(rf_agg_local_data_cells($"tile")).first()

0 commit comments

Comments
 (0)