Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Merge Script

$
0
0
Does this python script look correct for a merge?

Code:

# Import arcpy module
import arcpy, sys, traceback
arcpy.env.overwriteOutput = True
from os import path as p

 # Set Workspace
arcpy.env.workspace = r"G:\ChrisGIS\PS_Steelhead\Archive"

# Set Variables. "out" will be our output variable. Inside the "Try" loop we search all workspaces
# for the Feature Class we are interested in. This list of feature classes is set to listFCS

out = r"G:\ChrisGIS\PS_Steelhead\Scratch"

for ws in arcpy.Listworkspaces("*", "FileGDB"):
        arcpy.env.workspace = ws
        print '\n\Searching in %s\n\n' %ws
        listFCS = arcpy.ListFeatureClasses("*_NWIFC_STHD")

# Now Merge all Feature Classes and export to the Output

arcpy.Merge_management(listFCS, os.path.join(out, "Merged_HUC8_STHD")
print "Done"


Viewing all articles
Browse latest Browse all 2485

Trending Articles