<?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: &amp;quot;TypeError: cannot alter multipart geometry type&amp;quot; when trying to create singlepart polygons in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1315440#M71749</link>
    <description>&lt;P&gt;But that is again just for one polygon. That works without the array as well. If I try to do it for all polygons with the search Cursor&lt;/P&gt;&lt;LI-CODE lang="c"&gt;iCur = arcpy.da.InsertCursor(output_fc,["SHAPE@"])
with arcpy.da.SearchCursor(search_fc,"COL_A") as Scur:
    for row in Scur:
        coordinates = row[0]
        arr = arcpy.Array([arcpy.Point(*i) for i in coordinates])
        poly = arcpy.Polygon(arr)
        iCur.insertRow(poly)&lt;/LI-CODE&gt;&lt;P&gt;I get the following traceback:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 5, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 5, in &amp;lt;listcomp&amp;gt;&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\mixins.py", line 1101, in __init__&lt;BR /&gt;setattr(self, attr, value)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\_base.py", line 109, in _set&lt;BR /&gt;return setattr(self._arc_object, attr_name, cval(val))&lt;BR /&gt;RuntimeError: Point: Input value is not numeric&lt;/P&gt;</description>
    <pubDate>Fri, 04 Aug 2023 09:05:11 GMT</pubDate>
    <dc:creator>IlkaIllers1</dc:creator>
    <dc:date>2023-08-04T09:05:11Z</dc:date>
    <item>
      <title>"TypeError: cannot alter multipart geometry type" when trying to create singlepart polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1310406#M71294</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I have a table which has a field with coordinates in the format (x1,y1),(x2,y2),(x3,y3),(x4,y4),(x5,y5) which I want to convert into polygons. At first, I tried it manually by typing into the python window:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;coordinates = [(x1,y1),(x2,y2),(x3,y3),(x4,y4),(x5,y5)]
with arcpy.da.InsertCursor(output_fc,["SHAPE@"]) as cursor:
    cursor.insertRow([coordinates])&lt;/LI-CODE&gt;&lt;P&gt;This worked fine but is for obvious reasons a lot of work to do separately for every single polygon. So I tried to get it done in one go:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;iCur = arcpy.da.InsertCursor(output_fc,["SHAPE@"])
with arcpy.da.SearchCursor(search_fc,"COL_A") as sCur:
    for row in sCur:
        iCur.insertRow([row[0]])&lt;/LI-CODE&gt;&lt;P&gt;This results in "TypeError: cannot alter multipart geometry type".&lt;/P&gt;&lt;P&gt;I don't understand why it thinks this is supposed to be a multipart geometry. My thinking was by iterating through the sCur with the for loop, it would take only one row at a time (which is confirm when I print(row)). This works as an input manually, why does it not work within the cursor and loop?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 11:18:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1310406#M71294</guid>
      <dc:creator>IlkaIllers1</dc:creator>
      <dc:date>2023-07-21T11:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: "TypeError: cannot alter multipart geometry type" when trying to create singlepart polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1310467#M71298</link>
      <description>&lt;P&gt;polygons require input Point objects, check the associated syntax in the help files&lt;/P&gt;&lt;P&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;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 13:49:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1310467#M71298</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-07-21T13:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: "TypeError: cannot alter multipart geometry type" when trying to create singlepart polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1310683#M71316</link>
      <description>&lt;P&gt;Yes, that page is where I got the idea from. At the very bottom the examples show how to construct a polyline from just pairs of coordinates. I tried that for polygons and as I mentioned it works as long as I manually input the coordinates for every polygon separately - without using arcpy.Point. I feel like I am missing something? Why does this work:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;coordinates = [(x1,y1),(x2,y2),(x3,y3),(x4,y4),(x5,y5)]&lt;/LI-CODE&gt;&lt;P&gt;but it doesn't when I try to retrieve the same input from a search Cursor? I checked with the print function, and&lt;/P&gt;&lt;LI-CODE lang="c"&gt;with arcpy.da.SearchCursor(search_fc,"COL_B") as Scur:
    for row in Scur:
        coordinates = row[0]
        print(coordinates)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;gives me exactly the same; namely:&amp;nbsp;&lt;/P&gt;&lt;P&gt;[(x1,y1),(x2,y2),(x3,y3),(x4,y4),(x5,y5)]&lt;/P&gt;&lt;P&gt;If that is the return from the search cursor, why does it not work as input&amp;nbsp; for the insert cursor?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 20:35:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1310683#M71316</guid>
      <dc:creator>IlkaIllers1</dc:creator>
      <dc:date>2023-07-21T20:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: "TypeError: cannot alter multipart geometry type" when trying to create singlepart polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1310731#M71319</link>
      <description>&lt;LI-CODE lang="python"&gt;coords = [[0.0, 0.0], [2.0, 8.0], [8.0, 10.0], [10.0, 10.0],
          [10.0, 8.0], [9.0, 1.0], [0.0, 0.0]]

arr = arcpy.Array([arcpy.Point(*i) for i in coords])
type(arr)
&amp;lt;class 'arcpy.arcobjects.arcobjects.Array'&amp;gt;

poly = arcpy.Polyline(arr)
type(poly)
&amp;lt;class 'arcpy.arcobjects.geometries.Polyline'&amp;gt;
&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="polyline.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/76028iE5983801D1E354BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="polyline.png" alt="polyline.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 22:37:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1310731#M71319</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-07-21T22:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: "TypeError: cannot alter multipart geometry type" when trying to create singlepart polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1315440#M71749</link>
      <description>&lt;P&gt;But that is again just for one polygon. That works without the array as well. If I try to do it for all polygons with the search Cursor&lt;/P&gt;&lt;LI-CODE lang="c"&gt;iCur = arcpy.da.InsertCursor(output_fc,["SHAPE@"])
with arcpy.da.SearchCursor(search_fc,"COL_A") as Scur:
    for row in Scur:
        coordinates = row[0]
        arr = arcpy.Array([arcpy.Point(*i) for i in coordinates])
        poly = arcpy.Polygon(arr)
        iCur.insertRow(poly)&lt;/LI-CODE&gt;&lt;P&gt;I get the following traceback:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 5, in &amp;lt;module&amp;gt;&lt;BR /&gt;File "&amp;lt;string&amp;gt;", line 5, in &amp;lt;listcomp&amp;gt;&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\mixins.py", line 1101, in __init__&lt;BR /&gt;setattr(self, attr, value)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\_base.py", line 109, in _set&lt;BR /&gt;return setattr(self._arc_object, attr_name, cval(val))&lt;BR /&gt;RuntimeError: Point: Input value is not numeric&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 09:05:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1315440#M71749</guid>
      <dc:creator>IlkaIllers1</dc:creator>
      <dc:date>2023-08-04T09:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: "TypeError: cannot alter multipart geometry type" when trying to create singlepart polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1574684#M91855</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/526915"&gt;@IlkaIllers1&lt;/a&gt;. In your sample script with the insert and search cursors, it seems as though you are trying to add the content in the "COL_A" field from the "search_fc" feature class to the SHAPE field in the "output_fc" feature class.&lt;/P&gt;&lt;P&gt;The code should look something like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;iCur = arcpy.da.InsertCursor(output_fc,["SHAPE@","COL_A"])
with arcpy.da.SearchCursor(search_fc,["SHAPE@","COL_A"]) as sCur:
    for row in sCur:
        iCur.insertRow(row)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't tested this but I think it should work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jan 2025 21:22:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/quot-typeerror-cannot-alter-multipart-geometry/m-p/1574684#M91855</guid>
      <dc:creator>julian_svcs</dc:creator>
      <dc:date>2025-01-12T21:22:37Z</dc:date>
    </item>
  </channel>
</rss>

