I'm trying to add an attribute value to a new PointGeometry before I write it into the new file. How do I do that with arcpy
?
Let's say in this example I want to write the ID of the line feature into the new point feature:
points = []
for row in arcpy.da.SearchCursor('lineFeature', ("ID", "SHAPE@")):
length = int(row[1].length)
for i in xrange(0, length, 10):
point = row[1].positionAlongLine(i)
# should write the ID here
# something like
# point.setValue('sourceID', row[0])
points.append(point)
arcpy.CopyFeatures_management(points, 'pointsFeature')
The command point.setValue('sourceID', row[0])
point. doesn't work, it returns:
Runtime error
Traceback (most recent call last):
File "<string>", line 8, in <module>
AttributeError: 'PointGeometry' object has no attribute 'setValue'