0

I have 5 fairly large Feature Classes with identical fields but different attribute data which I have been trying to merge/append together unsuccessfully.

When using merge_management the process runs successfully, but I am left with a feature class with many new fields created for each of the 5 feature classes (e.g. name1, name12, name123, name1234).

I really need to just retain the name field and add to it rather than creating new fields for the imported Series').

When I attempt to append rather than merge the operation fails with an

ExecuteError: Failed to execute. Parameters are not valid. ERROR 000735: Input Datasets: Value is required Failed to execute (Append).

Find my code below:

(For Merging attempt)

arcpy.env.workspace = r"D:/some.gdb"

fc_list = arcpy.ListFeatureClasses()


fc_list = [x for x in fc_list if "Pymade" in x]

print("Feature classes to join: " + str(fc_list))
print("Joining borough FCs into final output")
arcpy.Merge_management(fc_list, "MapPlutoAllBoro_{0}".format(today))

(For Appending attempt)

arcpy.env.workspace = r"D:/some.gdb"

arcpy.CreateFeatureclass_management(r"D:/some.gdb", "MapPlutoAllBoro_{0}".format(today))

fc_list = arcpy.ListFeatureClasses()

fc_list = [x for x in fc_list if "Pymade" in x]

print("Feature classes to join: " + str(fc_list))
print("Joining borough FCs into final output")
arcpy.Append_management(fc_list, "MapPlutoAllBoro_{0}".format(today))
  • When you run arcpy.CreateFeatureclass for Append, supply a FC name such as fc_list[0] as the 4th parameter, this will define the fields. – klewis Oct 30 '18 at 21:19
  • 1
    Please include the output of those print statements, and your full error message including its line number. – PolyGeo Oct 30 '18 at 21:22
  • It sounds like you need to look at a field FieldMappings object resources.arcgis.com/en/help/main/10.2/index.html#//… to merge your name fields into one field, this is supplied as the 3rd parameter in the arcpy.Merge_management tool. – Michael Stimson Oct 31 '18 at 5:20
0

In case your feature classes have different field names or types I would recommend to use NO_TEST parameter in Append tool.

You may try

arcpy.Append_management(fc_list, "MapPlutoAllBoro_{0}".format(today), schema_type = 'NO_TEST')

However, it doesn't prevent cases when geometries of all the feature classes are not the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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