Issue Creating Points from Tuple List

04-21-2022 08:10 AM
New Contributor II


_Maybe I'm too new to this but with a list of tuples, I should be able to create points. They are being created but it creates an incorrect location. The first image shows the first 25 tuple coordinates and a each item being read to show its type.


Here is the code at the moment: 

arcpy.AddMessage( topLine_Tuple[:25])
for i in topLine_Tuple[:25]:

# Creates an Empty Feature Class
topline_FC = arcpy.CreateFeatureclass_management(dataset_Dir, "topline0", "POINT")

# Cursor
with arcpy.da.InsertCursor(topline_FC, ['SHAPE@XY']) as insert_cursor:
for pnt in topLine_Tuple:


...So it does create the points but all in the same coordinate (see next image). I'd figure that:

  1. the tuple list is incorrect, maybe an array
  2. the spatial reference is incorrect, it should be returning the feature class as NAD27 (spatial_reference=4267) or whichever
    1. Its initialing an UTM projection (most likely)
  3.  I dunno, since it should be returning different coordinates


by the way, all the points created result in the same long, lat (even though they are different in the tuple)


0 Kudos
1 Reply
MVP Esteemed Contributor

on the 4th line you have a double ]]

and then a bunch of singleton locations.  Remove one of the ] from that line and put it at the end of your point list

... sort of retired...
0 Kudos