I am trying to solve a problem, I am pasting part of the code:
from arcpy import env arcpy.env.overwriteOutput = True spatialRef = arcpy.SpatialReference("WGS 1984") polylineFC = arcpy.CreateFeatureclass_management( r"H:\GIS5044\GIS5044_Nov 06\GIS5044\homework\hw#3\ ", "RhinoParsing.shp", "POLYLINE", "", "", "", spatialRef) fieldList=["Name"] arcpy.AddField_management(polylineFC,fieldList,"Text","#","#",8) point = arcpy.Point() array = arcpy.Array() featureList =  for rhino in nameCord_Dict: CordList= [nameCord_Dict[rhino]] print CordList print len(CordList) for feature in CordList: for cordpair in feature: point.X = cordpair point.Y = cordpair array.add(point) pointPolyline = arcpy.Polyline(array, spatialRef) with arcpy.da.InsertCursor(polylineFC,("SHAPE@")) as iCursor: array.removeAll() iCursor.insertRow((pointPolyline,))
Here I am trying to make one polyline for each [rino] of the dictionary "nameCord_Dict". but when I run the code it creates one line feature instead of 5 as there are five keys in the dictionary. I am not understanding where should i do to end polyline once all the coordinate related to one element of "nameCord_Dict" is finish and start a new line for a new element.
This is the polyline i got: