<?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 Can't figure out how to insert a polygon object into a feature class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/can-t-figure-out-how-to-insert-a-polygon-object/m-p/1117981#M62996</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I've been struggling for two days trying to figure out how to insert a polygon object into a feature class. I've written the following code based off the&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/writing-geometries.htm" target="_blank" rel="noopener"&gt;Writing Geometries&lt;/A&gt;&amp;nbsp;guide, unfortunately all of those examples are starting from scratch and I extracted my polygon objects from the .getExtents().polygon function in the camera class. This creates the row and adds the name but there arent any of the polygons.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for name, poly in polyDict.items():
    with arcpy.da.InsertCursor(gdb_fc, ['Name', 'SHAPE@XY']) as cursor:
        cursor.insertRow([name, poly])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried adding an index to the poly variable to try the array but that doesn't work either. I'm obviously doing something wrong but have no idea as to what.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Nov 2021 23:51:32 GMT</pubDate>
    <dc:creator>ChrisCowin</dc:creator>
    <dc:date>2021-11-17T23:51:32Z</dc:date>
    <item>
      <title>Can't figure out how to insert a polygon object into a feature class</title>
      <link>https://community.esri.com/t5/python-questions/can-t-figure-out-how-to-insert-a-polygon-object/m-p/1117981#M62996</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I've been struggling for two days trying to figure out how to insert a polygon object into a feature class. I've written the following code based off the&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/writing-geometries.htm" target="_blank" rel="noopener"&gt;Writing Geometries&lt;/A&gt;&amp;nbsp;guide, unfortunately all of those examples are starting from scratch and I extracted my polygon objects from the .getExtents().polygon function in the camera class. This creates the row and adds the name but there arent any of the polygons.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for name, poly in polyDict.items():
    with arcpy.da.InsertCursor(gdb_fc, ['Name', 'SHAPE@XY']) as cursor:
        cursor.insertRow([name, poly])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also tried adding an index to the poly variable to try the array but that doesn't work either. I'm obviously doing something wrong but have no idea as to what.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 23:51:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-t-figure-out-how-to-insert-a-polygon-object/m-p/1117981#M62996</guid>
      <dc:creator>ChrisCowin</dc:creator>
      <dc:date>2021-11-17T23:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can't figure out how to insert a polygon object into a feature class</title>
      <link>https://community.esri.com/t5/python-questions/can-t-figure-out-how-to-insert-a-polygon-object/m-p/1117993#M62997</link>
      <description>&lt;P&gt;confirm you have a polygon object from the extent&lt;/P&gt;&lt;P&gt;you should be using&amp;nbsp;&lt;SPAN&gt;"SHAPE@" instead... you should read down further in the help files.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The polygon class you can get the extent and you can create the geometry from examples in the second link&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/polygon.htm" target="_blank"&gt;Polygon—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/writing-geometries.htm" target="_blank"&gt;Write geometries—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 00:23:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-t-figure-out-how-to-insert-a-polygon-object/m-p/1117993#M62997</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-11-18T00:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can't figure out how to insert a polygon object into a feature class</title>
      <link>https://community.esri.com/t5/python-questions/can-t-figure-out-how-to-insert-a-polygon-object/m-p/1117995#M62998</link>
      <description>&lt;P&gt;Figured it out if someone finds this later, Polygons need to be SHAPE@ and not &lt;A href="mailto:SHAPE@XY" target="_blank"&gt;SHAPE@XY&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 00:32:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-t-figure-out-how-to-insert-a-polygon-object/m-p/1117995#M62998</guid>
      <dc:creator>ChrisCowin</dc:creator>
      <dc:date>2021-11-18T00:32:33Z</dc:date>
    </item>
  </channel>
</rss>

