I'm trying to add coordinates to values of a .dbf table in ArcGIS 10.2. I'm using the following code:
import arcpy
from arcpy import env
env.workspace = "F:\Otim\interf"
try:
# Set the local variables
in_Table = "Ge_A_otim.dbf"
x_coords = "Longitude"
y_coords = "Latitude"
#z_coords = "POINT_Z" #I don't have Z point...
out_Layer = "Ge_aa_otim1"
saved_Layer = r"F:\Otim\interf\Ge_aa_otim1.lyr"
# Set the spatial reference
spRef = arcpy.SpatialReference(102164)
# Make the XY event layer...
arcpy.MakeXYEventLayer_management(in_Table, x_coords, y_coords, out_Layer, spRef, "")
# Print the total rows
print arcpy.GetCount_management(out_Layer)
# Save to a layer file
arcpy.SaveToLayerFile_management(out_Layer, saved_Layer)
except:
# If an error occurred print the message to the screen
print arcpy.GetMessages()
And I have an error:
Failed to execute. Parameters are not valid. ERROR 000732: XY Table: Dataset Ger_Act_otim.dbf does not exist or is not supported Failed to execute (MakeXYEventLayer).
I try to do without code, using function "Add XY Coordinates" and I can't find table.