So, I'm trying to populate a point feature class using features from another feature class with the same schema.
The general workflow is:
inputList = []
# tempTop is the source table.
# It is in memory, if that makes a difference
with arcpy.da.SearchCursor(tempTop, '*') as cursor:
for row in cursor:
inputList.append(row)
'''code'''
#nadFC is the destination table.
with arcpy.da.InsertCursor(nadFC, '*') as cursor:
for r in inputList:
cursor.insertRow(r)
This worked great when writing to a file geodatabase.
Writing to a (non-versioned, have full permissions for it) enterprise geodatabase, I get the following error:
Traceback (most recent call last):
File "<string>", line 93, in <module>
File "<string>", line 78, in <module>
TypeError: value #1 - unsupported type: tuple
The value in question is supposed to be the shape field.
So, I investigate, and value #1 is in fact a tuple instead of a geometry object.
print(inputList[0])
# Yields:
# (1, (-105.88538999999997, 42.19521000000003), ...)
So, I've tried the following:
inputList = []
# tempTop is the source table
with arcpy.da.SearchCursor(tempTop, '*') as cursor:
for row in cursor:
inputList.append(list(row))
'''code'''
#nadFC is the destination table.
with arcpy.da.InsertCursor(nadFC, '*') as cursor:
for r in inputList:
r[1] = arcpy.PointGeometry(arcpy.Point(r[1][0], r[1][1]))
cursor.insertRow(r)
I get the same error:
Traceback (most recent call last):
File "<string>", line 93, in <module>
File "<string>", line 78, in <module>
TypeError: value #1 - unsupported type: PointGeometry
Tried the same thing, just using arcpy.Point(), not including arcpy.PointGeometry(), but also got an error.
So, what changed between the file GDB and the eGDB? Why could the fGDB take a pair of coordinates for the shape field, but the eGDB can't? How can I get around this?
Thanks in advance.