Overlapping Polylines to Overlapping Polygons

310
1
03-13-2018 05:01 PM
ChelseaKarthauser
New Contributor

I am writing a script that begins with a polyline feature class. The polylines represent the outlines of images from a flight path, so they are overlapping considerably. I take several steps to convert these image outlines into a single polygon feature class that maintains each image footprint and their overlap.

Here are the steps in my current script:

   #Split polyline feature by attributes into separate FCs

   #This results in one feature class per polyline feature
   arcpy.SplitByAttributes_analysis("Polylines", GDB, "Image")

   #Create a list of all polyline FCs
   Polyline_List = arcpy.ListFeatureClasses("image*")

   #Use a for loop to work with FC list; convert all polylines to polygons

   #This results in one feature class per polygon feature

   for FC in Polyline_List:
      output = FC.replace("image","poly")
      arcpy.FeatureToPolygon_management (FC, output)
      arcpy.Delete_management(FC)

   #Create FC list of all polygons FCs; use list to merge polygons into single FC
   Polygon_List = arcpy.ListFeatureClasses("poly*")
   arcpy.Merge_management(Polygon_List,"All_Polygons")

   #Join Polygon FC to Polyline FC to transfer attribute information
   arcpy.AddJoin_management("All_Polygons","OBJECTID","Polylines","OBJECTID")

   #Export Polygon FC to make joined data permanent
   arcpy.FeatureClassToFeatureClass_conversion("All_polygons",GDB,"Polygons")

I know that there are several custom tools out there that will accomplish this, but I would like to learn how to do this in my own script. Some of my polyline datasets are 350+ images, and exporting out each polyline and then converting each one separately takes forever. There must be an easier way! I'll also add that I used each image's corner coordinates to create the closed polylines. If there is a way to jump right from the corner coordinates to one polygon feature class, that would be even better!

Below is a link to an old thread addressing this problem:

How to convert overlapping polylines to overlapping polygons 

Thanks!

0 Kudos
1 Reply
ChelseaKarthauser
New Contributor

In my original question, I needed a way to process quickly through point data that represented corner coordinates of overlapping images from a flight path. I wanted to create a single polygon feature class containing all of the image "footprints."

I figured this out using geometries and insert cursor. The workflow is much simpler and faster that the original workflow.

The .py file is also attached

0 Kudos