ScottChang25

ArcGIS10.0-PythonWindow:Make XY Event Layer- .csv & WGS 1984: Errors 000622 & 000628?

Discussion created by ScottChang25 on Oct 16, 2012
Latest reply on Feb 18, 2014 by xander_bakker
Hi all,
In the Excel 2007, I created a .csv file of the XY-coordinates for 10 points of my sampling locations at Edgewood, Maryland - see the attached file.  In the Python Window of my ArcGIS 10.0, I executed the following Python script:
>>> # scMakeXYlayer.py   for 12 points  Just X- & Y-coord, but no Z-coord in the csv & the .py file
... # Description: Creates an XY layer and exports it to a layer file
... # Author: ESRI - modified by Scott Chang per Chris Thompson's New No-Z (Date:  16 Oct 2012)
... # import system modules 
... import arcpy
... from arcpy import env
... # Set environment settings
... env.workspace = 'C:\TEMP\BS_Test.gdb'
...  
... try:
...     # Set the local variables
...     # in_Table = "firestations.csv"
...     tb = r'C:\TEMP\WritingGeometries\APGriMMRP.csv'
...     xc = "X"
...     yc = "Y"
...     
...     out_Layer = "BHsWellLocations_layer"
...     saved_Layer = r"c:\TEMP\BHsWellLocations.lyr"
...  
...     # Set the spatial reference
...     # spRef = r"Coordinate Systems\Projected Coordinate Systems\Utm\Nad 1983\NAD 1983 UTM Zone 11N.prj"
...     spRef = r"Coordinate Systems\Geographic Coordinate System\World\WGS 1984" 
...  
...     # Make the XY event layer...
...     arcpy.MakeXYEventLayer_management(tb, xc, yc, 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()
... 
ERROR 000622: Failed to execute (Make XY Event Layer). Parameters are not valid.
ERROR 000628: Cannot set input into parameter spatial_reference.
>>> 


Please kindly help and advise me why I got these 2 errors and how to fix them.

Thanks,
Scott Chang

Attachments

Outcomes