I am using ArcGIS Desktop 10.8 Basic. I do not have access to a Standard or Advanced license for this.
I want to use a point from a search cursor as an input for the
arcpy.PolyLine() method. A second cursor will provide the point feature to be used as the and point of the polyline. My search cursor is on a point feature layer, and I'm using
'SHAPE@' as one of the fields in the cursor. This is vexing me to no end. In my mind - and this may be my downfall - there's no reason to drill down to the coordinate level.
Isn't it possible to get the geometry for the current cursor's point feature directly?
How do I actually get from two point features in a cursor as inputs for creating a polyline between them?
arcpy.Polyline() method demand an array of coordinates?
I didn't think it did, but it's hard finding good examples. Nearly all the samples and examples I've found in my searches begin with a set of coordinate tuples, never a point feature from a cursor.
Here's the part of my script that is supposed to do the heavy lifting but doesn't work. Some variables are assigned earlier in the script, but I think you'll see my problems don't involve them. Both cursors are on point feature layers.
curfldsAP = ['SHAPE@', 'OID@', fldAPID, fldAPadd] curfldsGP = ['SHAPE@', 'OID@', "Score", fldGPID] curNewLine = arcpy.da.InsertCursor(lyrGCline, ['SHAPE@', "FULL_ADDRESS", "ADD_ID"]) with arcpy.da.SearchCursor(lyrAP, curfldsAP) as cur: for row in cur: linepoints =  ptSTART = arcpy.Point(row) linepoints.append(ptSTART) id = row add = row wc = fldGPID + " = " + str(id) # whereclause with arcpy.da.SearchCursor(lyrGP, curfldsGP, wc) as cur2: for row2 in cur2: if row2 >= 80: ptEND = arcpy.Point(row2) linepoints.append(ptEND) newLine = arcpy.Polyline(linepoints) curNewLine.insertRow(newLine, add, id)