I'm using ArcGIS 10.2. I can do "add XY data as layer" to associate latitude and longitude to a .dbf table, but when I try to do the same with python script it gives me an error:
Python code:
import arcgisscripting, sys, string, os
gp = arcgisscripting.create()
in_Table = "F:\Otim\interf\cg_rea.dbf"
in_x = "Latitude"
in_y = "Longitude"
out_Layer = "cg_rea_otim"
spref = "Coordinate Systems\Projected CoordinateSystems\Lisboa_Hayford_Gauss_IGeoE.prj"
gp.MakeXYEventLayer(in_Table, in_x, in_y, out_Layer, spref) #line where is the error!
Error: Runtime error Traceback (most recent call last): File "", line 191, in ExecuteError: ERROR 000622: Failed to execute (Make XY Event Layer). Parameters are not valid. ERROR 000628: Cannot set input into parameter spatial_reference.