<?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: Create a multipart polygon with arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54913#M4320</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander, I believe you are hitting a limitation regarding multipart geometry, not arcpy, outlined &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//01m600000066000000"&gt;here&lt;/A&gt;‌ (although I could have sworn I've seen such multipart polygons before):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;"&gt;Keep in mind that parts in a multipart polygon are spatially separated. &lt;STRONG&gt;They can touch each other at vertices, but they cannot share edges or overlap&lt;/STRONG&gt;. When you are sketching a multipart polygon, any parts that share an edge will be merged into a single part when you finish the sketch. In addition, any overlap among parts will be removed, leaving a hole in the polygon.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Feb 2015 19:42:14 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2015-02-27T19:42:14Z</dc:date>
    <item>
      <title>Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54910#M4317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a multipart polygon based on 3 x 5 squares, but when I look at the result it dissolves the polygons and the enclosed squares are no longer part of it. If I do the same and store the result as a line (also multipart), the inner parts do appear in the result.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="multiparts.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/66186_multiparts.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain me what I am doing wrong or show me how I can create a valid multipart polygon that consists in this case of 15 partes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code that I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

# a square
part = [[0,0],[0,1],[1,1],[1,0],[0,0]]

mp = []
for x_shift in range(0,3):
&amp;nbsp;&amp;nbsp;&amp;nbsp; for y_shift in range(0,5):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; part_new = [[x+x_shift,y+y_shift] for [x,y] in part]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print part_new
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mp.append(part_new)

# the nested list for the multipart
##mp = [[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[0, 1], [0, 2], [1, 2], [1, 1], [0, 1]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[0, 2], [0, 3], [1, 3], [1, 2], [0, 2]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[0, 3], [0, 4], [1, 4], [1, 3], [0, 3]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[0, 4], [0, 5], [1, 5], [1, 4], [0, 4]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[1, 0], [1, 1], [2, 1], [2, 0], [1, 0]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[1, 1], [1, 2], [2, 2], [2, 1], [1, 1]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[1, 2], [1, 3], [2, 3], [2, 2], [1, 2]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[1, 3], [1, 4], [2, 4], [2, 3], [1, 3]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[1, 4], [1, 5], [2, 5], [2, 4], [1, 4]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[2, 0], [2, 1], [3, 1], [3, 0], [2, 0]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[2, 1], [2, 2], [3, 2], [3, 1], [2, 1]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[2, 2], [2, 3], [3, 3], [3, 2], [2, 2]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[2, 3], [2, 4], [3, 4], [3, 3], [2, 3]],
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [[2, 4], [2, 5], [3, 5], [3, 4], [2, 4]]]

# construct the array for the feature
lst_part = []
for part in mp:
&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_pnt = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; for pnt in part:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_pnt.append(arcpy.Point(float(pnt[0]), float(pnt[1])))
&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_part.append(arcpy.Array(lst_pnt))
array = arcpy.Array(lst_part)

# handle the array as polygon
polygon = arcpy.Polygon(array)
arcpy.CopyFeatures_management([polygon], r"D:\Xander\GeoNet\MultiPart\data.gdb\test_pol_mp")
print "Polygon partCount : {0}".format(polygon.partCount)
print "Polygon pointCount: {0}".format(polygon.pointCount)

# handle the array as polyline
polyline = arcpy.Polyline(array)
arcpy.CopyFeatures_management([polyline], r"D:\Xander\GeoNet\MultiPart\data.gdb\test_line_mp")
print "Polyline partCount : {0}".format(polyline.partCount)
print "Polyline pointCount: {0}".format(polyline.pointCount)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:05:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54910#M4317</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T22:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54911#M4318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander,&lt;/P&gt;&lt;P&gt;Messy code attached, but you catch the drift.&amp;nbsp; This is one of several methods that I have been experimenting with, but have a look.&amp;nbsp; In this one, I took the "ring" approach.&amp;nbsp; I can send you more details and a project offline if you want as well.&amp;nbsp; This is written very detailed so I can see what was needed to produce donuts, multiparts and the likes.&amp;nbsp; It use rectangles.&amp;nbsp; Another variant is in one of my two blog posts for both rectangular and hexagonal sampling frameworks, rotated or not.&amp;nbsp; Enjoy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;'''
create_polygon_demo.py
Author:&amp;nbsp;&amp;nbsp; &lt;A href="mailto:Dan.Patterson@carleton.ca" rel="nofollow noopener noreferrer" target="_blank"&gt;Dan.Patterson@carleton.ca&lt;/A&gt;
Date:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jan-Feb, 2015
Modified: lots
Purpose:
&amp;nbsp; To demonstrate the various types of polygons
&amp;nbsp; that can be formed from rings.&amp;nbsp; This is presented as detailed as
&amp;nbsp; possible so that the formation of any type of polygon can be seen
&amp;nbsp; from the points forming the rings.
Requires:
&amp;nbsp; A spatial reference...never make geometry without one.
Comments:
&amp;nbsp; It is setup so that you can comment or uncomment various sections
&amp;nbsp; and change the file name.&amp;nbsp; Since, CopyFeatures_Management is used
&amp;nbsp; it will NOT overwrite existing files, so, remove them from ArcMap,
&amp;nbsp; delete any file you want to overwrite and run again, or use a
&amp;nbsp; different file name.
&amp;nbsp; The files have already been created and are contained in the folder
&amp;nbsp; with the project.
&amp;nbsp; 
'''
def union_poly(polygons):
&amp;nbsp; '''union a list of polygons, results can be unexpected'''
&amp;nbsp; newPoly = polygons[0]
&amp;nbsp; for i in range(1,len(polygons)):
&amp;nbsp;&amp;nbsp;&amp;nbsp; polyunion = newPoly.union(polygons&lt;I&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp; newPoly=polyunion
&amp;nbsp; return newPoly&lt;/I&gt;
def polygonize(ring_list,output_shp,SR=3395,union=False,replace=True):
&amp;nbsp; '''create polygons,from rings (list of points) with a specify SR.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; default SR 'WGS_1984_World_Mercator' if unspecified. rings can
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; include exterior and interior point lists'''
&amp;nbsp; polygons = []
&amp;nbsp; for i in ring_list:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arr = arcpy.Polygon(arcpy.Array(i),SR)
&amp;nbsp;&amp;nbsp;&amp;nbsp; polygons.append(arr)
&amp;nbsp; if replace:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(output_shp):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(output_shp)
&amp;nbsp; if union:
&amp;nbsp;&amp;nbsp;&amp;nbsp; polygons = union_poly(polygons)
&amp;nbsp; arcpy.CopyFeatures_management(polygons, output_shp)
&amp;nbsp; arcpy.CalculateField_management(output_shp,"Id","!FID!","PYTHON_9.3")
&amp;nbsp; del polygons,arr
import arcpy
import os
import sys
script = sys.argv[0]
path = (os.path.dirname(script)).replace("&lt;A href="https://community.esri.com/" rel="nofollow noopener noreferrer" target="_blank"&gt;\\","/&lt;/A&gt;") + "/Shapefiles/"
#path = 'c:/temp/Shapefiles/'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # dump to here
print "\nRunning", script
arcpy.env.overwriteOutput = True
SR = arcpy.SpatialReference(3395)&amp;nbsp; # PCS 'WGS_1984_World_Mercator'
# Make rings.........................................................
X = [0,0,10,10,0]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # X,Y values for a square 10x10 units
Y = [0,10,10,0,0]
X_in = [1,1,-1,-1,1]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # inner buffer X, Y values
Y_in = [1,-1,-1,1,1]
XY = np.array(zip(X,Y))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # an XY array from zipped X,Y pairs
XY_in = np.array(zip(X_in,Y_in)) # buffer in... by distance
nose = np.array([[4,4],[5,6],[6,4],[4,4]])&amp;nbsp; # a triangle
p0 = [arcpy.Point(*pair) for pair in XY]&amp;nbsp; # root polygon points .....
XY1 = XY + [10,0]&amp;nbsp; # origin at 10,0
p1 = [arcpy.Point(*pair) for pair in XY1] # first feature with rings
p1a= [arcpy.Point(*pair) for pair in XY1 + XY_in]
p1b = [arcpy.Point(*pair) for pair in XY1 + (XY_in*2)]
p1c = [arcpy.Point(*pair) for pair in XY1 + (XY_in*3)]
p1d = [arcpy.Point(*pair) for pair in nose + [10,0]]
XY2 = XY + [20,0]&amp;nbsp; # origin at 20,0
p2 = [arcpy.Point(*pair) for pair in XY2] # second feature with rings
p2a= [arcpy.Point(*pair) for pair in (XY2 + XY_in)]
p2b = [arcpy.Point(*pair) for pair in (XY2 + (XY_in*2))]
p2c = [arcpy.Point(*pair) for pair in (XY2 + (XY_in*3))]
p2d = [arcpy.Point(*pair) for pair in (nose + [20,0])]
XY3 = XY + [30,0]&amp;nbsp; # origin at 30,0
p3 = [arcpy.Point(*pair) for pair in XY3] # second feature with rings
p3a= [arcpy.Point(*pair) for pair in (XY3 + XY_in)]
p3b = [arcpy.Point(*pair) for pair in (XY3 + (XY_in*2))]
p3c = [arcpy.Point(*pair) for pair in (XY3 + (XY_in*3))]
p3d = [arcpy.Point(*pair) for pair in (nose + [30,0])]
XY4 = XY + [0,10]
p4 = [arcpy.Point(*pair) for pair in XY4 ]
p4a = [arcpy.Point(*pair) for pair in (XY4 + XY_in)]
p4b = [arcpy.Point(*pair) for pair in (XY4 + (XY_in*2))]
p4c = [arcpy.Point(*pair) for pair in (XY4 + (XY_in*3))]
p4d = [arcpy.Point(*pair) for pair in nose + [0,10]]
p5a = [arcpy.Point(*pair) for pair in (XY + [10,10])]
p5b = [arcpy.Point(*pair) for pair in (XY + [20,20])]
p5c = [arcpy.Point(*pair) for pair in (XY + [30,10])]
p6a = [arcpy.Point(*pair) for pair in (XY + [10,20])]
p6b = [arcpy.Point(*pair) for pair in (XY + [20,10])]
p6c = [arcpy.Point(*pair) for pair in (XY + [30,20])]
# Make points........................................................
# comment out individual shapes that you don't want to see
output_shp = path + "x0.shp"&amp;nbsp;&amp;nbsp;&amp;nbsp; # ....the base polygon
rings = [p0]
polygonize(rings,output_shp,SR,False,True)
output_shp = path + "x1.shp"&amp;nbsp;&amp;nbsp;&amp;nbsp; # ....yields 3 seperate donut polygon
rings = [p1+p1a,p1b+p1c,p1d]
polygonize(rings,output_shp,SR,False,True)
output_shp = path + "x2.shp"&amp;nbsp;&amp;nbsp;&amp;nbsp; # same as above but with 'five' records
rings = [p2+p2a,p2a+p2b,p2b+p2c,p2c+p2d,p2d+p2d]&amp;nbsp; # make the donut plus rings
polygonize(rings,output_shp,SR,False,True)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # interesting
output_shp = path + "x3.shp"&amp;nbsp;&amp;nbsp;&amp;nbsp; # stacked polygon, same
rings = [p3,p3a,p3b,p3c,p3d]
polygonize(rings,output_shp,SR,False,True)
output_shp = path + "x4.shp"&amp;nbsp;&amp;nbsp; # just the donut holes as 3 separate polygon
rings = [p4a+p4b,p4c+p4d]
polygonize(rings,output_shp,SR,False,True)
output_shp = path + "x5.shp"&amp;nbsp;&amp;nbsp;&amp;nbsp; # single part polygons
rings = [p5a,p5b,p5c]
polygonize(rings,output_shp,SR,False,True)
output_shp = path + "x6.shp"&amp;nbsp;&amp;nbsp;&amp;nbsp; # multi-part polygon
rings = [p6a,p6b,p6c]
polygonize(rings,output_shp,SR,True,True)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:05:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54911#M4318</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-10T22:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54912#M4319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan, you seem to have a handle on this - is Xander's polygon "flattened" (dissolved) at the call to create the polygon ("polygon= arcpy.Polygon(array)"), or elsewhere?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: I tried your script and it does not seem to address Xander's problem, specifically creating one multipart polygon containing shared edges.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 19:09:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54912#M4319</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-02-27T19:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54913#M4320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander, I believe you are hitting a limitation regarding multipart geometry, not arcpy, outlined &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//01m600000066000000"&gt;here&lt;/A&gt;‌ (although I could have sworn I've seen such multipart polygons before):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;"&gt;Keep in mind that parts in a multipart polygon are spatially separated. &lt;STRONG&gt;They can touch each other at vertices, but they cannot share edges or overlap&lt;/STRONG&gt;. When you are sketching a multipart polygon, any parts that share an edge will be merged into a single part when you finish the sketch. In addition, any overlap among parts will be removed, leaving a hole in the polygon.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 19:42:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54913#M4320</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-02-27T19:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54914#M4321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3116" target="_blank"&gt;Dan Patterson&lt;/A&gt;‌, thanks for posting the code. I adapted my code to create the list of rings&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ring_list = [[arcpy.Point(float(pnt[0]), float(pnt[1])) for pnt in part] for part in mp]

out_shp = r"D:\Xander\GeoNet\MultiPart\shp\test02.shp"
polygonize(ring_list, out_shp, union=True)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... included your two defs in my code and gave it a shot...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried with union=True and union=False, but both cases don't give me the multipart feature with all the square parts in it. &lt;/P&gt;&lt;P&gt;So I thought, maybe I should use your data and see if that changes things. I ran your code (include import numpy as np) and I like the result.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="DansPolygonSample.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/66187_DansPolygonSample.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;However, non of the cases describes what I'm looking for. So I added two cases:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;taking the 6 blueish + orange squares and process them with union&lt;/LI&gt;&lt;LI&gt;and without union&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;output_shp = path + "x7.shp"&amp;nbsp;&amp;nbsp;&amp;nbsp; # multi-part polygon 2
rings = [p5a,p5b,p5c,p6a,p6b,p6c]
polygonize(rings,output_shp,SR,True,True)

output_shp = path + "x8.shp"&amp;nbsp;&amp;nbsp;&amp;nbsp; # single part polygons 2
rings = [p5a,p5b,p5c,p6a,p6b,p6c]
polygonize(rings,output_shp,SR,False,True)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result is not what I am looking for (a multipart feature containing the 6 parts not dissolved into a single part polygon):&lt;/P&gt;&lt;P&gt;&lt;IMG alt="DansPolygonSample2.png" class="jive-image image-2" src="https://community.esri.com/legacyfs/online/66284_DansPolygonSample2.png" style="width: 620px; height: 172px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am going to test on another version (10.1) to see if this may be due to my current version (10.3.0.4322)...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:05:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54914#M4321</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T22:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54915#M4322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/19932"&gt;Darren Wiens&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would explain for this to happen (just a little too much intelligence when the polygon object is created). I wonder if I would move the polygons a tiny little fraction if this would create the multipart polygon...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be great to have an additional parameter "&lt;EM&gt;TurnYourBeatifulMultipartPolygonIntoOneDissolvedSinglepartPolygonAndRuinYourWork&lt;/EM&gt;" in the polygon creation, which one could optionally set to False... &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 19:54:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54915#M4322</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-27T19:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54916#M4323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did a little test moving the squares a little with some increment and obtained this "beautiful" result:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="multiparts2.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/66285_multiparts2.png" style="width: 620px; height: 337px;" /&gt;&lt;/P&gt;&lt;P&gt;On the left little movement, in the middle a multipart with 3 parts was created (vertically dissolved the squares) and to the right a multipart with 15 parts was created. I suppose the XY tolerance for the data or defined in the environment setting also influences the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That confirms what &lt;A href="https://community.esri.com/migrated-users/19932"&gt;Darren Wiens&lt;/A&gt;‌ was stating: "&lt;EM&gt;any parts that share an edge will be merged into a single part&lt;/EM&gt;"...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 20:17:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54916#M4323</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-27T20:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54917#M4324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahh good catch...since I was trying to confirm that remained separate when they share a single node as in the case of my original multipart shape...if it is handled wrong, then you end up with the weird polygon output I was alluding to.&amp;nbsp; Great summary..and to note that moving them apart, dissolving, unioning and moving back doesn't work either I tried that with limited to no success when repair geometry was run on the resultant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 23:44:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54917#M4324</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-02-27T23:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54918#M4325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Guys.... can I referenc Xander's example and Darren's comments?&amp;nbsp; I want should really update that blog post to include it, if that is ok with both of you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And to put a bug into your ear.&amp;nbsp; I have recently been looking at 3D shape and I will have to see whether ArcMap includes the Z or M values when it does the dissolve ... consider two adjacent squares, square 1 has a Z value of 1.0, the second has a value of 1.1, they share edges, if turned into mulipart, is the Z (or M) considered...couldn't find anything on that, I know corners is OK.&lt;/P&gt;&lt;P&gt;if I finish that soon, I will post back here as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 00:27:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54918#M4325</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-02-28T00:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54919#M4326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fine with me, although I just copy/pasted from here: &lt;/P&gt;&lt;H1 style="margin-bottom: 0.2em; font-size: 22px; font-weight: normal; font-family: 'Avenir LT W01 55 Roman', Arial, Helvetica, sans-serif; color: #000000;"&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//01m600000066000000"&gt;Creating and editing multipart polygons&lt;/A&gt;&lt;/H1&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 00:50:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54919#M4326</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-02-28T00:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54920#M4327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hahaha .... but you see "editing" to me is on-screen digitizing etc...I never do it, so rarely check that section.&amp;nbsp; I think the reference should at the least be duplicated within the union etc sections and at least within the arcpy section...and I have noted it as such...So you will get kudos for bringing the jackass to water &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 00:54:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54920#M4327</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-02-28T00:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54921#M4328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/19932"&gt;Darren Wiens&lt;/A&gt; you are correct in that it isn't an ArcPy limitation.&amp;nbsp; In fact, it isn't even an ArcGIS or Esri limitation, per se.&amp;nbsp; The quote from the Help link you provide is basically Esri paraphrasing an OGC standard without attribution or providing the 'why' to the user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The OGC &lt;A href="http://www.opengeospatial.org/standards/sfa"&gt;Simple Feature Access - Part 1: Common Architecture &lt;/A&gt; document clearly states the "boundaries of any 2 Polygons that are elements of a MultiPolygon may not 'cross' and may touch at only a finite number of Points," i.e., parts of a multipart polygon can't share an edge.&amp;nbsp; MultiLineStrings can have shared lines or lines on top of each other.&amp;nbsp; The Esri Knowledge Base article &lt;A href="http://support.esri.com/cn/knowledgebase/techarticles/detail/24312"&gt;FAQ:&amp;nbsp; Why are polygon features grouped into multi-line string features by the ArcSDE sdegroup command?&lt;/A&gt; speaks to this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In short, the standard doesn't allow for it.&amp;nbsp; Esri implements the standard, and their way of staying compliant is to dissolve parts of multipart polygons that share edges.&amp;nbsp; Microsoft implements the standard as well, but their way of handling the situation in SQL Server is to let the user create an invalid polygon and then let it err out later when someone tries to work with the geometry.&amp;nbsp; Same standard, two different products, and two different ways of coping with a user creating an invalid multipart polygon.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 19:59:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54921#M4328</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-02-28T19:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create a multipart polygon with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54922#M4329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since the &lt;A href="http://www.opengeospatial.org/standards/sfa" rel="nofollow noopener noreferrer" target="_blank"&gt;OGC Simple Feature Access - Part 1: Common Architecture &lt;/A&gt;doesn't allow parts of a multipart polygon to share edges, what you are really after is either a geometry bag or geometry collection, neither of which are implemented in ArcPy.&amp;nbsp; Even if ArcPy implemented geometry bags, you still can't store them in a feature class because Esri doesn't have a geometry bag/collection type for feature classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you work outside of ArcGIS, in SQL Server for example, you can build and store a geometry collection.&amp;nbsp; Using your original example and a SQL Server workspace, you can see what I am speaking to:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

# a square
part = [[0,0],[0,1],[1,1],[1,0],[0,0]]

mp = ""
for x_shift in range(0,3):
&amp;nbsp;&amp;nbsp;&amp;nbsp; for y_shift in range(0,5):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_part = ", ".join(["{} {}".format(x+x_shift,y+y_shift) for [x,y] in part])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mp = "{}, POLYGON(({}))".format(mp, new_part)
mp = mp[2:]

sqlWS = #SQL Server or SQL Server Express SDE connection file
out_name = "test_pol_mp"

fc = arcpy.CreateFeatureclass_management(sqlWS, out_name, "POLYGON")
shape = arcpy.Describe(fc).shapeFieldName

sde_conn = arcpy.ArcSDESQLExecute(sqlWS)
sql = ("INSERT INTO {} ({}) "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "VALUES (\'GEOMETRYCOLLECTION({})\')".format(out_name, shape, mp))
sde_conn.execute(sql)

sql = ("SELECT [{}].STNumGeometries() AS partCount, "
&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; "[{}].STNumPoints() AS pointCount "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "FROM {}".format(shape, shape, out_name))
partCount, pointCount = sde_conn.execute(sql)[0]
print "Polygon partCount : {0}".format(partCount)&amp;nbsp; 
print "Polygon pointCount: {0}".format(pointCount)

#... Polygon partCount : 15
#... Polygon pointCount: 75&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Viewing the geometry collection in SQL Server Management Studio gives:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="geometrybag_sql_server_mgmt_studio.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/67071_geometrybag_sql_server_mgmt_studio.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Wheres trying to view it in ArcMap gives:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="geometrybag_arcmap_error.PNG" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/67072_geometrybag_arcmap_error.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:05:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-a-multipart-polygon-with-arcpy/m-p/54922#M4329</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-10T22:05:29Z</dc:date>
    </item>
  </channel>
</rss>

