<?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: Creating polygons from closed polylines with arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203676#M15639</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshuas answer seems the best way.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another take, is to use the tool you were doing, but only run it on 1 feature at a time, something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;src_shp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'a_shapfile'&lt;/SPAN&gt;
result_fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'a_different_shapefile'&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;src_shp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    row_oid &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getValue&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'OBJECTID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    row_where &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"""ObjectID = %s"""&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; row_oid
    active_lyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;src_shp&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; where_clause&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;row_where&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Exists&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row_result&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row_result&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    row_result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Feature to Polygon &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;active_lyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  temp_layer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    append_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row_result&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; result_fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I imagine Joshuas approach above will perform much faster though!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 10:06:37 GMT</pubDate>
    <dc:creator>LukeWebb</dc:creator>
    <dc:date>2021-12-11T10:06:37Z</dc:date>
    <item>
      <title>Creating polygons from closed polylines with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203674#M15637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone have any advice on how to invoke the "construct polygon" (I believe this lives in the Advance editing toolbar in Arcmap) on a python script?&lt;/P&gt;&lt;P&gt;I am currently trying to write a piece of code that will take in closed polylines which represent tree canopies, and convert them to polygons. I had tried using the tool Feature to Polygon in the Management toolbox, but it does not react well to closed polylines when they overlap each other as tree canopies&amp;nbsp;do in real life. I am trying to get one polygon for each closed polyline, and the "construct polygon" tool seems to do the job, but I don't know how to call it on python.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone here can suggest a way (with "construct polygon" or otherwise) to achieve this it would be very much appreciated.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2019 11:57:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203674#M15637</guid>
      <dc:creator>RafaeldePedro</dc:creator>
      <dc:date>2019-05-28T11:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating polygons from closed polylines with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203675#M15638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume when you state, "they overlap each other," a given polyline does not overlap itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no direct way to run the toolbar command you want from Python.&amp;nbsp; If you were so inclined, you could use comtypes and call the underlying ArcObjects, but I think the simpler path would be to use a Search Cursor to retrieve the polyline objects from the feature class and then convert them to polygon objects and insert them into a new feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have the polyline object, converting to a polygon is straightforward using ArcPy.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; pl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FromWKT&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'LINESTRING(0 0, 10 0, 10 10, 0 10, 0 0)'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3857&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; pl
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;Polyline object at &lt;SPAN class="number token"&gt;0x19159987dd8&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0x19159c5a210&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; pg &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Polygon&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getPart&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; pl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;spatialReference&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; pg
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;Polygon object at &lt;SPAN class="number token"&gt;0x19162933908&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0x19159ef0aa8&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203675#M15638</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T10:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating polygons from closed polylines with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203676#M15639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshuas answer seems the best way.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another take, is to use the tool you were doing, but only run it on 1 feature at a time, something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;src_shp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'a_shapfile'&lt;/SPAN&gt;
result_fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'a_different_shapefile'&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;src_shp&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    row_oid &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getValue&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'OBJECTID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    row_where &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"""ObjectID = %s"""&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; row_oid
    active_lyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;src_shp&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; where_clause&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;row_where&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Exists&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row_result&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row_result&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    row_result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Feature to Polygon &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;active_lyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  temp_layer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    append_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row_result&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; result_fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I imagine Joshuas approach above will perform much faster though!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:06:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203676#M15639</guid>
      <dc:creator>LukeWebb</dc:creator>
      <dc:date>2021-12-11T10:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating polygons from closed polylines with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203677#M15640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both. Yes when I said 'overlap' I should have said 'cross', but since the polylines represent an actual area I used that word. I will experiment and see how far I get. Thanks again!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2019 10:30:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203677#M15640</guid>
      <dc:creator>RafaeldePedro</dc:creator>
      <dc:date>2019-05-29T10:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating polygons from closed polylines with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203678#M15641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did this work? I'm looking for a way to do the same thing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2019 15:09:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203678#M15641</guid>
      <dc:creator>ThomasBlankinship</dc:creator>
      <dc:date>2019-06-19T15:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating polygons from closed polylines with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203679#M15642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;The responses above set me on the right path to my solution. However my approach was in the end different. Here is a sample of the code that I used to "read" the original polyline's geometry, make it an array for each feature (in my case they were tree canopies) and use it to create a polygon feature in the destination feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the formatting of my code I simply copied and pasted and amended certain variable names. I hope it helps though &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for row in arcpy.da.SearchCursor(infc, ["OID@", "SHAPE@"]):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vertexArray = arcpy.Array()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for part in row[1]:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for pnt in part:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vertexArray.add(pnt)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with arcpy.da.InsertCursor(outfc, ("SHAPE@",)) as cursor:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;feature&amp;nbsp;= arcpy.Polygon(vertexArray, spatialRef)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cursor.insertRow((feature,))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2019 10:25:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/203679#M15642</guid>
      <dc:creator>RafaeldePedro</dc:creator>
      <dc:date>2019-06-26T10:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Creating polygons from closed polylines with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/1561089#M73216</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you! With the "Preserve attributes" functionality having been removed from &lt;A href="https://pro.arcgis.com/en/pro-app/3.3/tool-reference/data-management/feature-to-polygon.htm" target="_blank"&gt;Feature To Polygon (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;this is very helpful in creating a workaround.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 00:18:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-polygons-from-closed-polylines-with-arcpy/m-p/1561089#M73216</guid>
      <dc:creator>MatthewSackrison</dc:creator>
      <dc:date>2024-11-21T00:18:30Z</dc:date>
    </item>
  </channel>
</rss>

