<?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: TypeError: value #1 - unsupported type: Polygon in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078688#M61744</link>
    <description>&lt;P&gt;check the examples in&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/insertcursor-class.htm" target="_blank" rel="noopener"&gt;InsertCursor—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;example 3 is what you are providing... just a shape, but you need to provide an Id value since you specified it in your fields&lt;/P&gt;&lt;PRE&gt; ["Id" , 'Floor_area']&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jul 2021 14:17:49 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-07-14T14:17:49Z</dc:date>
    <item>
      <title>TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078669#M61736</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I'm trying to add new rows into empty polygon feature.&lt;/P&gt;&lt;P&gt;this is the code:&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;cur = arcpy.da.InsertCursor(outshp, ["Id" , 'Floor_area'])&lt;BR /&gt;file = open(csvfile)&lt;BR /&gt;reader = csv.reader(file)&lt;BR /&gt;line = next(reader)&lt;BR /&gt;cnt = 0&lt;/P&gt;&lt;P&gt;for line in reader:&lt;BR /&gt;new_row = [line[0]]&lt;BR /&gt;points = []&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for i in line[1:]:&lt;BR /&gt;p = i.split(',')&lt;BR /&gt;point = arcpy.Point(p[0], p[1])&lt;BR /&gt;points.append(point)&lt;BR /&gt;arr = arcpy.Array(points)&lt;BR /&gt;polygn = arcpy.Polygon(arr)&lt;BR /&gt;new_row.append(polygn)&lt;BR /&gt;cur.insertRow(new_row)&lt;BR /&gt;cnt += 1&lt;BR /&gt;del cur&lt;/P&gt;&lt;P&gt;except:&lt;BR /&gt;traceback.print_exc()&lt;BR /&gt;del cur&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sadly, I'm getting this error:&lt;/P&gt;&lt;DIV class="input"&gt;&lt;DIV class="inner_cell"&gt;&lt;DIV class="input_area"&gt;&lt;DIV class="CodeMirror cm-s-ipython"&gt;&lt;DIV class="CodeMirror-scroll"&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="output_wrapper"&gt;&lt;DIV class="out_prompt_overlay prompt"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="output"&gt;&lt;DIV class="output_area"&gt;&lt;DIV class="run_this_cell"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="prompt"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="output_subarea output_text output_stream output_stderr"&gt;&lt;PRE&gt;Traceback (most recent call last):
  File "&amp;lt;ipython-input-8-44580ffd528c&amp;gt;", line 21, in &amp;lt;module&amp;gt;
    cur.insertRow(new_row)
TypeError: value #1 - unsupported type: Polygon&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="output_wrapper"&gt;&lt;DIV class="output"&gt;&lt;DIV class="output_area"&gt;&lt;DIV class="output_subarea output_text output_stream output_stderr"&gt;&lt;DIV class="cell code_cell rendered unselected"&gt;&lt;DIV class="input"&gt;&lt;DIV class="prompt_container"&gt;&lt;DIV class="run_this_cell"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="run_this_cell"&gt;Can you understand why?&lt;/DIV&gt;&lt;DIV class="run_this_cell"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="run_this_cell"&gt;Thanks&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 13:52:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078669#M61736</guid>
      <dc:creator>OrRubinstein</dc:creator>
      <dc:date>2021-07-14T13:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078674#M61737</link>
      <description>&lt;P&gt;I'm finding the code very hard to read without indentation.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 13:56:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078674#M61737</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-07-14T13:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078679#M61739</link>
      <description>&lt;P&gt;Sorry, had trouble copying the code/&lt;/P&gt;&lt;P&gt;here it is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; cur = arcpy.da.InsertCursor(outshp, ["Id" , 'Floor_area'])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; file = open(csvfile)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; reader = csv.reader(file)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; line = next(reader)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; cnt = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; for line in reader:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new_row = [line[0]]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; points = []&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for i in line[1:]:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; p = i.split(',')&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; point = arcpy.Point(p[0], p[1])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; points.append(point)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; arr = arcpy.Array(points)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; polygn = arcpy.Polygon(arr)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new_row.append(polygn)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cur.insertRow(new_row)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cnt += 1&lt;BR /&gt;&amp;nbsp; &amp;nbsp; del cur&lt;/P&gt;&lt;P&gt;except:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; traceback.print_exc()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; del cur&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 14:03:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078679#M61739</guid>
      <dc:creator>OrRubinstein</dc:creator>
      <dc:date>2021-07-14T14:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078681#M61740</link>
      <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633" target="_blank"&gt;Code formatting ... the Community Version - Esri Community&lt;/A&gt;&amp;nbsp;will help with that and provide line numbers&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 14:04:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078681#M61740</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-07-14T14:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078682#M61741</link>
      <description>&lt;P&gt;you don't provide a value for your "Id" just for the polygon..&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 14:09:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078682#M61741</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-07-14T14:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078686#M61743</link>
      <description>&lt;P&gt;i rewrote it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;try:

    cur = arcpy.da.InsertCursor(outshp, ["Id" , 'Floor_area'])
    file = open(csvfile)
    reader = csv.reader(file)
    line = next(reader)
    cnt = 0

    for line in reader:
        new_row = [cnt, line[0]]
        points = []
        
        
        for i in line[1:]:
            p = i.split(',')
            point = arcpy.Point(p[0], p[1])
            points.append(point)
        arr = arcpy.Array(points)
        polygn = arcpy.Polygon(arr)
        new_row.append(polygn)
        cur.insertRow(new_row)
        cnt += 1
    del cur

except:
    traceback.print_exc()
    del cur
    &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when I do provide value for Id get another error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Traceback (most recent call last):
  File "&amp;lt;ipython-input-9-a3290e7f669b&amp;gt;", line 21, in &amp;lt;module&amp;gt;
    cur.insertRow(new_row)
TypeError: sequence size must match size of the row&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 14:17:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078686#M61743</guid>
      <dc:creator>OrRubinstein</dc:creator>
      <dc:date>2021-07-14T14:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078688#M61744</link>
      <description>&lt;P&gt;check the examples in&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/insertcursor-class.htm" target="_blank" rel="noopener"&gt;InsertCursor—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;example 3 is what you are providing... just a shape, but you need to provide an Id value since you specified it in your fields&lt;/P&gt;&lt;PRE&gt; ["Id" , 'Floor_area']&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 14:17:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078688#M61744</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-07-14T14:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078701#M61748</link>
      <description>&lt;P&gt;First, I recommend using a &lt;FONT face="courier new,courier"&gt;with&lt;/FONT&gt; statement for opening files and cursors so they get closed automatically when exiting (with or without an error). Second, it looks like you're trying to insert a row with polygon geometry (shape) without specifying a shape field when you open the cursor. If &lt;FONT face="courier new,courier"&gt;Floor_area&lt;/FONT&gt; is just that, a double field representing the area measurement of a polygon, that's what you need to insert.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;try:
    cnt = 0
    with open(file, "r") as csv_reader:
        with arcpy.da.InsertCursor(outshp, ["Id", "Floor_area"]) as cur:
            for csv_line in csv_reader:
                polygon_points = []
                for point in line[1:]:
                    x, y = point.split(",")
                    point_geometry = arcpy.Point(x, y)
                    polygon_points.append(point_geometry)
                polygon_geometry = arcpy.Polygon(arcpy.Array(polygon_points))
                polygon_geometry_sqft = polygon_geometry.getArea(units="SQUAREFEET")
                cur.insertRow((csv_line[0], polygon_geometry_sqft))
                cnt += 1
except:
    traceback.print_exc()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If you do want to insert the polygon shape, you'll need to include &lt;FONT face="courier new,courier"&gt;"SHAPE@"&lt;/FONT&gt; in the fields and add the &lt;FONT face="courier new,courier"&gt;polygon_geometry&lt;/FONT&gt; into the values for &lt;FONT face="courier new,courier"&gt;insertRow()&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 14:40:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078701#M61748</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-07-14T14:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078708#M61749</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;'Floor area' field is actully not a geometry field, so I edite it:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;try:
    cnt = 0
    with open(csvfile, "r") as csv_reader:
        with arcpy.da.InsertCursor(outshp, ["Id", "Floor_area", 'SHAPE@']) as cur:
            for csv_line in csv_reader:
                polygon_points = []
                for point in line[1:]:
                    x, y = point.split(",")
                    point_geometry = arcpy.Point(x, y)
                    polygon_points.append(point_geometry)
                polygon_geometry = arcpy.Polygon(arcpy.Array(polygon_points))
                polygon_geometry_sqft = polygon_geometry.getArea(units="SQUAREFEET")
                cur.insertRow((csv_line[0], polygon_geometry_sqft))
                cnt += 1
except:
    traceback.print_exc()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but now i get this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Traceback (most recent call last):
  File "&amp;lt;ipython-input-40-433ebdb7888e&amp;gt;", line 12, in &amp;lt;module&amp;gt;
    polygon_geometry_sqft = polygon_geometry.getArea(units="SQUAREFEET")
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\arcobjects.py", line 1609, in getArea
    return convertArcObjectToPythonObject(self._arc_object.GetArea(*gp_fixargs((method, units))))
TypeError: Invalid geometry type for method&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 Jul 2021 15:05:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078708#M61749</guid>
      <dc:creator>OrRubinstein</dc:creator>
      <dc:date>2021-07-14T15:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078743#M61752</link>
      <description>&lt;P&gt;If you add SHAPE@ to the InsertCursor, you'll also need to include a value for that when you call insertRow(). Line 13 should be&lt;/P&gt;&lt;LI-CODE lang="python"&gt;cur.insertRow((csv_line[0], polygon_geometry_sqft, polygon_geometry))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;As for the TypeError: Invalid geometry type for method, make sure the points in your CSV make a valid polygon. Alternatively, just leave out Floor_area completely, then calculate that field after you've inserted all the new features.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 16:06:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078743#M61752</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-07-14T16:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078765#M61758</link>
      <description>&lt;P&gt;Thank to some of the advices here the error has been resolved, but the feature don't&amp;nbsp; includes coordinates and doesn't appear on the map... i can't really understand why.&lt;/P&gt;&lt;P&gt;this is all of the code:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import csv
import arcpy
import traceback

#Create Polygon layer from csv table

csvfile = r'C:\Geography\Spatial Python\final\Final_Ex\Buildings_alternative_2.csv'
outpath = r'C:\geography\Spatial Python\final'
outshp =  'test.shp'

outshp = arcpy.CreateFeatureclass_management (
    outpath, outshp, geometry_type='POLYGON',
    spatial_reference=arcpy.SpatialReference(4326))

arcpy.AddField_management (outshp, 'Floor_area', "LONG")
arcpy.AddField_management (outshp, 'SHAPE@', "DOUBLE")

try:

    cur = arcpy.da.InsertCursor(outshp, ["Id" , 'Floor_area', 'SHAPE@'])
    file = open(csvfile)
    reader = csv.reader(file)
    line = next(reader)
    cnt = 1

    for line in reader:
        new_row = [cnt, line[0]]
        points = []
        
        
        for i in line[1:]:
            p = i.split(',')
            point = arcpy.Point(p[0], p[1])
            points.append(point)
        arr = arcpy.Array(points)
        polygon = arcpy.Polygon(arr)
        new_row.append(polygon)
        cur.insertRow(new_row)
        cnt += 1
    del cur
        
        

except:
    traceback.print_exc()
    del cur
    &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the table includes the 'floor area' field but not the spatial data.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OrRubinstein_0-1626280643737.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/18408i722B91DF633C4247/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OrRubinstein_0-1626280643737.png" alt="OrRubinstein_0-1626280643737.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 16:37:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078765#M61758</guid>
      <dc:creator>OrRubinstein</dc:creator>
      <dc:date>2021-07-14T16:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078768#M61761</link>
      <description>&lt;P&gt;Could you post some sample rows from the CSV?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 16:41:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078768#M61761</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-07-14T16:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078771#M61763</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OrRubinstein_0-1626280969553.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/18409i48A87F8F61E81F50/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OrRubinstein_0-1626280969553.png" alt="OrRubinstein_0-1626280969553.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 16:42:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078771#M61763</guid>
      <dc:creator>OrRubinstein</dc:creator>
      <dc:date>2021-07-14T16:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078822#M61765</link>
      <description>&lt;P&gt;It's hard to get the full picture of what's happening with this screenshot. It would help if you could post the raw text of a few rows (with header row).&lt;/P&gt;&lt;P&gt;From what I can see here, column A is your "Id" field? Is there a variable number of point coordinate columns? Also, I see you're creating a "SHAPE@" field in the shapefile. That's not how that's intended to work. It's what's called a field token. It's not a field name that actually exists.&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/insertcursor-class.htm" target="_blank"&gt;InsertCursor—ArcMap | Documentation (arcgis.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here's some updated code but I'm not certain it will solve your problem.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import csv
import arcpy
import traceback

#Create Polygon layer from csv table

csvfile = r'C:\Geography\Spatial Python\final\Final_Ex\Buildings_alternative_2.csv'
outpath = r'C:\geography\Spatial Python\final'
outshp =  'test.shp'

try:
    outshp = arcpy.CreateFeatureclass_management(
        outpath, outshp, geometry_type='POLYGON',
        spatial_reference=arcpy.SpatialReference(4326)
    )

    arcpy.AddField_management (outshp, 'Id', "TEXT")
    arcpy.AddField_management (outshp, 'Floor_area', "DOUBLE")

    with open(csvfile, "r") as csv_reader:
        with arcpy.da.InsertCursor(outshp, ["Id", "Floor_area", 'SHAPE@']) as cur:
            for csv_line in csv_reader:
                polygon_points = []
                for point in line[1:]:
                    x, y = point.split(",")
                    point_geometry = arcpy.Point(x, y)
                    polygon_points.append(point_geometry)
                polygon_geometry = arcpy.Polygon(arcpy.Array(polygon_points))
                polygon_geometry_sqft = polygon_geometry.getArea(units="SQUAREFEET")
                cur.insertRow((csv_line[0], polygon_geometry_sqft, polygon_geometry))
except:
    traceback.print_exc()&lt;/LI-CODE&gt;&lt;P&gt;Try grabbing a single row of point coordinates from your CSV and hard coding them into your script (no CSV looping). Use those values to try inserting a single record into the shapefile. Start small to troubleshoot.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 17:51:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078822#M61765</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-07-14T17:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078843#M61766</link>
      <description>&lt;P&gt;thease are the first 2 rows, the coloumns are from left to right:&lt;/P&gt;&lt;TABLE width="820"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="69"&gt;180&lt;/TD&gt;&lt;TD width="69"&gt;178168.85730000027,642304.1140000001&lt;/TD&gt;&lt;TD width="69"&gt;178228.20880000014,642355.0789000001&lt;/TD&gt;&lt;TD width="69"&gt;178319.57019999996,642248.6835999992&lt;/TD&gt;&lt;TD width="158"&gt;178260.21879999992,642197.7185999993&lt;/TD&gt;&lt;TD width="386"&gt;178168.85730000027,642304.1140000001&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;180&lt;/TD&gt;&lt;TD&gt;178303.8627000004,642163.7553000003&lt;/TD&gt;&lt;TD&gt;178358.5828999998,642219.6634999998&lt;/TD&gt;&lt;TD&gt;178458.8058000002,642121.5704999994&lt;/TD&gt;&lt;TD&gt;178404.08559999987,642065.6622000001&lt;/TD&gt;&lt;TD&gt;178303.8627000004,642163.7553000003&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column A is Floor area and the rest are coodinates (x,y in every cell). the Id added automatically to the table, i'm not sure how but i can see that on arcGis pro. The variable for the id it "cnt".&lt;/P&gt;&lt;P&gt;there are varaibles for the coordinates and i'm looping on them here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;        for p in line[1:]: #looping the coordinates in every line
            pnt = p.split(',') #split x and y coordinates
            point = arcpy.Point(pnt[0], pnt[1]) #create a point feature
            points.append(point) #add to the point list
        arr = arcpy.Array(points) 
        polygon = arcpy.Polygon(arr)
        new_row.append(polygon)
        cur.insertRow(new_row)
        cnt += 1
    del cur&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not&amp;nbsp;familiar with the commands you wrote in the code, but the table i get is&amp;nbsp;partial and i get this error:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;
  File "&amp;lt;ipython-input-26-e60a0c54162d&amp;gt;", line 17, in &amp;lt;module&amp;gt;
    arcpy.AddField_management (outshp, 'Id', "TEXT")
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4337, in AddField
    raise e
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 4334, in AddField
    retval = convertArcObjectToPythonObject(gp.AddField_management(*gp_fixargs((in_table, field_name, field_type, field_precision, field_scale, field_length, field_alias, field_is_nullable, field_is_required, field_domain), True)))
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 511, in &amp;lt;lambda&amp;gt;
    return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000012: Id already exists
Failed to execute (AddField).&lt;/LI-CODE&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, 14 Jul 2021 18:21:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1078843#M61766</guid>
      <dc:creator>OrRubinstein</dc:creator>
      <dc:date>2021-07-14T18:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: TypeError: value #1 - unsupported type: Polygon</title>
      <link>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1079196#M61775</link>
      <description>&lt;P&gt;Turns out that the problem was with the projection.&lt;/P&gt;&lt;P&gt;thanks for the help.&lt;/P&gt;&lt;P&gt;this is the code that works:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import csv
import arcpy
import traceback

#Create polygon feature from csv file

csvfile = r'C:\Geography\Spatial Python\final\Final_Ex\Buildings_alternative_2.csv'
outpath = r'C:\geography\Spatial Python\final'
outshp =  'build.shp'

outshp = arcpy.CreateFeatureclass_management (
    outpath, outshp, geometry_type='POLYGON',
    spatial_reference=arcpy.SpatialReference(2039))

arcpy.AddField_management (outshp, 'Floor_area', "LONG") #add field for Floor area

try:

    cur = arcpy.da.InsertCursor(outshp, ['Id', 'Floor_area', 'SHAPE@'])
    f = open(csvfile)
    reader = csv.reader(f)
    lne = next(reader)
    cnt = 1
    

    for line in reader: #looping lines in the csv file
        new_row = [cnt, line[0]] # index of the row and the floor area field
        points = []
        
        
        for p in line[1:]: #looping the coordinates in every line
            pnt = p.split(',') #split x and y coordinates
            point = arcpy.Point(float(pnt[0]), float(pnt[1])) #create a point feature
            points.append(point) #add to the point list
        arr = arcpy.Array(points) 
        polygon = arcpy.Polygon(arr)
        new_row.append(polygon)
        cur.insertRow(new_row)
        cnt += 1
        
    del cur
        &lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 15 Jul 2021 14:17:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/typeerror-value-1-unsupported-type-polygon/m-p/1079196#M61775</guid>
      <dc:creator>OrRubinstein</dc:creator>
      <dc:date>2021-07-15T14:17:00Z</dc:date>
    </item>
  </channel>
</rss>

