AnsweredAssumed Answered

Need to clip features from multiple workspaces and save these into sub-folders

Question asked by mitun.talapatra_1987 on Sep 20, 2017
Latest reply on Sep 25, 2017 by jskinner-esristaff

I have created following script to Clip Features from multiple workspaces using ListWorkspace:

import arcpy, os, sys
reload(sys)
sys.setdefaultencoding('utf8')

out_ws = r"K:\GIS-Projekte\Service_für_Gemeinden\Ausgabe\Alfdorf\Ausschnitt Daten"
clip = r"K:\GIS-Projekte\Service_für_Gemeinden\Ausgabe\Alfdorf\Ausschnitt\Alfdorf.shp"
arcpy.env.workspace = r"K:\GIS-Projekte\Service_für_Gemeinden\Ausgangsdaten"
listWS = arcpy.ListWorkspaces()
for ws in listWS:
    arcpy.env.workspace = ws
    listFC = arcpy.ListFeatureClasses()
    print("in loop 1")
    for fc in listFC:
        name = os.path.basename(fc)
        arcpy.Clip_analysis(fc, clip, out_ws + '\\' + name)
        print("in loop 1")

 

Problems:

1. I Need to save the clipped Features into sub-Folders like the Input Workspace. I don't know how?

2. Is there any possibilities to create check-box so that I can select certain Folders from the Input ListWorkspaces?

Outcomes