[SEDONA-113] Add ST_PointN to Apache Sedona - #621
Conversation
| } | ||
|
|
||
| public static Geometry getExteriorRing(Geometry geometry) { | ||
| return geometry.getFactory().createLinearRing(geometry.getCoordinates()); |
There was a problem hiding this comment.
Use this function in JTS Polygon. Dont create LinearRing by coordinates as they might NOT be the rings.https://locationtech.github.io/jts/javadoc/org/locationtech/jts/geom/Polygon.html#getExteriorRing--
There was a problem hiding this comment.
Sure, I updated this
| FROM df | ||
| ``` | ||
|
|
||
| Input: `POLYGON((0 0, 1 1, 2 1, 0 1, 1 -1))` |
There was a problem hiding this comment.
The example here is NOT a valid WKT format
| assert point != null; | ||
| Assert.assertEquals("POINT (0.5 0.5)", point.toString()); | ||
| } | ||
|
|
There was a problem hiding this comment.
Please add a test for exterior ring.
| override def nullable: Boolean = true | ||
|
|
||
| lazy val GeometryFactory = new GeometryFactory() | ||
| lazy val emptyGeometry: GeometryCollection = GeometryFactory.createGeometryCollection(null) |
There was a problem hiding this comment.
This emptyGeometry is NOT consistent with PostGIS requirement. ST_PointN should return NULL if no input linestring. You return an empty GeometryCollection but not NULL. https://postgis.net/docs/ST_PointN.html
Please fix this and add corresponding test cases for non-line string input.
Did you read the Contributor Guide?
Is this PR related to a JIRA ticket?
[SEDONA-XXX] my subject.What changes were proposed in this PR?
Added ST_PointN function to Flink and SQL
How was this patch tested?
Added unit tests in Java, Scala and Python
Did this PR include necessary documentation updates?