yutannihilation commented on code in PR #498:
URL: https://github.com/apache/sedona-db/pull/498#discussion_r2671318483


##########
rust/sedona-functions/src/st_geomfromwkt.rs:
##########
@@ -147,8 +149,139 @@ fn invoke_scalar(wkt_bytes: &str, builder: &mut 
BinaryBuilder) -> Result<()> {
     .map_err(|err| DataFusionError::Internal(format!("WKB write error: 
{err}")))
 }
 
+/// ST_GeomFromEWKT() UDF implementation
+///
+/// An implementation of EWKT reading using GeoRust's wkt crate.
+pub fn st_geomfromewkt_udf() -> SedonaScalarUDF {
+    let doc = Documentation::builder(
+        DOC_SECTION_OTHER,
+        "Construct a Geometry from EWKT",
+        "ST_GeomFromEWKT (Ewkt: String)",
+    )
+    .with_argument(
+        "EWKT",
+        "string: Extended well-known text representation of the geometry",
+    )
+    .with_sql_example("SELECT ST_GeomFromEWKT('SRID=4326;POINT(40.7128 
-74.0060)')")
+    .build();
+
+    SedonaScalarUDF::new(
+        "st_geomfromewkt",
+        vec![Arc::new(STGeoFromEWKT {})],
+        Volatility::Immutable,
+        Some(doc),
+    )
+}
+
+#[derive(Debug)]
+struct STGeoFromEWKT {
+    // TODO
+    // engine: Option<Arc<dyn CrsEngine + Send + Sync>>,

Review Comment:
   Oh, thanks. Then, I remove this. I noticed engine is currently unused, but 
wondered if this is somehow useful for testing.



-- 
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]

Reply via email to