You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "zhangfengcdt (via GitHub)" <gi...@apache.org> on 2026/04/22 16:09:26 UTC
[PR] [GH-2830] Adds Geography dual-dispatch to ST_GeometryType [sedona]
zhangfengcdt opened a new pull request, #2850:
URL: https://github.com/apache/sedona/pull/2850
## Did you read the Contributor Guide?
- Yes, I have read the [Contributor Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/latest/community/develop/)
## Is this PR related to a ticket?
- Yes, and the PR name follows the format `[GH-XXX] my subject`. Closes #<issue_number>
## What changes were proposed in this PR?
- Adds Geography dual-dispatch to ST_GeometryType — returns type strings like ST_Point, ST_Polygon for both Geometry and Geography inputs.
- Follow-up to #2831; L1 tier (Geography path delegates to JTS via "ST_" + getJTSGeometry().getGeometryType()).
## How was this patch tested?
- mvn -pl common -am test -Dtest=FunctionTest
- New Spark SQL cases in GeographyFunctionTest
## Did this PR include necessary documentation updates?
- Yes, I have updated the documentation.
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GH-2830] Adds Geography dual-dispatch to ST_GeometryType [sedona]
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu merged PR #2850:
URL: https://github.com/apache/sedona/pull/2850
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GH-2830] Adds Geography dual-dispatch to ST_GeometryType [sedona]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #2850:
URL: https://github.com/apache/sedona/pull/2850#discussion_r3125217336
##########
common/src/test/java/org/apache/sedona/common/Geography/FunctionTest.java:
##########
@@ -144,6 +144,35 @@ public void nPoints_polygon() throws ParseException {
assertEquals(5, Functions.nPoints(g));
}
+ @Test
+ public void geometryType_point() throws ParseException {
+ Geography g = Constructors.geogFromWKT("POINT (1 2)", 4326);
+ assertEquals("ST_Point", Functions.geometryType(g));
+ }
+
+ @Test
+ public void geometryType_linestring() throws ParseException {
+ Geography g = Constructors.geogFromWKT("LINESTRING (0 0, 1 1, 2 2)", 4326);
+ assertEquals("ST_LineString", Functions.geometryType(g));
+ }
+
+ @Test
+ public void geometryType_polygon() throws ParseException {
+ Geography g = Constructors.geogFromWKT("POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))", 4326);
+ assertEquals("ST_Polygon", Functions.geometryType(g));
+ }
+
+ @Test
+ public void geometryType_multiPoint() throws ParseException {
Review Comment:
Test method name `geometryType_multiPoint` uses camelCase after the underscore, while the surrounding tests consistently use snake_case (e.g., `nPoints_linestring`, `geometryType_linestring`). Rename to `geometryType_multipoint` (or similar) to keep naming consistent and make test discovery/searching predictable.
```suggestion
public void geometryType_multipoint() throws ParseException {
```
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org