You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by GitBox <gi...@apache.org> on 2022/04/23 06:42:35 UTC

[GitHub] [incubator-sedona] Pooja444 commented on a diff in pull request #621: [SEDONA-113] Add ST_PointN to Apache Sedona

Pooja444 commented on code in PR #621:
URL: https://github.com/apache/incubator-sedona/pull/621#discussion_r856858980


##########
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:
   Added



-- 
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