I have a SEDF populated from a CSV file (3-7 million rows):
sdfpositions = pd.DataFrame.spatial.from_xy(df=dfpositions, x_column = "LatDeg", y_column = "LongDeg",sr=4326)
and was looking to migrate a Geopandas points to polyline groupby process across to ESRI land.
GP version:
dflines = dfpositions.groupby(['Group_ID'], as_index=False)['geometry'].apply(lambda x: LineString(x.tolist()))
Would have hoped this might have worked:
sdflines = sdfpositions.groupby(['Group_ID'], as_index=False)['SHAPE'].apply(lambda x: LineString(x.tolist()))
It fails with:
File "shapely\speedups\_speedups.pyx", line 88, in shapely.speedups._speedups.geos_linestring_from_py
AttributeError: 'list' object has no attribute '__array_interface__'
The fail I think is somewhere in the highlighted blue text.
Is this process possible in a SEDF? Really want to use it as the speed for save to FGDB is far better than GP to shapefile or geopackage (and I need to do other arcpy steps later on).
If not, wondering if worth trying to build the linestring JSON by injecting the point XY pairs and then converting to a polyline SEDF.
I have made the assumption that switching to Arcpy would slow things down, as you would have to save out, then run points to polylines save out again etc.