jiayuasu commented on code in PR #621:
URL: https://github.com/apache/incubator-sedona/pull/621#discussion_r856845472
##########
flink/src/test/java/org/apache/sedona/flink/FunctionTest.java:
##########
@@ -82,6 +87,27 @@ public void testReverse() {
}
@Test
+ public void testPointN_positiveN() {
+ int n = 1;
+ Table polygonTable = createPolygonTable(1);
+ Table linestringTable =
polygonTable.select(call(Functions.ST_ExteriorRing.class.getSimpleName(),
$(polygonColNames[0])));
+ Table pointTable =
linestringTable.select(call(Functions.ST_PointN.class.getSimpleName(),
$("_c0"), n));
+ Point point = (Point) first(pointTable).getField(0);
+ assert point != null;
+ Assert.assertEquals("POINT (-0.5 -0.5)", point.toString());
+ }
+
+ @Test
+ public void testPointN_negativeN() {
+ int n = -3;
+ Table polygonTable = createPolygonTable(1);
+ Table linestringTable =
polygonTable.select(call(Functions.ST_ExteriorRing.class.getSimpleName(),
$(polygonColNames[0])));
+ Table pointTable =
linestringTable.select(call(Functions.ST_PointN.class.getSimpleName(),
$("_c0"), n));
+ Point point = (Point) first(pointTable).getField(0);
+ assert point != null;
+ Assert.assertEquals("POINT (0.5 0.5)", point.toString());
+ }
+
Review Comment:
Please add a test for exterior ring.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]