<?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: .PYT sample success anyone? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332984#M25941</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;"Sinuosity measures the amount that a river meanders within its valley, calculated by dividing total stream length by valley length."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I wrong in saying the function is returning the inverse of sinuousity? It looks like that to me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def getSinuosity(shape):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length = shape.length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; d = math.sqrt((shape.firstPoint.X - shape.lastPoint.X) ** 2 +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&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; (shape.firstPoint.Y - shape.lastPoint.Y) ** 2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return d/length&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jun 2012 18:08:28 GMT</pubDate>
    <dc:creator>HarryBowman</dc:creator>
    <dc:date>2012-06-04T18:08:28Z</dc:date>
    <item>
      <title>.PYT sample success anyone?</title>
      <link>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332979#M25936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://resourcesbeta.arcgis.com/en/help/main/10.1/index.html#//001500000022000000.htm"&gt;http://resourcesbeta.arcgis.com/en/help/main/10.1/index.html#//001500000022000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I copied the code from this page into notepad, changed the .txt to .pyt and clicked it in the catalog but it does nothing.&amp;nbsp; It looks like a toolbox with a red X.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 20:59:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332979#M25936</guid>
      <dc:creator>KevinBell</dc:creator>
      <dc:date>2011-10-12T20:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: .PYT sample success anyone?</title>
      <link>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332980#M25937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Cannot try this out just now, but looks like it is missing the following code in the copy/paste section&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;class Toolbox:
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.alias&amp;nbsp; = "sinuosity"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.label =&amp;nbsp; "Sinuosity toolbox"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.description = ""

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # List of tool classes associated with this toolbox
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.tools = [CalculateSinuosity]&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;See python toolbox template - &lt;/SPAN&gt;&lt;A href="http://resourcesbeta.arcgis.com/en/help/main/10.1/index.html#/The_Python_toolbox_template/001500000023000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resourcesbeta.arcgis.com/en/help/main/10.1/index.html#/The_Python_toolbox_template/001500000023000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am also not too sure why it is explicitly stating PYTHON_9.3 for the expression&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:46:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332980#M25937</guid>
      <dc:creator>MoragHawkins</dc:creator>
      <dc:date>2021-12-11T15:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: .PYT sample success anyone?</title>
      <link>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332981#M25938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;silly me. That did the trick.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really like where this is going!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 16:02:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332981#M25938</guid>
      <dc:creator>KevinBell</dc:creator>
      <dc:date>2011-10-13T16:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: .PYT sample success anyone?</title>
      <link>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332982#M25939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Has anyone logged this via that page feedback thingy, am happy to do so if not.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 18:13:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332982#M25939</guid>
      <dc:creator>MoragHawkins</dc:creator>
      <dc:date>2011-10-13T18:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: .PYT sample success anyone?</title>
      <link>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332983#M25940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Has anyone logged this via that page feedback thingy, am happy to do so if not.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I just did. thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 18:44:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332983#M25940</guid>
      <dc:creator>KevinBell</dc:creator>
      <dc:date>2011-10-13T18:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: .PYT sample success anyone?</title>
      <link>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332984#M25941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;"Sinuosity measures the amount that a river meanders within its valley, calculated by dividing total stream length by valley length."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I wrong in saying the function is returning the inverse of sinuousity? It looks like that to me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def getSinuosity(shape):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length = shape.length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; d = math.sqrt((shape.firstPoint.X - shape.lastPoint.X) ** 2 +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&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; (shape.firstPoint.Y - shape.lastPoint.Y) ** 2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return d/length&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2012 18:08:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyt-sample-success-anyone/m-p/332984#M25941</guid>
      <dc:creator>HarryBowman</dc:creator>
      <dc:date>2012-06-04T18:08:28Z</dc:date>
    </item>
  </channel>
</rss>

