-
Notifications
You must be signed in to change notification settings - Fork 697
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-333] Implement ST_GeomFromEWKT #937
Conversation
public void geomFromEWKT() throws ParseException { | ||
assertNull(Constructors.geomFromEWKT(null)); | ||
|
||
Geometry geom = Constructors.geomFromEWKT("POINT (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.
Please add one more test case SRID=4269;POINT (1 1)
(no space between semicolon and the wkt string)
docs/api/flink/Constructor.md
Outdated
|
||
SQL example: | ||
```sql | ||
SELECT ST_GeomFromEWKT('SRID=4269;POINT(40.7128 -74.0060)') |
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 print the result using ST_AsEWKT or ST_AsText . This will print SRID
def test_st_geom_from_ewkt(self): | ||
input_df = self.spark.createDataFrame([("SRID=4269;LineString(1 2, 3 4)",)], ["ewkt"]) | ||
input_df.createOrReplaceTempView("input_ewkt") | ||
line_df = self.spark.sql("select ST_LineFromText(ewkt) as geom from input_ewkt") |
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 test is not using ST_GeomFromEWKT
@@ -94,6 +94,13 @@ class dataFrameAPITestScala extends TestBaseScala { | |||
assert(actualResult.getSRID == 4326) | |||
} | |||
|
|||
it("passed st_geomfromewkt") { | |||
val df = sparkSession.sql("SELECT ST_GeomFromEWKT('SRID=4269;POINT(0.0 1.0)')") |
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 test didn't test the DataFrame API
@@ -132,6 +133,17 @@ def ST_GeomFromWKT(wkt: ColumnOrName) -> Column: | |||
""" | |||
return _call_constructor_function("ST_GeomFromWKT", wkt) | |||
|
|||
@validate_argument_types | |||
def ST_GeomFromEWKT(ewkt: ColumnOrName) -> Column: |
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 function is not tested.
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?
Add ST_GeomFromEWKTto sedona-common, sedona-sql, sedona-flink, and the dataframe/python API.
How was this patch tested?
Did this PR include necessary documentation updates?