ArcMap version 10.3.1 Python version 2.7.12
I'm trying to produce a points table with one row. The row should include x,y coordinates for the point and optionally a name.
I have tried this two different ways and failed, each yielding separate results.
Attempt 1:
(Creates a shapefile, but it is empty and unprojected)
temp is a variable holding '[37.00, -79.00]'
pointslist = []
pointslist.append(temp)
pt = arcpy.Point()
ptGeoms = []
for p in pointslist:
pt.X = p[0]
pt.Y = p[1]
ptGeoms.append(arcpy.PointGeometry(pt))
arcpy.CopyFeatures_management(ptGeoms, r"C:\Temp\test.shp")
Attempt 2:
(Always results in the name field being populated, but the x,y remaining null)
fc = "p:/435final/standin.gdb/userx"
cursor = arcpy.da.InsertCursor(fc, ["SHAPE@XY"])
xy = (39.55, -79.00)
cursor.insertRow(["USER", xy])
del cursor