Skip to content

Commit

Permalink
add to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jan 27, 2025
1 parent 669c4e8 commit 6b52f6c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/tutorial/geopandas-shapely.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,26 @@ gdf.plot(
<br>
<br>

You may also wish to try converting to GeoPandas via GeoArrow, which can be
significantly faster for large results (requires geopandas >= 1.0).

```python
import geopandas as gpd
from sedona.spark import dataframe_to_arrow

config = SedonaContext.builder().
getOrCreate()

sedona = SedonaContext.create(config)

test_wkt = ["POINT (0 1)", "LINESTRING (0 1, 2 3)"]
df = sedona.createDataFrame(zip(test_wkt), ["wkt"]).selectExpr(
"ST_GeomFromText(wkt) as geom"
)

gpd.GeoDataFrame.from_arrow(dataframe_to_arrow(df))
```

## Interoperate with shapely objects

### Supported Shapely objects
Expand Down

0 comments on commit 6b52f6c

Please sign in to comment.