paleolimbot commented on PR #1767:
URL: https://github.com/apache/sedona/pull/1767#issuecomment-2608854218
> Why not do all this in scala?
Great point! It's pyspark, but I pushed a version that does the WKB in Spark
which is way better than what I had in mind 🙂
```python
import pyarrow as pa
from pyspark.sql.types import StringType, StructType
from sedona.utils.geoarrow import dataframe_to_arrow
test_wkt = ["POINT (0 1)", "LINESTRING (0 1, 2 3)"]
schema = StructType().add("wkt", StringType())
wkt_df = sedona.createDataFrame(zip(test_wkt), schema)
geo_df = wkt_df.selectExpr("ST_GeomFromText(wkt) AS geom")
dataframe_to_arrow(geo_df)
#> pyarrow.Table
#> geom: extension<geoarrow.wkb<WkbType>>
#> ----
#> geom:
[[01010000000000000000000000000000000000F03F],[0102000000020000000000000000000000000000000000F03F00000000000000400000000000000840]]
```
--
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]