Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm not sure why I'm running into this problem. I thought it might have something to do with the merged file being locked or open, but I don't see a "LOCK" file being created in Windows Explorer.

I'm simply trying to Merge a bunch of files and then Dissolve the merged file. Here's my script:

workspaces = arcpy.ListWorkspaces("*", "Folder")
for workspace in workspaces:

    arcpy.env.workspace = workspace
    shps = arcpy.ListFeatureClasses("*", "ALL")

    ## Process: Merge Layers
    descWorkspace = arcpy.Describe(workspace)
    workspaceName = descWorkspace.baseName

    mergeOutput = workspaceName+"_merge"
    arcpy.Merge_management(shps, mergeOutput)

    ## Process: Dissolving Features              <--HERE IS WHERE I'M HAVING PROBLEMS
    disInput = mergeOutput
    disOutput = mergeOutput+"_dis"
    arcpy.Dissolve_management(disInput, disOutput)

This is the error that I'm getting after the merge runs successfully: ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset Bus04_merge does not exist or is not supported

I'm obviously missing a step here... (or using incorrect parameters, but I can't figure out in what way) Thanks for your help!

share|improve this question
1  
What happens when you print shps? Is the list of shapefiles in "workspace" displayed? –  Aaron Jan 5 '13 at 19:24
add comment

1 Answer

up vote 1 down vote accepted

Try changing the following line in your code:

mergeOutput = workspaceName+"_merge"

into:

mergeOutput = workspaceName+"_merge.shp"

Thanks,

meryloo

share|improve this answer
    
I ended up rewriting much of the code, so I can't try that out exactly, BUT, I think ultimately I did realize that changing that to .shp DID help, so great suggestion. Thank you!! –  Kristen G. Jan 5 '13 at 22:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.