AnsweredAssumed Answered

ArcPy - Python script and list of features in FGDB

Question asked by drhartel_agol on Apr 1, 2019
Latest reply on Apr 3, 2019 by drhartel_agol

I'm trying to run a Python script to merge all polygon features in a single file geodatabase but my ListFeatureClasses function doesn't appear to be returning any FC names!

See attached with screen shots and code

import arcpy

import os

 

# This will be the list of polygon features to merge

listFC = []

 

# Set the workspace to state CoreLogic FGDB

arcpy.env.workspace = r"L:\SRS_Heirs_29Mar19\20190310_R8_HeirsProperty_AL_CoreLogicParcelsMods_SRS4952.gdb"

 

# Set output FGDB

outputFGDB = r"D:\Documents\ArcGIS\Projects\SRS4952_Heirs\SRS4952_Heirs.gdb"

 

# Set output FGDB and new merged FC

mergedFC = os.path.join(outputFGDB, "CL_AL_ParcelsArea")

 

# Get list of polygon feature classes in FGDB

listFC = arcpy.ListFeatureClasses(feature_type='Polygon')

 

# Now merge

print ("Starting merge now...")

arcpy.Merge_management(inputs=listFC, output=mergedFC)

 

print("Finished polygon merge...")

ListFeatureClasses is not returning any polygon feature classes (there are about 100 in the FGDB)

All polygon features have the same data schema

Outcomes