You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by "Gregoire Leleu (Jira)" <ji...@apache.org> on 2023/02/17 14:35:00 UTC

[jira] [Created] (SEDONA-247) R copy_to/collect sf objects

Gregoire Leleu created SEDONA-247:
-------------------------------------

             Summary: R copy_to/collect sf objects
                 Key: SEDONA-247
                 URL: https://issues.apache.org/jira/browse/SEDONA-247
             Project: Apache Sedona
          Issue Type: New Feature
            Reporter: Gregoire Leleu


R uses the sf class to handle spatial objects.

Right now collecting results from Spark to R returns a pointer to the object in Spark for the geometry column. We need to convert the geometry column to WKT, collect in R and then convert back to geometry with sf. Ideally we would be able to collect without the transformation, and maybe as an sf object directly. Similar thing happens with copying an sf object from R to Spark, it fails.

Considerations:
 * Does this mean triggering conversion to WKT (WKB?) and then back plus traditional ser/de, or does something lower-level need to happen?
 * On the spark side, I guess something needs to trigger conversion to/from WKT. Does that need to be an extension of sparklyr jars (and what does that look like), or can that be in sedona jars?
 * On the R side probably can't force people to have sf loaded on collect. Probably interesting to see how postgis is handled, maybe:
 ** collect() returns a WKT and then you can convert it
 ** sf::st_read/st_write are used to copy/collect sf objects

In the short term: making it clear in the documentation (examples). Also creating methods to intercept sf classes and warn.

Then compatibility with sf::st_read/st_write would probably be nice

 

 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)