arcpy.MakeXYEventLayer_management(in_table,x_coord,y_coord,out_table,spatialRef)'
Solved! Go to Solution.
from datetime import datetime from dateutil import tz ## xxxxxxxxxxxxxx snip xxxxxxxxxxxxxxxxx cur = arcpy.InsertCursor(outFC,srWGS84) # Loop over each point in the tree and put the information inside a new row # for index, trkPoint in enumerate(GeneratePointFromXML(tree)): if trkPoint.asPoint() is not None: ## rowsDA.insertRow([trkPoint.name, trkPoint.desc, trkPoint.gpxtype, trkPoint.t, ## float(trkPoint.z), float(trkPoint.x), float(trkPoint.y), float(trkPoint.z)]) row = cur.newRow() row.Name = trkPoint.name row.Descript = trkPoint.desc row.Type = trkPoint.gpxtype row.DateTimeS = trkPoint.t # convert UTC to nz using Python because ArcGIS tool crashes at 10.0 utc = datetime.strptime(trkPoint.t,'%Y-%m-%dT%H:%M:%SZ').replace(tzinfo=from_zone) # Tell the datetime object that it's in UTC time zone since # datetime objects are 'naive' by default # Convert time zone back for ArcGIS local = utc.astimezone(to_zone).replace(tzinfo=None) row.DateTime = local row.Elevation = float(trkPoint.z) row.shape = arcpy.Point(float(trkPoint.x), float(trkPoint.y), float(trkPoint.z)) cur.insertRow(row) else: badPt +=1
from datetime import datetime from dateutil import tz ## xxxxxxxxxxxxxx snip xxxxxxxxxxxxxxxxx cur = arcpy.InsertCursor(outFC,srWGS84) # Loop over each point in the tree and put the information inside a new row # for index, trkPoint in enumerate(GeneratePointFromXML(tree)): if trkPoint.asPoint() is not None: ## rowsDA.insertRow([trkPoint.name, trkPoint.desc, trkPoint.gpxtype, trkPoint.t, ## float(trkPoint.z), float(trkPoint.x), float(trkPoint.y), float(trkPoint.z)]) row = cur.newRow() row.Name = trkPoint.name row.Descript = trkPoint.desc row.Type = trkPoint.gpxtype row.DateTimeS = trkPoint.t # convert UTC to nz using Python because ArcGIS tool crashes at 10.0 utc = datetime.strptime(trkPoint.t,'%Y-%m-%dT%H:%M:%SZ').replace(tzinfo=from_zone) # Tell the datetime object that it's in UTC time zone since # datetime objects are 'naive' by default # Convert time zone back for ArcGIS local = utc.astimezone(to_zone).replace(tzinfo=None) row.DateTime = local row.Elevation = float(trkPoint.z) row.shape = arcpy.Point(float(trkPoint.x), float(trkPoint.y), float(trkPoint.z)) cur.insertRow(row) else: badPt +=1