<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Points to Polylines using an SEDF in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/points-to-polylines-using-an-sedf/m-p/1040220#M5799</link>
    <description>&lt;P&gt;So do things have to called differently in the SEDF, or is there something more amiss?&lt;/P&gt;</description>
    <pubDate>Wed, 24 Mar 2021 15:23:32 GMT</pubDate>
    <dc:creator>Webturtles</dc:creator>
    <dc:date>2021-03-24T15:23:32Z</dc:date>
    <item>
      <title>Points to Polylines using an SEDF</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/points-to-polylines-using-an-sedf/m-p/1039552#M5780</link>
      <description>&lt;P&gt;I have a SEDF populated from a CSV file (3-7 million rows):&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;sdfpositions = pd.DataFrame.spatial.from_xy(df=dfpositions, x_column = "LatDeg", y_column = "LongDeg",sr=4326)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and was looking to migrate a Geopandas points to polyline groupby process across to ESRI land.&lt;BR /&gt;GP version:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;dflines = dfpositions.groupby(['Group_ID'], as_index=False)['geometry'].apply(lambda x: LineString(x.tolist()))&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Would have hoped this might have worked:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;sdflines = sdfpositions.groupby(['Group_ID'], as_index=False)&lt;FONT color="#3366FF"&gt;['SHAPE'].apply(lambda x: LineString(x.tolist()))&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It fails with:&lt;/P&gt;&lt;PRE class="line stderr"&gt; File "shapely\speedups\_speedups.pyx", line 88, in shapely.speedups._speedups.geos_linestring_from_py
AttributeError: 'list' object has no attribute '__array_interface__'&lt;/PRE&gt;&lt;P&gt;The fail I think is somewhere in the highlighted blue text.&lt;/P&gt;&lt;P&gt;Is this process possible in a SEDF?&amp;nbsp; 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).&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not, wondering if worth trying to build the linestring JSON by injecting the point XY pairs and then converting to a polyline SEDF.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 22:46:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/points-to-polylines-using-an-sedf/m-p/1039552#M5780</guid>
      <dc:creator>Webturtles</dc:creator>
      <dc:date>2021-03-22T22:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Points to Polylines using an SEDF</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/points-to-polylines-using-an-sedf/m-p/1040051#M5793</link>
      <description>&lt;P&gt;I can't see any problems in the workflow.&lt;/P&gt;&lt;P&gt;I guess it's in the lambda function constructing the geometry string for the new ploylines&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 06:49:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/points-to-polylines-using-an-sedf/m-p/1040051#M5793</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2021-03-24T06:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Points to Polylines using an SEDF</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/points-to-polylines-using-an-sedf/m-p/1040220#M5799</link>
      <description>&lt;P&gt;So do things have to called differently in the SEDF, or is there something more amiss?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 15:23:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/points-to-polylines-using-an-sedf/m-p/1040220#M5799</guid>
      <dc:creator>Webturtles</dc:creator>
      <dc:date>2021-03-24T15:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Points to Polylines using an SEDF</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/points-to-polylines-using-an-sedf/m-p/1040244#M5800</link>
      <description>&lt;P&gt;Whilst having a peruse of the documentation, I came across the from_geodataframe function! So if all else fails, I will just switch from a geodataframe to SEDF before saving out.&amp;nbsp; Downside I guess is more overhead.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;#load flat coords into points geodataframe&lt;BR /&gt;gdfpositions = gpd.GeoDataFrame(dfpositions, geometry = gpd.points_from_xy(df.LongDeg, df.LatDeg))&lt;BR /&gt;#Make lines from grouped points based on groupID&lt;BR /&gt;gdflines = gdfpositions.groupby(['Group_ID'], as_index=False)['geometry'].apply(lambda x: LineString(x.tolist()))&lt;BR /&gt;#convert line geodataframe into SEDF&lt;BR /&gt;sdflines = GeoAccessor.from_geodataframe(gdflines, inplace=False, column_name='SHAPE')&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 16:05:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/points-to-polylines-using-an-sedf/m-p/1040244#M5800</guid>
      <dc:creator>Webturtles</dc:creator>
      <dc:date>2021-03-24T16:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Points to Polylines using an SEDF</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/points-to-polylines-using-an-sedf/m-p/1040459#M5805</link>
      <description>&lt;P&gt;The error occurs when using LineString(), have to see the data that goes into it to diagnose.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, have you read the following help doc?&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/guide/part2-working-with-geometries/#Creating-Polyline-objects" target="_blank"&gt;https://developers.arcgis.com/python/guide/part2-working-with-geometries/#Creating-Polyline-objects&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It talks about the constructing geometry and the geometry engines behind the scenes (ArcPy or Shapely)&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 23:28:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/points-to-polylines-using-an-sedf/m-p/1040459#M5805</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2021-03-24T23:28:36Z</dc:date>
    </item>
  </channel>
</rss>

