You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by GitBox <gi...@apache.org> on 2022/11/30 03:55:25 UTC

[GitHub] [incubator-sedona] gmaraswa opened a new pull request, #718: [SEDONA-201] add ST_MPolyFromText and ST_MLineFromText methods

gmaraswa opened a new pull request, #718:
URL: https://github.com/apache/incubator-sedona/pull/718

   
   ## Did you read the Contributor Guide?
   
   - Yes, I have read [Contributor Rules](https://sedona.apache.org/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/community/develop/)
   
   
   ## Is this PR related to a JIRA ticket?
   
   - Yes, the URL of the associated JIRA ticket is https://issues.apache.org/jira/browse/SEDONA-201.
   
   ## What changes were proposed in this PR?
    Implementation of  ST_MLineFromText and ST_MPolyFromText
   
   ## How was this patch tested?
   Scala, Python, Java integration tests
   
   ## Did this PR include necessary documentation updates?
   
   - Yes, I have updated the documentation update.
   


-- 
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: dev-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-sedona] jiayuasu commented on a diff in pull request #718: [SEDONA-201] add ST_MPolyFromText and ST_MLineFromText methods

Posted by GitBox <gi...@apache.org>.
jiayuasu commented on code in PR #718:
URL: https://github.com/apache/incubator-sedona/pull/718#discussion_r1037877469


##########
sql/src/test/scala/org/apache/sedona/sql/constructorTestScala.scala:
##########
@@ -204,5 +204,15 @@ class constructorTestScala extends TestBaseScala {
       var spatialRDD2 = Adapter.toSpatialRdd(df, "geometry")
       Adapter.toDf(spatialRDD2, sparkSession).show(1)
     }
+
+    it("Passed ST_MLineFromWKT") {

Review Comment:
   Please add tests for the input with SRID



##########
flink/src/main/java/org/apache/sedona/flink/expressions/Constructors.java:
##########
@@ -185,4 +185,19 @@ public Geometry eval(@DataTypeHint("String") String kml) throws ParseException {
             return new KMLReader().read(kml);
         }
     }
+
+    public static class ST_MPolyFromWKT extends ScalarFunction {

Review Comment:
   Please create overload functions to take care of the inputs with SRID



##########
sql/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/st_constructors.scala:
##########
@@ -73,4 +73,11 @@ object st_constructors extends DataFrameAPI {
 
   def ST_PolygonFromText(coords: Column, delimiter: Column): Column = wrapExpression[ST_PolygonFromText](coords, delimiter)
   def ST_PolygonFromText(coords: String, delimiter: String): Column = wrapExpression[ST_PolygonFromText](coords, delimiter)
+
+  def ST_MPolyFromWKT(wkt: Column): Column = wrapExpression[ST_MPolyFromWKT](wkt, 0)
+  def ST_MPolyFromWKT(wkt: String): Column = wrapExpression[ST_MPolyFromWKT](wkt, 0)

Review Comment:
   Please handle the case with optional SRID



##########
docs/api/flink/Constructor.md:
##########
@@ -134,6 +134,32 @@ Spark SQL example:
 SELECT ST_LineStringFromText('Linestring(1 2, 3 4)') AS line
 ```
 
+## ST_MLineFromWKT
+
+Introduction: Construct a MultiLineString from Text
+
+Format: `ST_MLineFromWKT (Text:string)`
+
+Since: `1.3.0`

Review Comment:
   The version should be 1.3.1



##########
common/src/main/java/org/apache/sedona/common/Constructors.java:
##########
@@ -28,4 +28,20 @@ public static Geometry geomFromWKT(String wkt, int srid) throws ParseException {
         GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), srid);
         return new WKTReader(geometryFactory).read(wkt);
     }
+
+    public static Geometry mLineFromWKT(String wkt, int srid) throws ParseException {

Review Comment:
   The function names should be `FromText`, not `FromWKT`



-- 
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: dev-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-sedona] gmaraswa commented on a diff in pull request #718: [SEDONA-201] add ST_MPolyFromText and ST_MLineFromText methods

Posted by GitBox <gi...@apache.org>.
gmaraswa commented on code in PR #718:
URL: https://github.com/apache/incubator-sedona/pull/718#discussion_r1042959742


##########
docs/api/flink/Constructor.md:
##########
@@ -134,6 +134,32 @@ Spark SQL example:
 SELECT ST_LineStringFromText('Linestring(1 2, 3 4)') AS line
 ```
 
+## ST_MLineFromWKT
+
+Introduction: Construct a MultiLineString from Text
+
+Format: `ST_MLineFromWKT (Text:string)`
+
+Since: `1.3.0`

Review Comment:
   @jiayuasu I have made all the requested changes and have successfully run the test cases. Please let me know if any more changes are required.



-- 
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: dev-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-sedona] jiayuasu merged pull request #718: [SEDONA-201] add ST_MPolyFromText and ST_MLineFromText methods

Posted by GitBox <gi...@apache.org>.
jiayuasu merged PR #718:
URL: https://github.com/apache/incubator-sedona/pull/718


-- 
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: dev-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-sedona] jiayuasu commented on pull request #718: [SEDONA-201] add ST_MPolyFromText and ST_MLineFromText methods

Posted by GitBox <gi...@apache.org>.
jiayuasu commented on PR #718:
URL: https://github.com/apache/incubator-sedona/pull/718#issuecomment-1334891642

   @gmaraswa ST_MakePolygon also uses an optional parameter. Please follow the way it handles optional parameters


-- 
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: dev-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org