jiayuasu commented on code in PR #862:
URL: https://github.com/apache/sedona/pull/862#discussion_r1228977592
##########
common/src/main/java/org/apache/sedona/common/Functions.java:
##########
@@ -881,6 +881,38 @@ public static Integer nRings(Geometry geometry) throws
Exception {
return numRings;
}
+ public static Geometry translate(Geometry geometry, double deltaX, double
deltaY, double deltaZ) {
+ if (!geometry.isEmpty()) {
+ if (geometry instanceof GeometryCollection) {
+ GeometryCollection geometryCollection = (GeometryCollection)
geometry;
Review Comment:
GeometryCollection can have child
GeometryCollection/MultiPoint/MultiPolygon/MultiLineString. The process to
extract GeometryCollection is more complicated than you thought. See here:
https://github.com/apache/sedona/blob/master/common/src/main/java/org/apache/sedona/common/utils/GeomUtils.java#L411
Please fix it accordingly. We usually use a queue or recursive function to
implement similar logics. In this case, I would recommend a recursive function.
With such a function, the code could be even further simplified.
--
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]