<?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: Flipping Lines in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/flipping-lines/m-p/577706#M45301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jake &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but this is not what I am looking for, flip tool just reverse the current direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need a script or method to flip all the lines in ONE DIRECTION.&amp;nbsp; It can be eaither North or East depending on if its closer to vertical or horizontal direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jun 2011 10:55:06 GMT</pubDate>
    <dc:creator>ManojBanga</dc:creator>
    <dc:date>2011-06-28T10:55:06Z</dc:date>
    <item>
      <title>Flipping Lines</title>
      <link>https://community.esri.com/t5/python-questions/flipping-lines/m-p/577703#M45298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am looking for a python script which can flip all the lines in one direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Either north for vertical and east for horizontal lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Manoj&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 13:21:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/flipping-lines/m-p/577703#M45298</guid>
      <dc:creator>ManojBanga</dc:creator>
      <dc:date>2011-06-24T13:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping Lines</title>
      <link>https://community.esri.com/t5/python-questions/flipping-lines/m-p/577704#M45299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any solution to this please?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 09:55:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/flipping-lines/m-p/577704#M45299</guid>
      <dc:creator>ManojBanga</dc:creator>
      <dc:date>2011-06-27T09:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping Lines</title>
      <link>https://community.esri.com/t5/python-questions/flipping-lines/m-p/577705#M45300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you have an ArcEditor license for ArcGIS 10 you can use the '&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001v00000005000000.htm"&gt;arcpy.FlipLine_edit&lt;/A&gt;&lt;SPAN&gt;' function to reverse the direction of your polyline data.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 13:52:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/flipping-lines/m-p/577705#M45300</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2011-06-27T13:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping Lines</title>
      <link>https://community.esri.com/t5/python-questions/flipping-lines/m-p/577706#M45301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jake &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but this is not what I am looking for, flip tool just reverse the current direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need a script or method to flip all the lines in ONE DIRECTION.&amp;nbsp; It can be eaither North or East depending on if its closer to vertical or horizontal direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 10:55:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/flipping-lines/m-p/577706#M45301</guid>
      <dc:creator>ManojBanga</dc:creator>
      <dc:date>2011-06-28T10:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Flipping Lines</title>
      <link>https://community.esri.com/t5/python-questions/flipping-lines/m-p/577707#M45302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can't write the actual script right now, but here's the method I would follow, in python:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;read your lines into a search cursor

for each line in the cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp; get the first and last point coordinates
&amp;nbsp;&amp;nbsp;&amp;nbsp; calculate the change in x # first minus last, negative = W-&amp;gt;E
&amp;nbsp;&amp;nbsp;&amp;nbsp; calculate the change in y # first minus last, negative = S-&amp;gt;N
&amp;nbsp;&amp;nbsp;&amp;nbsp; if the absolute change in x is greater than the absolute change in y: # the line is in horizontal orientation
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if the change in x is positive: # line is E-&amp;gt;W
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; send line to new feature class to be flipped
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete line from current feature class
&amp;nbsp;&amp;nbsp;&amp;nbsp; else: #the line is vertical
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if the change in y is positive: # the line is N-&amp;gt;S
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; send line to new feature class to be flipped
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delete line from current feature class
flip lines in new feature class
merge flipped lines back into original feature class &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:50:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/flipping-lines/m-p/577707#M45302</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-12T00:50:22Z</dc:date>
    </item>
  </channel>
</rss>

