You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by "furqaankhan (via GitHub)" <gi...@apache.org> on 2023/07/31 21:46:08 UTC
[GitHub] [sedona] furqaankhan opened a new pull request, #935: [SEDONA-336] Add RS_UpperLeftX and RS_UpperLeftY
furqaankhan opened a new pull request, #935:
URL: https://github.com/apache/sedona/pull/935
## Did you read the Contributor Guide?
- Yes, I have read [Contributor Rules](https://sedona.apache.org/latest-snapshot/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/latest-snapshot/community/develop/)
## Is this PR related to a JIRA ticket?
- Yes, the URL of the associated JIRA ticket is https://issues.apache.org/jira/browse/SEDONA-336. The PR name follows the format `[SEDONA-XXX] my subject`.
## What changes were proposed in this PR?
- Add RS_UpperLeftX and RS_UpperLeftY
## How was this patch tested?
- Add new tests
## Did this PR include necessary documentation updates?
- Yes, I am adding a new API. I am using the [current SNAPSHOT version number](https://github.com/apache/sedona/blob/master/pom.xml#L29) in since `vX.Y.Z` format.
--
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: dev-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sedona] jiayuasu merged pull request #935: [SEDONA-336] Add RS_UpperLeftX and RS_UpperLeftY
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu merged PR #935:
URL: https://github.com/apache/sedona/pull/935
--
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: dev-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sedona] furqaankhan commented on a diff in pull request #935: [SEDONA-336] Add RS_UpperLeftX and RS_UpperLeftY
Posted by "furqaankhan (via GitHub)" <gi...@apache.org>.
furqaankhan commented on code in PR #935:
URL: https://github.com/apache/sedona/pull/935#discussion_r1279926349
##########
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:
Thank you for pointing it out.
--
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
[GitHub] [sedona] iGN5117 commented on a diff in pull request #935: [SEDONA-336] Add RS_UpperLeftX and RS_UpperLeftY
Posted by "iGN5117 (via GitHub)" <gi...@apache.org>.
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