<?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: Converting a spatial data frame to a geopandas data frame that contains curvedPath geometries in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-a-spatial-data-frame-to-a-geopandas/m-p/1337890#M9143</link>
    <description>&lt;P&gt;Perhaps the conversion is missing a piece to perform the required steps for curves. I do believe, however, shapely supports curves and geopandas uses shapely geometry.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If shape accuracy is not a concern, I would guess a quick way to get around this would be to generalize your shape data first before loading into a GeoDataFrame like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sdf["SHAPE"] = sdf.SHAPE.apply(lambda x: x.generalize(max_offset=10))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where the max_offset is a value of your choosing.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2023 18:46:36 GMT</pubDate>
    <dc:creator>EarlMedina</dc:creator>
    <dc:date>2023-10-13T18:46:36Z</dc:date>
    <item>
      <title>Converting a spatial data frame to a geopandas data frame that contains curvedPath geometries</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-a-spatial-data-frame-to-a-geopandas/m-p/1337763#M9141</link>
      <description>&lt;P&gt;I'm trying to convert a spatial dataframe to a geopandas dataframe but get errors when the geometry contains 'curvedPaths'. If the geometry says 'paths' it works fine.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sdf = pd.DataFrame.spatial.from_featureclass("tp_master_lyr")
gdf = gpd.GeoDataFrame(sdf, geometry='SHAPE', crs=f"EPSG:{self.epsg_code}")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Create the sdf from a layer, then convert the gdf using the geometry field. When I read the sdf that works I see this:&lt;BR /&gt;0 1 B30 ... -43.801102 {"paths": [[[96887.0628000004, 4566105.1918],...&lt;BR /&gt;1 2 B30 ... -41.706207 {"paths": [[[963429.4271999998, 4566111.741800...&lt;/P&gt;&lt;P&gt;Testing another dataset, the one that doesn't work and gives&amp;nbsp;KeyError: 'paths':&lt;/P&gt;&lt;P&gt;0 1 ... {"curvePaths": [[[777739.0449999999, 4321271.9...&lt;BR /&gt;1 2 ... {"curvePaths": [[[123521.7758999998, 4329860.0...&lt;/P&gt;&lt;P&gt;If the sdf has 'curvePaths' as the geometry type I get errors when trying to convert to a geodataframe. Any ideas how to get round this?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 15:15:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-a-spatial-data-frame-to-a-geopandas/m-p/1337763#M9141</guid>
      <dc:creator>MattHowe</dc:creator>
      <dc:date>2023-10-13T15:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a spatial data frame to a geopandas data frame that contains curvedPath geometries</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-a-spatial-data-frame-to-a-geopandas/m-p/1337890#M9143</link>
      <description>&lt;P&gt;Perhaps the conversion is missing a piece to perform the required steps for curves. I do believe, however, shapely supports curves and geopandas uses shapely geometry.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If shape accuracy is not a concern, I would guess a quick way to get around this would be to generalize your shape data first before loading into a GeoDataFrame like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sdf["SHAPE"] = sdf.SHAPE.apply(lambda x: x.generalize(max_offset=10))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where the max_offset is a value of your choosing.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 18:46:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/converting-a-spatial-data-frame-to-a-geopandas/m-p/1337890#M9143</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2023-10-13T18:46:36Z</dc:date>
    </item>
  </channel>
</rss>

