2

I am trying to migrate a dataset from one fileGDB to another using the Append tool.

When running a few features get copied over however the rest get the following error:

“WARNING 000594”: Input feature #: Unexpected operation”

  • Same spatial reference.

To be clear this is an issue with the append tool as it does not work even if being run manually with the tool. I have also tried playing around with the following setting with no luck:

arcpy.env.overwriteOutput = True
arcpy.env.outputMFlag = "Same As Input"
arcpy.env.outputZFlag = "Same As Input"
#arcpy.env.XYDomain = "-180 -90 180 90"
arcpy.env.extent = "MAXOF"


# SPATIAL REFERENCE
# 26918 = UTM NAD83 ZONE 18N
spatial_ref = arcpy.SpatialReference(26918)
arcpy.env.inputCoordinateSystem = spatial_ref
arcpy.env.outputCoordinateSystem = spatial_ref
#arcpy.env.geographicTransformations = "NAD_1927_To_NAD_1983_NADCON"

# XY Tolerance
arcpy.env.XYResolution = 0.000001

def get_field_mappings(fc_in, dictionary):
field_mappings = arcpy.FieldMappings()
field_mappings.addTable(fc_in)
print ("\nField Mapping: {0}\n".format(fc_in))

for input, output in dictionary.iteritems():
    print 'Field Map: "{0}" -> "{1}"'.format(input, output)
    field_map = arcpy.FieldMap()
    field_map.addInputField(fc_in, input)
    field = field_map.outputField
    field.name = output
    field_map.outputField = field
    field_mappings.addFieldMap(field_map)
    del field, field_map

return field_mappings


def map_and_append_features(fc_in, fc_out, field_dictionary):
    field_mappings = get_field_mappings(fc_in, field_dictionary)
    arcpy.management.Append(fc_in, fc_out, "NO_TEST", field_mappings)
1
  • Please edit your question to include the code that isn't working
    – Midavalo
    Apr 29, 2016 at 6:44

1 Answer 1

1

[Update] See Note below about ArcGIS Pro

I got it working! It wanted the following environment variable set:

arcpy.env.maintainSpatialIndex = True

[Edit] There were a few other features not being copied over. They either had no geometry or weird geometry (such as looping back on itself). The no geometry ones where deleted and ones with weird geometry were re-drawn and then was fixed. [End of Edit]

Below is a full list of all environment settings that were used.

arcpy.env.overwriteOutput = True
arcpy.env.outputMFlag = "Same As Input"
arcpy.env.outputZFlag = "Same As Input"
# Setting XYDomain to "" is the equivalent as "Same As Input"
arcpy.env.XYDomain = ""
arcpy.env.extent = "MAXOF"

arcpy.env.maintainSpatialIndex = True

# SPATIAL REFERENCE
# 26918 = UTM NAD83 ZONE 18N
spatial_ref = arcpy.SpatialReference(26918)
arcpy.env.inputCoordinateSystem = spatial_ref
arcpy.env.outputCoordinateSystem = spatial_ref

# XY Tolerance
arcpy.env.XYResolution = 0.000001

[Update] ArcGIS Pro

"The Maintain Spatial Index environment is not honored in ArcGIS Pro. To have the same behavior as the Maintain Spatial Index environment in ArcGIS Pro when running tools and workflows that perform insert, update, and delete operations on existing data in enterprise geodatabases, control of the spatial index can be accomplished using the Remove Spatial Index tool to remove the spatial index prior to processing, and the Add Spatial Index tool to re-create the spatial index after processing.

The Append tool also supports this workflow with file geodatabase data." -https://pro.arcgis.com/en/pro-app/arcpy/classes/env.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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