<?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: Divide a polygon from a fix point in edge of polygon in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/divide-a-polygon-from-a-fix-point-in-edge-of/m-p/1110131#M47035</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;&amp;nbsp;&amp;amp; &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/147857"&gt;@Scott_Harris&lt;/a&gt;&amp;nbsp;Yes, exactly, that’s the problem. Divide is excellent tool but I cannot add a point. I know is something very special that I ask.&lt;/P&gt;&lt;P&gt;And I think the Python is the answer.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;I will give a try and I will come again back if works or not.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Thank you so much&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;for&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;your response guys&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Oct 2021 06:38:53 GMT</pubDate>
    <dc:creator>VassilisTrigkas1974</dc:creator>
    <dc:date>2021-10-22T06:38:53Z</dc:date>
    <item>
      <title>Divide a polygon from a fix point in edge of polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/divide-a-polygon-from-a-fix-point-in-edge-of/m-p/1109615#M46967</link>
      <description>&lt;P&gt;I try to divide a polygon into two straight polygons using a fixed point on one side.&lt;BR /&gt;The fixed point is where the dividing line will start and end at the opposite side of the polygon. The only condition is that the two new polygons should be the same in area.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 10:44:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/divide-a-polygon-from-a-fix-point-in-edge-of/m-p/1109615#M46967</guid>
      <dc:creator>VassilisTrigkas1974</dc:creator>
      <dc:date>2021-10-21T10:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Divide a polygon from a fix point in edge of polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/divide-a-polygon-from-a-fix-point-in-edge-of/m-p/1109635#M46971</link>
      <description>&lt;P&gt;In Pro (so I hope in arcmap), you can subdivide by area, but there is no mention of specifying a starting point&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/subdivide-polygon.htm" target="_blank"&gt;Subdivide Polygon (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 11:36:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/divide-a-polygon-from-a-fix-point-in-edge-of/m-p/1109635#M46971</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-10-21T11:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Divide a polygon from a fix point in edge of polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/divide-a-polygon-from-a-fix-point-in-edge-of/m-p/1109664#M46973</link>
      <description>&lt;P&gt;Hi&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/413408"&gt;@VassilisTrigkas1974&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not clear on the requirement, but did you try the Divide tool found on the modify features pane?&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/editing/divide-a-polygon-by-a-value.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/editing/divide-a-polygon-by-a-value.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you already know where the start and endpoints of the splitting line need to be, why won't Split work (also found on the modify features pane)?&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/editing/split-a-feature.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/editing/split-a-feature.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-Scott&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 13:01:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/divide-a-polygon-from-a-fix-point-in-edge-of/m-p/1109664#M46973</guid>
      <dc:creator>Scott_Harris</dc:creator>
      <dc:date>2021-10-21T13:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Divide a polygon from a fix point in edge of polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/divide-a-polygon-from-a-fix-point-in-edge-of/m-p/1109741#M46980</link>
      <description>&lt;P&gt;So one point of the cutting line is defined and it should cut the polygon into equal areas. I doubt there's a tool for that (though I could be wrong).&lt;/P&gt;&lt;P&gt;This seems like a job for Python, so I took a stab at it. I can get it to work with very small relative differences between the polygon parts, but the computation time is still quite high...&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import datetime
def cut_equally(polygon, point, max_increment=1, rel_err=0.01):
    """Cuts a polygon into equal parts, with one point of the cutting line predefined.

    Returns a list of arcpy.PolygonGeometry, or an empty list if the target error
    is too small or the maximum increment too big.
    
    How it works:
    1.) Create a buffer around the point, create a 1-dimensional intersection
    of that buffer with the polygon.
    1.a) If there is no such intersection, the buffer is too big, return an empty list.
    2.) For each of the intersection of polygon and buffer, create a line between
    that intersection and the point and cut the polygon.
    3.) Calculate the relative error with
    rel_err = abs(1 - area_1/area_2)
    3.a) If rel_err is smaller than the target error, return the cut polygons.
    4.) Increase the buffer distance. Small target errors need a very small
    increment, which affects computing time massively. To alleviate that, the
    increment is dynamic: it is the maximum of the current relative error and
    a specified value.
    5.) Repeat.
    
    polygon: arcpy.PolygonGeometry, the polygon to be cut
    point: arcpy.Point or arcpy.PointGeometry, the start point of the cutting line, must be on the polygon's edge
    max_increment: the maximum increment to the buffer distance (see step 4)
    rel_err: the target relative error (see step 3)

    """
    # change point to point geometry
    if not isinstance(point, arcpy.PointGeometry):
        point = arcpy.PointGeometry(point)
    # set start values for dist and curr_rel_err
    dist = max_increment
    curr_rel_err = max_increment
    # loop
    start_time = datetime.datetime.now()
    while True:
        # create a buffer and intersect with the polygon
        point_buffer = point.buffer(dist)
        intersect_points = polygon.intersect(point_buffer, 1)
        # no intersection means the buffer is too big, return an empty list
        if len(intersect_points) == 0:
            print("Could not cut the polygon with the specified parameters.")
            return []
        for ip in intersect_points:
            # create the cutting line
            cut_line = arcpy.Polyline(arcpy.Array([point.firstPoint, ip]))
            try:
                # cut
                poly_cuts = polygon.cut(cut_line)
                # get the relative error
                curr_rel_err = abs(1 - poly_cuts[0].area/poly_cuts[1].area)
                # return if target error is met
                if curr_rel_err &amp;lt;= rel_err:
                    print("area_1: {}, area_2: {}, rel_err: {}, time: {} seconds".format(int(poly_cuts[0].area), int(poly_cuts[1].area), curr_rel_err, (datetime.datetime.now() - start_time).seconds))
                    return poly_cuts
            # these errors occur when the buffer is too small, ignore them
            except (RuntimeError, ZeroDivisionError):
                pass
        # increase the buffer distance
        dist += min(curr_rel_err, max_increment)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1634829219838.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/25745iCE9F60329B7BF288/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1634829219838.png" alt="JohannesLindner_0-1634829219838.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1634829316596.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/25746iFFC981AD9FC7DA5D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1634829316596.png" alt="JohannesLindner_1-1634829316596.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 15:18:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/divide-a-polygon-from-a-fix-point-in-edge-of/m-p/1109741#M46980</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-10-21T15:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Divide a polygon from a fix point in edge of polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/divide-a-polygon-from-a-fix-point-in-edge-of/m-p/1110131#M47035</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;&amp;nbsp;&amp;amp; &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/147857"&gt;@Scott_Harris&lt;/a&gt;&amp;nbsp;Yes, exactly, that’s the problem. Divide is excellent tool but I cannot add a point. I know is something very special that I ask.&lt;/P&gt;&lt;P&gt;And I think the Python is the answer.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;I will give a try and I will come again back if works or not.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Thank you so much&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;for&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;your response guys&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 06:38:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/divide-a-polygon-from-a-fix-point-in-edge-of/m-p/1110131#M47035</guid>
      <dc:creator>VassilisTrigkas1974</dc:creator>
      <dc:date>2021-10-22T06:38:53Z</dc:date>
    </item>
  </channel>
</rss>

