<?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: Identifying and fixing irregular polygons in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419462#M32927</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like this...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="kn"&gt;import &lt;/SPAN&gt;&lt;SPAN class="nn"&gt;arcpy&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;RepairGeometry_management&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"c:/data/sketchy.shp"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as cited in this...&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/repair-geometry.htm" target="_blank"&gt;http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/repair-geometry.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(gotta love dev's sense of humor)&lt;/P&gt;&lt;P&gt;BUT&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;you would have to explode multiparts into singleparts (there is a tool for this)&lt;/LI&gt;&lt;LI&gt;any polygon pieces that share a common border will be dissolved into one (there is no work around)&lt;/LI&gt;&lt;LI&gt;in short...you will have to construct what you want from the pieces that are salvageable and ensure that the bad structure doesn't happen during construction in the first place&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:57:53 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-11T18:57:53Z</dc:date>
    <item>
      <title>Identifying and fixing irregular polygons</title>
      <link>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419460#M32925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a polygon data set where some of the polygons are irregular (mostly self-intersecting).&lt;/P&gt;&lt;P&gt;Here's an example of the irregular polygons that I have in the data set:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="123358" alt="polygons.png" class="image-1 jive-image" height="133" src="https://community.esri.com/legacyfs/online/123358_polygons.png" style="width: 290px; height: 133.306px;" width="290" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to write a Python program that will:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Identify that an input polygon is irregular; and then&lt;/LI&gt;&lt;LI&gt;Transform it into a set of regular polygons, i.e., break the irregular polygon into several regular polygons. A simple case is to break a figure "8" polygon into two "0" polygons.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have ArcGIS for Desktop and Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2015 10:54:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419460#M32925</guid>
      <dc:creator>SharonDagan</dc:creator>
      <dc:date>2015-08-22T10:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying and fixing irregular polygons</title>
      <link>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419461#M32926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sharon,&lt;/P&gt;&lt;P&gt;You might like to move this thread to &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/docs/DOC-2258"&gt;Moving Content&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2015 11:11:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419461#M32926</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2015-08-22T11:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying and fixing irregular polygons</title>
      <link>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419462#M32927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like this...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="kn"&gt;import &lt;/SPAN&gt;&lt;SPAN class="nn"&gt;arcpy&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;RepairGeometry_management&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"c:/data/sketchy.shp"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as cited in this...&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/repair-geometry.htm" target="_blank"&gt;http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/repair-geometry.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(gotta love dev's sense of humor)&lt;/P&gt;&lt;P&gt;BUT&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;you would have to explode multiparts into singleparts (there is a tool for this)&lt;/LI&gt;&lt;LI&gt;any polygon pieces that share a common border will be dissolved into one (there is no work around)&lt;/LI&gt;&lt;LI&gt;in short...you will have to construct what you want from the pieces that are salvageable and ensure that the bad structure doesn't happen during construction in the first place&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:57:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419462#M32927</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T18:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying and fixing irregular polygons</title>
      <link>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419463#M32928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sharon,&lt;/P&gt;&lt;P&gt;Is the layer already a polygon layer, or are they polylines/arcs?&amp;nbsp; If arcs, and have access to the Advanced (ArcInfo) level, you can use &lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/feature-to-polygon.htm" title="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/feature-to-polygon.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Feature To Polygon—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp; By default, it doesn't appear that the "preserve attributes" is working, at least not for me in 10.2.2.&amp;nbsp; However, there is an option to add attributes if associated with a point feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For testing, I created an set of arcs similar to what you showed.&amp;nbsp; I then&amp;nbsp; created a point FC (with new fields for attribute data) and added a point&amp;nbsp; to each of the polygonsl. I then ran the tool, and included the point field for the labels.&amp;nbsp; (First time I ran it, I still had the last point I added selected, so that was the only one copied...that is, make sure no points are selected when running....unless you want to limit it.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below are the input arcs, and points (labelled). The dialog box for the tool, and the polygons labelled.&amp;nbsp; Is this what you are trying to achieve?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" height="241" src="https://community.esri.com/legacyfs/online/123539_pastedImage_1.png" style="height: 241px; width: 402.435px;" width="402" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image" height="315" src="https://community.esri.com/legacyfs/online/123540_pastedImage_2.png" style="width: 394px; height: 315.01px;" width="394" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-3 jive-image" height="230" src="https://community.esri.com/legacyfs/online/123541_pastedImage_3.png" style="width: 401px; height: 229.605px;" width="401" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The python snippet is&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script
# The following inputs are layers or table views: "badPolyLabelsPts"
arcpy.FeatureToPolygon_management(in_features="testArcs",out_feature_class="C:/Users/Owner/Documents/ArcGIS/Default.gdb/badPolys5",cluster_tolerance="#",attributes="ATTRIBUTES",label_features="badPolyLabelsPts")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:57:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419463#M32928</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-11T18:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying and fixing irregular polygons</title>
      <link>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419464#M32929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;Hi Sharon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;Adding to Dan post there is a Multipart to Single part tool under data management -&amp;gt; features&lt;/P&gt;&lt;P style="text-align: left;"&gt;Sometimes you want to keep this polygon as one multipart polygon since the attributes are the same for all polygons.&lt;/P&gt;&lt;P style="text-align: left;"&gt;Self-intersecting polygons are not allowed in geodatabase but multipart polygons are fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;Keep in touch&lt;/P&gt;&lt;P style="text-align: left;"&gt;Mody&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Aug 2015 04:55:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419464#M32929</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2015-08-23T04:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying and fixing irregular polygons</title>
      <link>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419465#M32930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I gave up on dealing with invalid/irregular polygons in ArcPy, or really even ArcGIS, a few years back.&amp;nbsp; I kept running into polygons that were invalid but the standard Esri tools couldn't identify them.&amp;nbsp; Eventually, I threw in the towel and now use Safe Software's FME product to do my polygon validation when I run into problems.&amp;nbsp; When access to FME isn't available, I sometimes convert ArcPy Polygon objects to Shapely or GeoDjango geometries to find invalid polygons.&amp;nbsp; It is all a bit kludgy, but I got tired of fighting with Check Geometry and Repair Geometry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2015 14:07:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/identifying-and-fixing-irregular-polygons/m-p/419465#M32930</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-08-24T14:07:40Z</dc:date>
    </item>
  </channel>
</rss>

