jiayuasu commented on code in PR #853:
URL: https://github.com/apache/sedona/pull/853#discussion_r1222591767
##########
common/src/main/java/org/apache/sedona/common/Functions.java:
##########
@@ -845,6 +845,14 @@ private static Coordinate[] extractCoordinates(Geometry
geometry) {
return coordinates;
}
+ public static int numPoints(Geometry geometry) throws Exception {
+ String geometryType = geometry.getGeometryType();
+ if (!(Geometry.TYPENAME_LINESTRING.equalsIgnoreCase(geometryType))) {
+ throw new Exception("Unsupported geometry type: " + geometryType);
Review Comment:
Maybe better if throw `IllegalArgumentException`. Please also add in the
error message that only LineString type can be accepted.
--
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]