You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "iGN5117 (via GitHub)" <gi...@apache.org> on 2023/07/31 21:56:55 UTC
[GitHub] [sedona] iGN5117 commented on a diff in pull request #935: [SEDONA-336] Add RS_UpperLeftX and RS_UpperLeftY
iGN5117 commented on code in PR #935:
URL: https://github.com/apache/sedona/pull/935#discussion_r1279922708
##########
sql/common/src/test/scala/org/apache/sedona/sql/rasteralgebraTest.scala:
##########
@@ -403,6 +403,20 @@ class rasteralgebraTest extends TestBaseScala with BeforeAndAfter with GivenWhen
assertEquals(rasterDf.count(), binaryDf.count())
}
+ it("Passed RS_UpperLeftX"){
+ val df = sparkSession.read.format("binaryFile").load(resourceFolder + "raster/test1.tiff")
+ val result = df.selectExpr("RS_UpperLeftX(RS_FromGeoTiff(content))").first().getDouble(0)
+ val expected: Double = -1.3095817809482181E7
+ assertEquals(expected, result, 1e12)
Review Comment:
This will allow a difference of 10^12 while asserting equals. I think you mean 1e-12 which is 10^-12
##########
sql/common/src/test/scala/org/apache/sedona/sql/rasteralgebraTest.scala:
##########
@@ -403,6 +403,20 @@ class rasteralgebraTest extends TestBaseScala with BeforeAndAfter with GivenWhen
assertEquals(rasterDf.count(), binaryDf.count())
}
+ it("Passed RS_UpperLeftX"){
+ val df = sparkSession.read.format("binaryFile").load(resourceFolder + "raster/test1.tiff")
+ val result = df.selectExpr("RS_UpperLeftX(RS_FromGeoTiff(content))").first().getDouble(0)
+ val expected: Double = -1.3095817809482181E7
+ assertEquals(expected, result, 1e12)
+ }
+
+ it("Passed RS_UpperLeftY") {
+ val df = sparkSession.read.format("binaryFile").load(resourceFolder + "raster/test1.tiff")
+ val result = df.selectExpr("RS_UpperLeftY(RS_FromGeoTiff(content))").first().getDouble(0)
+ val expected: Double = 4021262.7487925636
+ assertEquals(expected, result, 1e8)
Review Comment:
Same here, I believe this is supposed to be 1e-8
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org