-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I updated this
docs/api/flink/Function.md
Outdated
FROM df | ||
``` | ||
|
||
Input: `POLYGON((0 0, 1 1, 2 1, 0 1, 1 -1))` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example here is NOT a valid WKT format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it
assert point != null; | ||
Assert.assertEquals("POINT (0.5 0.5)", point.toString()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test for exterior ring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
override def nullable: Boolean = true | ||
|
||
lazy val GeometryFactory = new GeometryFactory() | ||
lazy val emptyGeometry: GeometryCollection = GeometryFactory.createGeometryCollection(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?