From 6b52f6ca9b490ed83337d69b524ad251925cc279 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Mon, 27 Jan 2025 18:00:09 +0000 Subject: [PATCH] add to docs --- docs/tutorial/geopandas-shapely.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/tutorial/geopandas-shapely.md b/docs/tutorial/geopandas-shapely.md index 2e78442876..bc286229b3 100644 --- a/docs/tutorial/geopandas-shapely.md +++ b/docs/tutorial/geopandas-shapely.md @@ -115,6 +115,26 @@ gdf.plot(

+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