Copilot commented on code in PR #2298:
URL: https://github.com/apache/sedona/pull/2298#discussion_r2292743259
##########
docs/api/sql/geography/Constructor.md:
##########
@@ -162,3 +162,26 @@ Output:
```
MULTILINESTRING ((90 90, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10))
```
+
+## ST_GeomToGeography
+
+Introduction: Construct a Geography from a Geometry.
+
+Format:
+
+`ST_GeomToGeography (geom: Geometry)`
+
+Since: `v1.8.0`
+
+SQL example:
+
+```sql
+SELECT ST_GeomToGeography(ST_GeomFromWKT('MULTIPOLYGON (((10 10, 70 10, 70 70,
10 70, 10 10), (20 20, 60 20, 60 60, 20 60, 20 20)), ((30 30, 50 30, 50 50, 30
50, 30 30), (36 36, 44 36, 44 44, 36 44, 36 36)))
+'))
Review Comment:
The SQL statement is split across multiple lines without proper line
continuation formatting, making it difficult to read and potentially causing
issues if copied. Consider either keeping it on a single line or using proper
SQL line continuation syntax.
```suggestion
SELECT ST_GeomToGeography(ST_GeomFromWKT('MULTIPOLYGON (((10 10, 70 10, 70
70, 10 70, 10 10), (20 20, 60 20, 60 60, 20 60, 20 20)), ((30 30, 50 30, 50 50,
30 50, 30 30), (36 36, 44 36, 44 44, 36 44, 36 36)))'))
```
##########
common/src/main/java/org/apache/sedona/common/geography/Constructors.java:
##########
@@ -264,4 +264,200 @@ private static Geometry collectionToGeom(Geography g,
GeometryFactory gf) {
}
return gf.createGeometryCollection(gs);
}
+
+ public static Geography geomToGeography(Geometry geom) throws Exception {
Review Comment:
The method throws a generic Exception but the implementation only throws
specific exceptions like UnsupportedOperationException and
IllegalArgumentException. Consider declaring the specific exceptions instead of
the generic Exception.
```suggestion
public static Geography geomToGeography(Geometry geom) {
```
--
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]