I have a feature class of points: AL_CB_Parcel_Intersect
. This feature class is already in GCS_WGS_1984
. I am trying to use arcpy.AddGeometryAttributes
to create X, Y attributes, but I keep getting this error:
ExecuteError: ERROR 000622: Failed to execute (Add Geometry Attributes). Parameters are not valid. ERROR 000628: Cannot set input into parameter Coordinate_System.
This works in ArcMap.
What am I doing wrong in my script?
import arcpy
import os
parcels_dir = r"...\Processed"
stateabb = {'Alabama': 'AL',....}
coord_sys = "GCS_WGS_1984"
for k, v in stateabb.items():
if k == 'Alabama':
print(k)
parcel_gdb = "{}.gdb".format(k)
parcel_cent = "{}_CB_Parcel_Intersect".format(v)
parcel_path = os.path.join(parcels_dir, parcel_gdb)
parcel_feat = os.path.join(parcel_path, parcel_cent)
arcpy.env.workspace = parcel_path
arcpy.AddGeometryAttributes_management(parcel_feat, "POINT_X_Y_Z_M", "", "", coord_sys)
print("{} is done!".format(parcel_cent))