I have a csv that is read. Its data is copied over into the empty feature class. The code reads each row in the csv file and then creates a new row in the feature class to place the data in.
Reason I did this was to simply ensure that certain data types were maintained for each field in the feature class. However, my points wont display when place the feature class in arcmap? The attribute table displays all the proper values however Its like it wont recognize the x field and y field to map it?
also feature class does have a defined coordinate system
ANY IDEAS WOULD BE APPRICIATED!
Reason I did this was to simply ensure that certain data types were maintained for each field in the feature class. However, my points wont display when place the feature class in arcmap? The attribute table displays all the proper values however Its like it wont recognize the x field and y field to map it?
also feature class does have a defined coordinate system
ANY IDEAS WOULD BE APPRICIATED!
Code:
with open(current_table,"rb") as csvfile:
spamreader = csv.reader(csvfile, delimiter=',', quotechar='|')
for row in spamreader:
row = ', '.join(row)
row = row.split(",")
if row[0] <> "Name": # dont want to add a line if the values in the row are field names
tempList = row
arcpy.AddMessage("\n\n" + "templist: " + str(tempList) + "\n\n")
line = createRow.newRow()
try:
line.Name= str(tempList[0])
except:
pass
try:
line.Longitude_=float(tempList[1])
except:
pass
try:
line.Latitude=float(tempList[2])
except:
pass
createRow.insertRow(line)