<?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: Points to polylines missing first segment and last 2 segments in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/points-to-polylines-missing-first-segment-and-last/m-p/694247#M53838</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The instructions are not very complete&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000001v000000"&gt; in the help. &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code isn't showing how your array gets initialized, but if it's been around for a previous loop, it's important to remember to clear it out with&lt;STRONG&gt; array.RemoveAll()&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing to think about is that the XY resolution can truncate and modify coordinates if your coordinate values are very close together.&amp;nbsp; This truncation would happen (along with re-ordering of polygon coordinates and other geometric clean-up) when you create the feature with insertRow().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Dec 2014 07:04:57 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2014-12-04T07:04:57Z</dc:date>
    <item>
      <title>Points to polylines missing first segment and last 2 segments</title>
      <link>https://community.esri.com/t5/python-questions/points-to-polylines-missing-first-segment-and-last/m-p/694244#M53835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I&amp;nbsp; have a python script that was creating points in memory and writing them to an arcpy.Array and then writing the array to an already existing feature class as a polyline.&amp;nbsp; When I looked at the line it was missing the first segment and the last 2 1/4 segments.&amp;nbsp; I changed the script to write the points to an existing featureclass (to verify that it was in fact looking at all of the points).&amp;nbsp; All of the points are there but the line is still incomplete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code segment:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;cur = arcpy.da.InsertCursor(outLineFC, ["SHAPE@"])
cur2 = arcpy.da.InsertCurson(outPointFC, ["SHAPE@"]

for coords in coordsList:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print coords[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print coords[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print float(coords[2])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print float(coords[3])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "next item"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array.add(arcpy.Point(float(coords[3]), float(coords[2])))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur2.insertRow([arcpy.Point(float(coords[3]), float(coords[2]), ID=int(coords[1]))]))
if cur2:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del cur2
cur.insertRow([arcpy.Polyline(array)])&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain to me why it is writing all of the points in the order I would expect it to draw the line but not writing the first segment and the last 2 1/4 segments of the line?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/points-to-polylines-missing-first-segment-and-last/m-p/694244#M53835</guid>
      <dc:creator>SharonLitteral</dc:creator>
      <dc:date>2021-12-12T05:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Points to polylines missing first segment and last 2 segments</title>
      <link>https://community.esri.com/t5/python-questions/points-to-polylines-missing-first-segment-and-last/m-p/694245#M53836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not sure if I follow the workflow, but are the last 3 lines supposed to be indented? or stepped outside as you have?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 16:58:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/points-to-polylines-missing-first-segment-and-last/m-p/694245#M53836</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-12-03T16:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Points to polylines missing first segment and last 2 segments</title>
      <link>https://community.esri.com/t5/python-questions/points-to-polylines-missing-first-segment-and-last/m-p/694246#M53837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.&amp;nbsp; I read through the list of coordinates and add each one to the arcpy.array.&amp;nbsp; Not until I have finished with all of the coordinates do I write the array to the polyline.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 17:26:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/points-to-polylines-missing-first-segment-and-last/m-p/694246#M53837</guid>
      <dc:creator>SharonLitteral</dc:creator>
      <dc:date>2014-12-03T17:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Points to polylines missing first segment and last 2 segments</title>
      <link>https://community.esri.com/t5/python-questions/points-to-polylines-missing-first-segment-and-last/m-p/694247#M53838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The instructions are not very complete&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000001v000000"&gt; in the help. &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code isn't showing how your array gets initialized, but if it's been around for a previous loop, it's important to remember to clear it out with&lt;STRONG&gt; array.RemoveAll()&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing to think about is that the XY resolution can truncate and modify coordinates if your coordinate values are very close together.&amp;nbsp; This truncation would happen (along with re-ordering of polygon coordinates and other geometric clean-up) when you create the feature with insertRow().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 07:04:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/points-to-polylines-missing-first-segment-and-last/m-p/694247#M53838</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-12-04T07:04:57Z</dc:date>
    </item>
  </channel>
</rss>

