I'm trying to learn how to create a polyline object from a set of XY pairs. I need to create an empty point object and an empty array object, place the coordinates in a list, and use a for loop to iterate through the list and populate the point object. From there I'm pretty sure I can create the polyline from the array, which is the last step.
How do I go from the list of points to the point object using a for loop? I've been trying to use the .add or .append functions to no avail.
# Import module import arcpy # Create empty objects: # # Point point = arcpy.Point() # Array array = arcpy.Array() # Create a list of coordinates (X, Y) coordinates = [[260, 320], [450, 420], [360, 680], [600, 1000], [900, 190]] # For loop iteration through coordinates for pair in coordinates: point.x = pair point.y = pair # What else goes here to populate the point object? print point # to test if loop is functioning correctly