Polygon Feature Class From Lines(Python)

2587
9
05-22-2017 09:38 PM
SibghatUllah1
Occasional Contributor

is it possible to create Polygon Feature class from Lines through python code?

0 Kudos
9 Replies
DanPatterson_Retired
MVP Emeritus

Do you mean feature-to-polygon (your link isn't working)?  This would require an advanced license.  If you are looking to recreate that functionality from scratch there are not posted solutions that emulate it for all cases given the rule set to construct polygons from lower geometries in all cases.  

Do you have a particular use case that you want to perform that is easier like a convex hull?  Perhaps you need to provide an example of what you need to do.

0 Kudos
FC_Basson
MVP Regular Contributor
SibghatUllah1
Occasional Contributor
0 Kudos
DanPatterson_Retired
MVP Emeritus

Thanks fcbassongis‌ .   Sibghat, if you are looking to do this in python... ie in pure python... I would recommend the suggestions in your originating thread

0 Kudos
SibghatUllah1
Occasional Contributor

Dear Dan Patters,

construct polygon using advanced editing tool or 

 any python code or help is highly appreciated.
0 Kudos
DanPatterson_Retired
MVP Emeritus

To recreate their functionality? I have none (that would be simple in any event)

0 Kudos
FC_Basson
MVP Regular Contributor

Maybe not the best ArcGIS answer, but if you have no other option you should look at the QGIS Polygonize tool, which can be found in the Processing Toolbox - won't work with Esri Feature Classes of course, but it's free .

0 Kudos
SibghatUllah1
Occasional Contributor

Dear FC,

I have created a new python addin containg  3 buttons.first  my script runs to convert lines ,Construct polygon tool and then spatial join script.

Can you just tell me where Construct polygon toois located in arcgis folder??so that i can run that tool in button 1 script.

0 Kudos
FC_Basson
MVP Regular Contributor

No idea.  Why don't you just customize your menu and add the button from the Commands list?

0 Kudos