AnsweredAssumed Answered

read Geometry pass to insert cursor

Question asked by jay.kapalczynski on Mar 25, 2020
Latest reply on Mar 26, 2020 by jay.kapalczynski

I am trying to read a FC geometry which has one record in it

Grab this geometry and use it in an INSERT cursor with specific attributes

 

Think I am close but cant get the geometry of the FCs feature...the FC has only one....

 

geometries = arcpy.CopyFeatures_management('Counties_3_dissolved', arcpy.Geometry())
length = sum([g.length for g in geometries])
print('Total length: {}'.format(length))

arcpy.env.overwriteOutput = True


# Create a feature class
result1 = arcpy.management.CreateFeatureclass(
    arcpy.env.scratchGDB,
    "esri_square", "POLYGON", spatial_reference=26917)
feature_class = result1[0]

inputFeatureclass = "C:\Data\SelectCounties.gdb\Counties_4_final_append"
# Write feature to new feature class
with arcpy.da.InsertCursor(inputFeatureclass, ['SHAPE@', 'ADDRESS', 'DISTANCE', 'UNIQUEID', 'COUNTYLIST']) as cursor:
    cursor.insertRow([geometries, searchAddress, searchDistance, searchid, txt_list])

# Delete cursor object
del cursor

Outcomes