arcpy.clip analysis not working

المشرف العام

Administrator
طاقم الإدارة
Following on from previous question Python code that uses arcpy.describe skips if statement?, I have now attempted to include clip analysis and this is my result;



I am confused as to what is happening, as I am using .bdyseg.shp which is also in the file geodatabase for comparison and updating. Here is my code with the clip analysis in it;

try: for thisFC in arcpy.ListFeatureClasses(): thisName,thisExt = os.path.splitext(thisFC) # get the shapefile name without extension (base name) if WSdict.has_key(thisName.lower()): # the shapefile is found in the database.. shpFull = os.path.join(InShpFolder,thisFC)# full path of shape file gdbFull = WSdict[thisName.lower()] # get the path from the dictionary arcpy.AddMessage(shpFile) arcpy.Clip_analysis(InShpFolder, clipRegion, outFc, "", "", "") count1 += 1 # Copy clipped shapefile into file geodatabase arcpy.FeatureClassToFeatureClass_conversion(outFc, InGDB + InShpFolder) count1 += 1 else: arcpy.AddMessage("Error: Shapefile/s not clipped and copied to file geodatabase ")# Print message for shapefile name clipped arcpy.AddMessage("\n" "The above {0} shapefiles have been clipped to: {1} and saved in {2}" "\n".format(count1, InShpFolder, InGDB))# Return any errors except: arcpy.AddMessage(arcpy.GetMessages())Thanks for any assistance!!!



أكثر...
 
أعلى