<?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: arcgis.geometry Polygon not converting polyline to polygon in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1152964#M7212</link>
    <description>&lt;P&gt;The lambda function is doing exactly what you specified - returning the polygon calculation. Recall, this is a function, it returns a value.&amp;nbsp; What is missing is a destination for function return value.&amp;nbsp; The SHAPE field is unchanged because the code does not use that field to store the function results.&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;df['SHAPE'] = df['SHAPE'].apply(lambda x: Polygon(x))&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2022 16:10:05 GMT</pubDate>
    <dc:creator>DavidAnderson_1701</dc:creator>
    <dc:date>2022-03-11T16:10:05Z</dc:date>
    <item>
      <title>arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1152952#M7210</link>
      <description>&lt;P&gt;Community,&lt;/P&gt;&lt;P&gt;I have a spatially enabled dataframe (SEDF) with polyline geometry.&amp;nbsp; Ultimately, I need polygon geometry.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My attempt to use arcgis.geometry is shown below.&amp;nbsp; The Polygon() method doesn’t throw any errors but it also doesn’t seem to do anything.&amp;nbsp; The geometry remains a polygon.&lt;/P&gt;&lt;P&gt;Any suggestions would be appreciated.&amp;nbsp; Also, I don’t necessarily need to employ the method I’m trying, but it is desirable to stay within the SEDF.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="polyline.JPG" style="width: 505px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36140i46BE00F429E25791/image-size/large?v=v2&amp;amp;px=999" role="button" title="polyline.JPG" alt="polyline.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tyler&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 15:39:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1152952#M7210</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2022-03-11T15:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1152958#M7211</link>
      <description>&lt;P&gt;Any chance you've got a subset of the data to test this on? I've had some luck with accessing the geometry dict and renaming the keys (in this case "paths" → "rings"), then using the &lt;STRONG&gt;Geometry&lt;/STRONG&gt; constructor, but I don't have a concrete example handy.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 15:50:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1152958#M7211</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-11T15:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1152964#M7212</link>
      <description>&lt;P&gt;The lambda function is doing exactly what you specified - returning the polygon calculation. Recall, this is a function, it returns a value.&amp;nbsp; What is missing is a destination for function return value.&amp;nbsp; The SHAPE field is unchanged because the code does not use that field to store the function results.&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;df['SHAPE'] = df['SHAPE'].apply(lambda x: Polygon(x))&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 16:10:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1152964#M7212</guid>
      <dc:creator>DavidAnderson_1701</dc:creator>
      <dc:date>2022-03-11T16:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1152998#M7213</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;Thanks for looking at this.&amp;nbsp; Here is one polyline:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{'paths': [[[14581, 6618.75], [14583, 6618.75], [14583, 6756.75], [14427, 6756.75], [14427, 6748.75], [14415, 6748.75], [14415, 6618.75], [14581, 6618.75]]], 'spatialReference': {'wkid': None}}&lt;/LI-CODE&gt;&lt;P&gt;Before posting I had simply tried replacing 'paths' with 'rings' with no luck, but didn't dig any further.&amp;nbsp; Let me know if there are other syntax changes required.&amp;nbsp; Side note, seem like arcgis.geometry would have a simple type caster.&amp;nbsp; &amp;nbsp;The documentation implies polyline to polygon using Polygon should work stating "&lt;SPAN&gt;The same patterna can be repeated for Polygon," at&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.geometry.html" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.geometry.html&lt;/A&gt;, where the example is from line to polyline, so no example of polyline to polygon.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/483343"&gt;@DavidAnderson_1701&lt;/a&gt;, first things first...I need&amp;nbsp;df['SHAPE'].apply(lambda x: Polygon(x)) to return a polygon vice polyline as shown.&amp;nbsp; I'll take care of the assignment later once debugged.&amp;nbsp; Thanks for your input though.&amp;nbsp; Any other thoughts?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 17:26:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1152998#M7213</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2022-03-11T17:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153002#M7214</link>
      <description>&lt;P&gt;Seems to work just fine at a single-geometry level.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;geom = {
    'paths': [[
            [14581, 6618.75], 
            [14583, 6618.75], 
            [14583, 6756.75], 
            [14427, 6756.75], 
            [14427, 6748.75], 
            [14415, 6748.75], 
            [14415, 6618.75], 
            [14581, 6618.75]
        ]], 
    'spatialReference': {'wkid': None}
}

geom['rings'] = geom.pop('paths')

arcgis.geometry.Geometry(geom).type&lt;/LI-CODE&gt;&lt;P&gt;Returns&lt;/P&gt;&lt;PRE&gt;Polygon&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1647020876007.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36154iC8223F5B0ABF36DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1647020876007.png" alt="jcarlson_0-1647020876007.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But perhaps things operate a bit different at the SEDF level? Could you attach the dataframe itself, or just a subset of it?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sedf.head(10).to_pickle('pline_to_pgon_test.pkl')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 17:47:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153002#M7214</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-11T17:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153009#M7215</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/530005"&gt;@TylerT&lt;/a&gt;&amp;nbsp;this is the correct answer. You need an assignment statement.&lt;BR /&gt;&lt;BR /&gt;When you print out the type() in your last line of code, it's not doing what you think it's doing. It's running the apply function, but not saving the results. So unless you assign the results, then the type will not change.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 18:09:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153009#M7215</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-03-11T18:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153011#M7216</link>
      <description>&lt;P&gt;I wasn't using your technique.&amp;nbsp; I'll give that a go, and let you know.&amp;nbsp; If it fails, I'll post a subset.&amp;nbsp; Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 18:15:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153011#M7216</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2022-03-11T18:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153178#M7217</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;;&amp;nbsp;here's what I came up with using your pop suggestion.&amp;nbsp; I'm not thrilled with it, as I'll explain more below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="polygon1.JPG" style="width: 585px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36206i7A3CCE187BF9747E/image-size/large?v=v2&amp;amp;px=999" role="button" title="polygon1.JPG" alt="polygon1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Test 1) Overwrite 'SHAPE' with apply pl_to_pg.&amp;nbsp; This did not work because the 'SHAPE' column ended up losing it's status as geometry type and therefore the entire df lost status as SEDF.&amp;nbsp; Converting back to SEDF with&amp;nbsp;pd.DataFrame.spatial.from_df(df) would then throw an error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Test 2) Create new 'SHAPE_PG' (polygon) column with apply pl_to_pg.&amp;nbsp; This didn't work, because oddly, the 'apply' method changed both the 'SHAPE' column values and 'SHAPE_PG' columns values, again losing df status as SEDF. This is not normal behavior for apply.&amp;nbsp; Something to do with geometry type, maybe?&lt;/P&gt;&lt;P&gt;Final) Back to the drawing board.&amp;nbsp; You see finally I went from type_polyline to type JSON to type_polygon, then set the new geometry column to 'SHAPE_PG'.&amp;nbsp; C&lt;SPAN&gt;reating a JSON column&amp;nbsp; allowed apply to behave and SEDF status held, but seems a bit Rube Goldberg.&amp;nbsp; following are the top ten csv polyline records.&amp;nbsp; Let me know if you can come up with something cleaner.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Tyler&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;idx,FID,SHAPE
2,3,"{'paths': [[[15033.75, 5868.75], [15028.75, 5868.75], [15028.75, 5878.6875], [14842.25, 5878.6875], [14842.25, 5902.6875], [14689.25, 5902.6875], [14689.25, 5652.6875], [14716.75, 5652.6875], [14716.75, 5638.125], [14935.25, 5638.125], [14935.25, 5758.5], [14940.25, 5758.5], [14940.25, 5638.125], [15028.75, 5638.125], [15028.75, 5717.75], [15033.75, 5717.75], [15033.75, 5868.75]]], 'spatialReference': {'wkid': None}}"
3,4,"{'paths': [[[14581, 6618.75], [14583, 6618.75], [14583, 6756.75], [14427, 6756.75], [14427, 6748.75], [14415, 6748.75], [14415, 6618.75], [14581, 6618.75]]], 'spatialReference': {'wkid': None}}"
4,5,"{'paths': [[[14539, 6566.75], [14539, 6614.5], [14415, 6614.5], [14415, 6430.5], [14539, 6430.5], [14539, 6566.75]]], 'spatialReference': {'wkid': None}}"
5,6,"{'paths': [[[14543.25, 6566.75], [14543.25, 6430.5], [14602, 6430.500000000001], [14602, 6378], [14656, 6378], [14656, 6388.5], [14670, 6388.5], [14670, 6378], [14810.75, 6378], [14810.75, 6641.25], [14763, 6641.25], [14763, 6492], [14583, 6492], [14583, 6614.5], [14543.25, 6614.5], [14543.25, 6566.75]]], 'spatialReference': {'wkid': None}}"
6,7,"{'paths': [[[14587.25, 6544.5], [14587.25, 6496.5], [14670.25, 6496.5], [14670.25, 6641.25], [14587.25, 6641.25], [14587.25, 6544.5]]], 'spatialReference': {'wkid': None}}"
7,8,"{'paths': [[[14674.75, 6496.5], [14758.5, 6496.5], [14758.5, 6641.25], [14674.75, 6641.25], [14674.75, 6496.5]]], 'spatialReference': {'wkid': None}}"
8,9,"{'paths': [[[14670.25, 6748.5], [14587.25, 6748.5], [14587.25, 6646.5], [14670.25, 6646.5], [14670.25, 6748.5]]], 'spatialReference': {'wkid': None}}"
9,10,"{'paths': [[[14805.25, 6646.5], [14810.75, 6646.5], [14810.75, 6748.5], [14674.75, 6748.5], [14674.75, 6646.5], [14805.25, 6646.5]]], 'spatialReference': {'wkid': None}}"
10,11,"{'paths': [[[14816, 6639.25], [14816, 6593.5], [14912, 6593.5], [14912, 6748.5], [14816, 6748.5], [14816, 6639.25]]], 'spatialReference': {'wkid': None}}"
11,12,"{'paths': [[[14816, 6473.5], [14912, 6473.5], [14912, 6588.25], [14816, 6588.25], [14816, 6473.5]]], 'spatialReference': {'wkid': None}}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2022 20:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153178#M7217</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2022-03-12T20:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153192#M7218</link>
      <description>&lt;P&gt;It's hard to say for sure, since the dataframe I create from your text is not necessarily the same dataframe you're working with. I'm able to overwrite the shape column without the issues you're describing.&lt;/P&gt;&lt;P&gt;Any chance you could attach a pickled dataframe? That would ensure that the data I'm testing is the same as what you have.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2022 03:37:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153192#M7218</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-13T03:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153207#M7219</link>
      <description>&lt;P&gt;Sorry about that.&amp;nbsp; You asked for that before and I wasn't sure what it was.&amp;nbsp; Now I know.&amp;nbsp; Let me know what you think.&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Tyler&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2022 14:59:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153207#M7219</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2022-03-13T14:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153388#M7223</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DavidAnderson_1701_0-1647271695974.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36257iD74F6FFBEDFB7B42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DavidAnderson_1701_0-1647271695974.png" alt="DavidAnderson_1701_0-1647271695974.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The above code shows how I was able to get this to work.&amp;nbsp; The SEDF Polygon operator does not quite work as I thought it should.&amp;nbsp; This statement did not wori:&lt;/P&gt;&lt;P&gt;temp_df['new_geom'] = temp_df['coor'].apply(lambda x : arcgis.geometry.Polygon(x))&lt;/P&gt;&lt;P&gt;I dropped back to using arcpy geometry constructors, which seems to work.&lt;/P&gt;&lt;P&gt;Note this is hard coded to just work for a single part polygon with no holes.&amp;nbsp; &amp;nbsp;A more general formalation would be extract the arcpy code into a separate function.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 15:32:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1153388#M7223</guid>
      <dc:creator>DavidAnderson_1701</dc:creator>
      <dc:date>2022-03-14T15:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1154392#M7230</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;, any findings with the pickle file?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 17:34:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1154392#M7230</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2022-03-16T17:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1154411#M7232</link>
      <description>&lt;P&gt;No luck. I get an AttributeError when I attempt to read that file into a new DataFrame:&lt;/P&gt;&lt;PRE&gt;'DataFrame' object has no attribute '_data'&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 17:48:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1154411#M7232</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-16T17:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1154540#M7234</link>
      <description>&lt;P&gt;I read in the pickle file, then successfully applied the method I desribed above:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;test_df = pd.read_pickle(r"polyline_sample.pkl")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;test_df['coor'] = test_df['SHAPE'].apply(lambda x : arcgis.geometry.Polyline.coordinates(x))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;test_df['poly_geom'] = test_df['coor'].apply(lambda x : arcpy.Polygon(arcpy.Array([arcpy.Point(*coords) for coords in x[0]])))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;test_df.spatial.set_geometry('poly_geom',inplace=True)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DavidAnderson_1701_0-1647466742835.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36549i1E432687EAFD6E90/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DavidAnderson_1701_0-1647466742835.png" alt="DavidAnderson_1701_0-1647466742835.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 21:39:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1154540#M7234</guid>
      <dc:creator>DavidAnderson_1701</dc:creator>
      <dc:date>2022-03-16T21:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1154542#M7236</link>
      <description>&lt;P&gt;Excellent! Thanks for doing that! I have no idea why pandas didn't want to read the file in my env, but I had too much going on to really dig into it further.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 21:43:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1154542#M7236</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-16T21:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.geometry Polygon not converting polyline to polygon</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1154585#M7240</link>
      <description>&lt;P&gt;Worth noting for posterity that this method is dangerous. This is why I couldn't test this data sample.&lt;/P&gt;&lt;P&gt;From the &lt;A href="https://docs.python.org/3/library/pickle.html" target="_self"&gt;Python docs&lt;/A&gt;:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;DIV class=""&gt;&lt;P class=""&gt;Warning&lt;/P&gt;&lt;P&gt;The &lt;SPAN class=""&gt;pickle&lt;/SPAN&gt; module &lt;STRONG&gt;is not secure&lt;/STRONG&gt;. Only unpickle data you trust.&lt;/P&gt;&lt;P&gt;It is possible to construct malicious pickle data which will &lt;STRONG&gt;execute arbitrary code during unpickling&lt;/STRONG&gt;. Never unpickle data that could have come from an untrusted source, or that could have been tampered with.&lt;/P&gt;&lt;P&gt;Consider signing data with &lt;A title="hmac: Keyed-Hashing for Message Authentication (HMAC) implementation" href="https://docs.python.org/3/library/hmac.html#module-hmac" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;hmac&lt;/SPAN&gt;&lt;/A&gt; if you need to ensure that it has not been tampered with.&lt;/P&gt;&lt;P&gt;Safer serialization formats such as &lt;A title="json: Encode and decode the JSON format." href="https://docs.python.org/3/library/json.html#module-json" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;json&lt;/SPAN&gt;&lt;/A&gt; may be more appropriate if you are processing untrusted data. See &lt;A href="https://docs.python.org/3/library/pickle.html#comparison-with-json" target="_blank" rel="noopener"&gt;&lt;SPAN class=""&gt;Comparison with json&lt;/SPAN&gt;&lt;/A&gt;.&lt;/P&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 00:09:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-geometry-polygon-not-converting-polyline-to/m-p/1154585#M7240</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-03-17T00:09:46Z</dc:date>
    </item>
  </channel>
</rss>

