I suspect that there is no easier way to do this, other than developing this as a two-step process with a temporary output (which seems somewhat wasteful). If I have to, I'll just create a temporary output and use the Project tool as a second step.
I have an ETL process (python script) that involves creating field mappings and merging data from our Enterprise SQL-Server Express database (in our local State Plane NAD1983 coordinate system) to a file geodatabase whose schema is in WGS1984 Geographic Coordinates. I've noticed that the output is close but not quite correctly aligned (it is "forced" into the coordinate system of the output gdb).
"Is there a way to use Merge (with field mappings) and somehow enforce a datum transformation (in my case
WGS_1984_ITRF00_To_NAD_1983) in the same step?".
There is nothing in the "Merge" tool dialog indicating a parameter that would allow me to do apply a transformation. Similarly there is nothing in the "Project" dialog allowing me to add field mappings.
This is just a small snippet of code to show how I'm currently doing this.
# ID_PREFIX (temporary) fldmap_IDP = arcpy.FieldMap() fldmap_IDP.mergeRule = 'First' fldmap_IDP.addInputField(input_lyr, "ID_PREFIX") fieldmappings.addFieldMap(fldmap_IDP) # END MAPPING FIELDS print("Field Mappings are Complete ... Ready to Merge ...") # FINALLY - DO THE MERGE arcpy.Merge_management(input_lyr, out_fc, fieldmappings)
EDIT: I tried adding the transformation to the geoprocessing environment as suggested but (assuming I did so correctly), it did not help. The result was still off by about 3 feet (see my code below).
# FINALLY - DO THE MERGE arcpy.env.outputCoordinateSystem = arcpy.SpatialReference("WGS 1984") # 4326 arcpy.env.geographicTransformations = "WGS_1984_ITRF00_To_NAD_1983" # from 2248 arcpy.Merge_management(input_lyr, out_fc, fieldmappings)`