<?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: How to code Lines to polygon? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491289#M38453</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks for the suggestion. Actually I need the function in an arcpy appliction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Jul 2016 23:44:37 GMT</pubDate>
    <dc:creator>TieshengWu</dc:creator>
    <dc:date>2016-07-26T23:44:37Z</dc:date>
    <item>
      <title>How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491282#M38446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all I want to convert lines feature that is directioned at random to polygons by python script, but my arcmap has no a license of 'feature to polygon'. How to realize it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 23:31:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491282#M38446</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2016-07-25T23:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491283#M38447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;are you familiar with ... &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/python/writing-geometries.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/python/writing-geometries.htm"&gt;Writing geometries—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;and insertcursors? do you have a way of orientating your polylines so that they connect? or are they disconnected and you wish to get a bounding container from the features?&amp;nbsp; Perhaps an image of what you are working with might help, and a statement of your python and arcpy knowledge&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 23:41:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491283#M38447</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-07-25T23:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491284#M38448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for&amp;nbsp; your reply. What i want is&amp;nbsp; to make a code run at standard arcmap version which using&amp;nbsp; a simple script&amp;nbsp;&amp;nbsp; 'feature to polygon' or 'split polygon by lines '&amp;nbsp; that make things perfectly at a advanced version.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 01:12:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491284#M38448</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2016-07-26T01:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491285#M38449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand your request, but the remaining questions in my post need to be answered.&amp;nbsp; Replicating the functionality of tools that are only available at an advanced license level is not simple... otherwise they would be available at the lower level already.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 02:40:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491285#M38449</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-07-26T02:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491286#M38450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have worked on a toolbox with functionality that is normally available with the Advanced license level only to make it available at a Basic license. However, the tool to convert unstructured lines to polygons, creating intersections, etc, is one of the tools that I will not even try to implement. As Dan mentions, this tool is very complex and not easy to implement with arcpy and only the Basic license level. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 03:42:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491286#M38450</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-07-26T03:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491287#M38451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all. Now I know it's not easy to work out&amp;nbsp; a general arcpy codes for 'lines to polygon' , and now try to use POLYGON method to construct polygons from theose structured points array directly， rather than construct lines at first, then convert this line feature to polygons.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 09:12:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491287#M38451</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2016-07-26T09:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491288#M38452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are also third party tools like ETGeowizards and Xtools that have this sort of functionality. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 21:01:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491288#M38452</guid>
      <dc:creator>GrantHerbert</dc:creator>
      <dc:date>2016-07-26T21:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491289#M38453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks for the suggestion. Actually I need the function in an arcpy appliction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 23:44:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491289#M38453</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2016-07-26T23:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491290#M38454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post an example of some lines that you wish to convert to polygons, just to see how complex the situation is? If not too complex, there are ways to do this with arcpy and a Basic license.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 01:22:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491290#M38454</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-07-27T01:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491291#M38455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have many balls must be divided by the red lines of varied oriented. In my original codes, construct balls and lines in memory at first, then copy them as polygon feature and line feature seperately, 'arcpy.FeatureToPolygon_management([balls,lines],"in_memory")' finally.&amp;nbsp; It's simple. Don't care where and how the lines intersect with balls. But need advanced license.&lt;/P&gt;&lt;P&gt;With POLYGON method, may be the intersect or the nearest points between lines, lines and ball,&amp;nbsp; must be got, then regroup these&amp;nbsp; point arrays to form polygons. Don't have idea yet about what's the best way to get the 'intersect' points (all the geometries are constructed from points, they may have no common point) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="213318" alt="ball.JPG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/213318_ball.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 07:46:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491291#M38455</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2016-07-27T07:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491292#M38456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try the minimum area bounding circle in &lt;A href="http://www.arcgis.com/home/item.html?id=564e2949763943e3b9fb4240bab0ca2f"&gt;Bounding containers&lt;/A&gt; with the cavaet that the crossed line pairs can be identified by an attribute in your table.&amp;nbsp; In other words, your 6 lines need to be grouped into 3 pairs, each pair being found in/crossing one circle.&amp;nbsp; If your data structure is different, you will still need to be able to associate the 2 lines or the 4 points that form each circle.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 07:53:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491292#M38456</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-07-27T07:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491293#M38457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post a sample of the data (some ball polygons and intersecting lines)? You could select for each ball the intersecting lines and split the polygon with the lines (if the intersecting lines are just 2 lines, not 4). This could work, but I should have a look at a small sample of the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 11:21:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491293#M38457</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-07-27T11:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491294#M38458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Dan and Xander so much. The file of sample data as attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 15:36:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491294#M38458</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2016-07-27T15:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491295#M38459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Juts did a little proof of concept with a single pie and 2 faults:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
def main():
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_pie = r'D:\Temp\test\data.gdb\focal_sml_pie'&amp;nbsp; # single polygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_faults = r'D:\Temp\test\data.gdb\focal_sml_faults'&amp;nbsp; # 2 lines in single polygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_result = r'D:\Temp\test\data.gdb\test01'

&amp;nbsp;&amp;nbsp;&amp;nbsp; polygon = arcpy.da.SearchCursor(fc_pie, ('SHAPE@')).next()[0]

&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_polygons = [polygon]
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(fc_faults, ('SHAPE@')) as curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyline = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_polygons = splitPolygon(lst_polygons, polyline)

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(lst_polygons, fc_result)

def splitPolygon(lst_polygons, polyline):
&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_pols = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; for polygon in lst_polygons:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_pols += polygon.cut(polyline)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except Exception as e:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Error:", e
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; return lst_pols

if __name__ == '__main__':
&amp;nbsp;&amp;nbsp;&amp;nbsp; main()&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this resulted in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/213312_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea would be to loop through the pies, select the faults corresponding to the pie (select by location) and split the polygons. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:37:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491295#M38459</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T21:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491296#M38460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And here is the code to cut all the pie polygons with the fault polylines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

def main():
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_pie = r'C:\GeoNet\SplitBalls\shp\focal_sml_pie.shp'
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_faults = r'C:\GeoNet\SplitBalls\shp\focal_sml_faults.shp'
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_result = r'C:\GeoNet\SplitBalls\shp\pie_pieces01.shp'

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.overwriteOutput = True

&amp;nbsp;&amp;nbsp;&amp;nbsp; # create dct with faults
&amp;nbsp;&amp;nbsp;&amp;nbsp; dct_faults = {r[0]: r[1] for r in arcpy.da.SearchCursor(fc_faults, ('OID@', 'SHAPE@'))}

&amp;nbsp;&amp;nbsp;&amp;nbsp; # loop through pie polygons
&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_polygons = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(fc_pie, ('SHAPE@')) as curs_pie:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row_pie in curs_pie:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polygon = row_pie[0]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # get list of faults for current pie
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_faults_pie = getFaults(polygon, dct_faults.values())

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # cut pie based on faults
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_polygons_pie = [polygon]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fault in lst_faults_pie:
&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;&amp;nbsp;&amp;nbsp; lst_polygons_pie = splitPolygon(lst_polygons_pie, fault)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # add polygons to list
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_polygons.extend(lst_polygons_pie)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # write the pie pieces to a new featureclass
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(lst_polygons, fc_result)


def getFaults(polygon, lst_faults):
&amp;nbsp;&amp;nbsp;&amp;nbsp; '''Get list of fault polylines for pie polygon'''
&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_faults_pie = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; for fault in lst_faults:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mid_pnt = fault.positionAlongLine(0.5, True)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if polygon.contains(mid_pnt):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_faults_pie.append(fault)
&amp;nbsp;&amp;nbsp;&amp;nbsp; return lst_faults_pie


def splitPolygon(lst_polygons, polyline):
&amp;nbsp;&amp;nbsp;&amp;nbsp; '''split pie polygon with fault polyline'''
&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_pols = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; for polygon in lst_polygons:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_pols += polygon.cut(polyline)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except Exception as e:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Error:", e
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
&amp;nbsp;&amp;nbsp;&amp;nbsp; return lst_pols


if __name__ == '__main__':
&amp;nbsp;&amp;nbsp;&amp;nbsp; main()&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also find attached the resulting shapefile.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:37:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491296#M38460</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T21:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to code Lines to polygon?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491297#M38461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you a lot.&amp;nbsp; It solve my problem. The only limitation is that it needs a 10.2 above version, but it's enough for me cause my platform is 10.3 Standard.&lt;/P&gt;&lt;P&gt;Thank you again. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 23:19:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-code-lines-to-polygon/m-p/491297#M38461</guid>
      <dc:creator>TieshengWu</dc:creator>
      <dc:date>2016-07-27T23:19:35Z</dc:date>
    </item>
  </channel>
</rss>

