Error On ArcPy Merge

2821
2
Jump to solution
08-19-2015 11:44 PM
BruceGreen
New Contributor III

Using ArcGIS 10.2 Desktop I am trying to run a Merge function by Arcpy as

    # Set environment settings

    env.workspace = "E:\\GIS\\ROR"

   

    path = "E:\\GIS\\Data\\"

    featureClass = "band-tailed_pigeon.shp"

    InputFeature = path + featureClass

    FinaloutLocation = "E:\\GIS\\Data\\Final"

    dissolve_1 = "dissolved_1.shp"

    dissolve_2 = "dissolved_2.shp"

    dissolve_3 = "dissolved_3.shp"

    dissolve_4 = "dissolved_4.shp"

    dissolve_5 = "dissolved_5.shp"

    # Process: Merge

    inFeaturesToMerge = [dissolve_1,dissolve_2,dissolve_3,dissolve_4,dissolve_5]

    arcpy.Merge_management(inFeaturesToMerge, FinaloutLocation)

but I am getting this error:

    ExecuteError: Failed to execute. Parameters are not valid.

    ERROR 000725: Output Dataset: Dataset E:\GIS\Data\Final already exists.

Can you please let me know why this is happening?

Thanks

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
NeilAyres
MVP Alum

Well, FinaloutLocation = "E:\\GIS\\Data\\Final", is just that, a file location, not the name of a feature class in a gdb or a shapefile name.

Why are you defining input feature names then do nothing with them.

And please search for a read how to post code here.

View solution in original post

0 Kudos
2 Replies
NeilAyres
MVP Alum

Well, FinaloutLocation = "E:\\GIS\\Data\\Final", is just that, a file location, not the name of a feature class in a gdb or a shapefile name.

Why are you defining input feature names then do nothing with them.

And please search for a read how to post code here.

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

Link for Posting Code blocks in the new GeoNet​  as mentioned by Neil.

0 Kudos