Skip to content

Commit

Permalink
fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sllynn committed Nov 20, 2024
1 parent 8f12ccc commit 279cb6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ trait RST_ClipBehaviors extends QueryTest {
val gridTiles = rastersInMemory
.withColumn("bbox", rst_boundingbox($"tile"))
.withColumn("cent", st_centroid($"bbox"))
.withColumn("clip_region", st_buffer($"cent", 0.1))
.withColumn("clip_region", st_buffer($"cent", 1000.0))
.withColumn("clip", rst_clip($"tile", $"clip_region"))
.withColumn("bbox2", rst_boundingbox($"clip"))
.withColumn("result", st_area($"bbox") =!= st_area($"bbox2"))
Expand All @@ -43,7 +43,7 @@ trait RST_ClipBehaviors extends QueryTest {
noException should be thrownBy spark
.sql("""
|select
| rst_clip(tile, st_buffer(st_centroid(rst_boundingbox(tile)), 0.1)) as tile
| rst_clip(tile, st_buffer(st_centroid(rst_boundingbox(tile)), 1000.0)) as tile
|from source
|""".stripMargin)
.collect()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ trait RST_FromContentBehaviors extends QueryTest {
val sc = spark

import mc.functions._
import sc.implicits._
import org.apache.spark.sql.functions._
import sc.implicits._

val rastersInMemory = spark.read
.format("binaryFile")
Expand All @@ -27,7 +27,7 @@ trait RST_FromContentBehaviors extends QueryTest {
.withColumn("tile", rst_fromcontent($"content", "GTiff"))
.withColumn("bbox", rst_boundingbox($"tile"))
.withColumn("cent", st_centroid($"bbox"))
.withColumn("clip_region", st_buffer($"cent", 0.1))
.withColumn("clip_region", st_buffer($"cent", 1000.0))
.withColumn("clip", rst_clip($"tile", $"clip_region"))
.withColumn("bbox2", rst_boundingbox($"clip"))
.withColumn("result", st_area($"bbox") =!= st_area($"bbox2"))
Expand All @@ -44,7 +44,7 @@ trait RST_FromContentBehaviors extends QueryTest {
|with subquery as (
| select rst_fromcontent(content, 'GTiff') as tile from source
|)
|select st_area(rst_boundingbox(tile)) != st_area(rst_boundingbox(rst_clip(tile, st_buffer(st_centroid(rst_boundingbox(tile)), 0.1)))) as result
|select st_area(rst_boundingbox(tile)) != st_area(rst_boundingbox(rst_clip(tile, st_buffer(st_centroid(rst_boundingbox(tile)), 1000.0)))) as result
|from subquery
|""".stripMargin)
.as[Boolean]
Expand All @@ -59,7 +59,7 @@ trait RST_FromContentBehaviors extends QueryTest {
|with subquery as (
| select rst_fromcontent(content, 'GTiff', 4) as tile from source
|)
|select st_area(rst_boundingbox(tile)) != st_area(rst_boundingbox(rst_clip(tile, st_buffer(st_centroid(rst_boundingbox(tile)), 0.1)))) as result
|select st_area(rst_boundingbox(tile)) != st_area(rst_boundingbox(rst_clip(tile, st_buffer(st_centroid(rst_boundingbox(tile)), 1000.0)))) as result
|from subquery
|""".stripMargin)
.as[Boolean]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ trait RST_FromFileBehaviors extends QueryTest {
.withColumn("tile", rst_fromfile($"path"))
.withColumn("bbox", rst_boundingbox($"tile"))
.withColumn("cent", st_centroid($"bbox"))
.withColumn("clip_region", st_buffer($"cent", 0.1))
.withColumn("clip_region", st_buffer($"cent", 1000.0))
.withColumn("clip", rst_clip($"tile", $"clip_region"))
.withColumn("bbox2", rst_boundingbox($"clip"))
.withColumn("result", st_area($"bbox") =!= st_area($"bbox2"))
Expand All @@ -42,7 +42,7 @@ trait RST_FromFileBehaviors extends QueryTest {
|with subquery as (
| select rst_fromfile(path) as tile from source
|)
|select st_area(rst_boundingbox(tile)) != st_area(rst_boundingbox(rst_clip(tile, st_buffer(st_centroid(rst_boundingbox(tile)), 0.1)))) as result
|select st_area(rst_boundingbox(tile)) != st_area(rst_boundingbox(rst_clip(tile, st_buffer(st_centroid(rst_boundingbox(tile)), 1000.0)))) as result
|from subquery
|""".stripMargin)
.as[Boolean]
Expand All @@ -57,7 +57,7 @@ trait RST_FromFileBehaviors extends QueryTest {
|with subquery as (
| select rst_fromfile(path, 4) as tile from source
|)
|select st_area(rst_boundingbox(tile)) != st_area(rst_boundingbox(rst_clip(tile, st_buffer(st_centroid(rst_boundingbox(tile)), 0.1)))) as result
|select st_area(rst_boundingbox(tile)) != st_area(rst_boundingbox(rst_clip(tile, st_buffer(st_centroid(rst_boundingbox(tile)), 1000.0)))) as result
|from subquery
|""".stripMargin)
.as[Boolean]
Expand Down

0 comments on commit 279cb6a

Please sign in to comment.