I have multiple shapefiles in a folder which I am trying to compare with same named features in geodatabase. I want to first clip them within a polygon and then copy and overwrite the features in the geodatabase. My script is currently skipping the if statement (no geoprocessing) and printing the else statement.
shpName = arcpy.Describe(shpFile).baseNamefeatureName = arcpy.Describe(geoPath).baseNameoutFc = ""# Count the number of shapefiles clippedcount1 = 0# Count the number of feature classes being copiedcount2 = 0try: # Loop through shapefiles and clip to NRM region for shp in shpFile: if shpName == featureName: arcpy.AddMessage(shpFile) arcpy.Clip_analysis (shpFile, clipRegion, outFc, "", "", "") count1 += 1 # Copy clipped shapefile into file geodatabase arcpy.FeatureClassToFeatureClass_conversion(outFc, geoPath + "\\" + shpName) count1 += 1 else: arcpy.AddMessage("Error: Shapefile/s not clipped and copied to file geodatabase ")
أكثر...
shpName = arcpy.Describe(shpFile).baseNamefeatureName = arcpy.Describe(geoPath).baseNameoutFc = ""# Count the number of shapefiles clippedcount1 = 0# Count the number of feature classes being copiedcount2 = 0try: # Loop through shapefiles and clip to NRM region for shp in shpFile: if shpName == featureName: arcpy.AddMessage(shpFile) arcpy.Clip_analysis (shpFile, clipRegion, outFc, "", "", "") count1 += 1 # Copy clipped shapefile into file geodatabase arcpy.FeatureClassToFeatureClass_conversion(outFc, geoPath + "\\" + shpName) count1 += 1 else: arcpy.AddMessage("Error: Shapefile/s not clipped and copied to file geodatabase ")
أكثر...