Traceback (последний последний звонок): Файл «C: \ Users \ Brett \ Desktop \ Jefferson_final.py», строка 31, в point = arcpy.Point (координата [0], координат [1]) IndexError: индекс списка из диапазонаЯ пытаюсь создать ashapefile координат x, y из txt. файл, но я получаю следующую ошибку:
Вот мой сценарий
import arcpy
import fileinput
import os
import string
arcpy.env.workspace = "C:\Users\Brett\Desktop\San Clemente"
arcpy.env.overwriteOutput = True
outFolder = "C:\Users\Brett\Desktop\San Clemente"
output = open("result.txt", "w")
fc = "metersSC1.shp"
inputFile = "C:\Users\Brett\Desktop\San Clemente\San Clemente Lat Long.txt"
name = ""
for line in inputFile:
lineSegment = line.split(": ")
if lineSegment[0]== "spatialReference":
spatRef = spatRef = arcpy.SpatialReference(26946)
arcpy.CreateFeatureclass_management(outFolder, fc, "POINT", "", "", "", spatRef)
arcpy.AddField_management(fc, "NAME", "TEXT")
cursor = arcpy.da.InsertCursor(fc, ["","[email protected]"])
array = arcpy.Array()
elif lineSegment[0] =="NAME":
if len(array) > 0:
polygon = arcpy.Polygon(pointList)
cursor.insertRow((name,polygon))
name = lineSegment[0]
else:
coordinate = line.split(",")
point = arcpy.Point(coordinate[0],coordinate[1])
pointList.add(point)
polygon = arcpy.Polygon(array)
cursor.insertRow((name, polygon))
print "COORDINATES ADDED"