<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Draw Line. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/draw-line/m-p/714029#M55376</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for replying. I am using ArcGIS 10.1. Is it possible can I use "ExcelToTable_conversion&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;"?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Rengaraj P&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Oct 2015 05:58:23 GMT</pubDate>
    <dc:creator>RajP</dc:creator>
    <dc:date>2015-10-06T05:58:23Z</dc:date>
    <item>
      <title>Draw Line.</title>
      <link>https://community.esri.com/t5/python-questions/draw-line/m-p/714025#M55372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the excel file I have column name as LineId and Long_Lat. In the LineId, there is LineID value &amp;amp; In the Long_Lat, there is Line Feature Vertices. I need to draw line for each lineId using Long_Lat using Python Script. Can any one suggest me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 1892px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="102"&gt;LineID&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="1790"&gt;Lat_Long&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;S136655227013&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;21.12173590787274,79.1472733529529,21.1218167959283,79.14727069126126,21.12189369747202,79.14727603991854,21.1219516019768,79.14727817566171&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;N062473327012&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;21.12173590787274,79.1472733529529,21.1218167959283,79.14727069126126,21.12189369747202,79.14727603991854,21.1219516019768,79.14727817566171,21.12200625594409,79.14728308379594&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;S698455527012&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;21.020929394087638,79.12738378329531,21.02091591890449,79.12744257372505&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raj P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2015 09:58:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/draw-line/m-p/714025#M55372</guid>
      <dc:creator>RajP</dc:creator>
      <dc:date>2015-10-05T09:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Draw Line.</title>
      <link>https://community.esri.com/t5/python-questions/draw-line/m-p/714026#M55373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can work with arcpy Geometry objects to create polylines from points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000001z000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000001z000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2) Working with geometries &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//018z00000008000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//018z00000008000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; Arcpy.Polyline &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will need to be able to parse each set of lat longs, convert to point geometry make arrays of points for each line, then insert the arrays into the Polyline Object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2015 12:43:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/draw-line/m-p/714026#M55373</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2015-10-05T12:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Draw Line.</title>
      <link>https://community.esri.com/t5/python-questions/draw-line/m-p/714027#M55374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are a couple ways to go about doing this, but you should first export your excel table to an info table using the Excel to Table tool&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Toolboxes\System Toolboxes\Conversion Tools.tbx\Excel\Excel To Table: &lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/EN/HELP/MAIN/10.2/index.html#//001200000055000000" title="http://resources.arcgis.com/EN/HELP/MAIN/10.2/index.html#//001200000055000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if your excel table is setup the same as your example with a long list of coordinates for each entry in a single column then you could try a code similar to the following to parse the coordinate pairs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;polyline = arcpy.CreateFeatureclass_management("C:\Generate_Lines","Lines.shp","POLYLINE","","","",4326) # This generates an empty line shapefile with WGS 1984 spatial reference WKID: 4326&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.AddField_management(polyline,"LineID","TEXT") # This adds a LineID field to the empty line layer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table = "C:\Generate_Lines\generatelines" # This references the table exported from excel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.SearchCursor(table,["LINEID","LAT_LONG"]) as search:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in search:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array = arcpy.Array()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range (len(row[1].split(","))/2):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array.add(arcpy.Point(row[1].split(",")[i*2+1],row[1].split(",")[i*2]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.InsertCursor(polyline,["SHAPE@","LineID"]) as insert:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert.insertRow((arcpy.Polyline(array),row[0]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above search and insert cursor section loops through the 'table' which would reference the exported excel table that has the field names "LINEID" and "LAT_LONG". It will cycle through the lat / long entries and create an array that can be used to generate a polyline. This is all contingent on valid coordinate entries for polyline generation of course.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, sometimes the above method may not produce desired results in which case you can generate a point layer first and then just use the standard Points to Line &lt;A href="http://resources.arcgis.com/EN/HELP/MAIN/10.2/index.html#//00170000003s000000" style="text-decoration: underline;" title="http://resources.arcgis.com/EN/HELP/MAIN/10.2/index.html#//00170000003s000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; tool to generate lines based on LineID:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;points = arcpy.CreateFeatureclass_management("C:\ArcGIS_LPS\EGIS_Help\Generate_Lines","Vertices.shp","POINT","","","",3857)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.AddField_management(points ,"LineID","TEXT")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table = "C:\Generate_Lines\generatelines"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.SearchCursor(table,["LINEID","LAT_LONG"]) as search:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in search:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array = arcpy.Array()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range (len(row[1].split(","))/2):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.InsertCursor(points ,["SHAPE@","LineID"]) as insert:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert.insertRow((arcpy.Point(row[1].split(",")[i*2+1],row[1].split(",")[i*2]),row[0]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;arcpy.PointsToLine_management(points,"C:\Generate_Lines\\generatelines.shp","LineID")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2015 16:10:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/draw-line/m-p/714027#M55374</guid>
      <dc:creator>LukeSturtevant</dc:creator>
      <dc:date>2015-10-05T16:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Draw Line.</title>
      <link>https://community.esri.com/t5/python-questions/draw-line/m-p/714028#M55375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before you start drawing lines, perhaps you might be interested in closing your other open threads.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2015 16:37:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/draw-line/m-p/714028#M55375</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-10-05T16:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Draw Line.</title>
      <link>https://community.esri.com/t5/python-questions/draw-line/m-p/714029#M55376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for replying. I am using ArcGIS 10.1. Is it possible can I use "ExcelToTable_conversion&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;"?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Rengaraj P&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Oct 2015 05:58:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/draw-line/m-p/714029#M55376</guid>
      <dc:creator>RajP</dc:creator>
      <dc:date>2015-10-06T05:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Draw Line.</title>
      <link>https://community.esri.com/t5/python-questions/draw-line/m-p/714030#M55377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;EM&gt;There are a couple ways to go about doing this, but you should first export your excel table to an info table using the Excel to Table tool&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;EM&gt;Toolboxes\System Toolboxes\Conversion Tools.tbx\Excel\Excel To Table: &lt;/EM&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fresources.arcgis.com%2FEN%2FHELP%2FMAIN%2F10.2%2Findex.html%23%2F%2F001200000055000000" rel="nofollow" style="font-family: inherit; color: #287433;" target="_blank"&gt;&lt;EM&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/EM&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: italic; text-decoration: underline;"&gt;​&lt;/SPAN&gt;as indicated in his post&lt;SPAN&gt;​&lt;/SPAN&gt;​, does it exist in 10.1?&amp;nbsp; check the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Oct 2015 06:10:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/draw-line/m-p/714030#M55377</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-10-06T06:10:00Z</dc:date>
    </item>
  </channel>
</rss>

