Feature to polygon does not retain field from polyline

49 views Asked by At

Hello I am new with Arcpy. I have a polyline feature class and I used Feature to polygon for making polygon feature class.It works but it does not retain all fields from the polyline feature class.

As the result below of polygon feature class does not contain Polygon_ID. I do not know how to solve this issue. Thank you

#polyline feature class https://i.stack.imgur.com/y7nzG.png

#code convert polyline to polygon
import arcpy
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"D:\LPA\SourceXY\Default.gdb"
arcpy.FeatureToPolygon_management("polygon_line","polygon","", "ATTRIBUTES")

print("\nScript Completed")

#polygon feature class https://i.stack.imgur.com/PDOUS.png

1

There are 1 answers

0
anyryg On

The Preserve attributes parameter is no longer supported and does not work when using the Feature to Polygon tool, but here is a workaround