I've made the XY Event Layer work through python script, but can't get it to work correctly as a python script tool on arc, asking for user input. Does anyone have any suggestions?
This is the script I am using on arc:
# Import arcpy module
import arcpy, sys, traceback
from arcpy import env
# Script arguments
Input_Table = arcpy.GetParameterAsText(0)
feat_output = arcpy.GetParameterAsText(1)
# Local variables:
XY_Event_Layer = Input_Table
Longitude_and_Latitude_Points = XY_Event_Layer
sr = arcpy.SpatialReference(104145)
feat_output = "long_lat.shp"
# Process: Make XY Event Layer
arcpy.MakeXYEventLayer_management(Input_Table, "longitude", "latitude", XY_Event_Layer, sr)
# Process: Copy Features
arcpy.CopyFeatures_management(XY_Event_Layer, Longitude_and_Latitude_Points, "", "0", "0", "0")
This is my parameter set up of the script tool properties:
input Table - Table View,
x coor - Field,
y coor - Field,
output feat. - Feature Layer
XY_Event_Layername is declared for both input table and feature layer.