<?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: Help GIS Tutorial for Python Scripting ex 2.3 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/help-gis-tutorial-for-python-scripting-ex-2-3/m-p/3267#M294</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/40997"&gt;Chantell Krider&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you post code, could you please use the syntax highlighting?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/1070"&gt;Posting Code blocks in the new GeoNet&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case Dallas answer was helpful you can mark it as Helpfull (below the post you'll find "Helpful Yes | No").&lt;/P&gt;&lt;P&gt;In case Dallas answered your question you can mark his post using the button "Correct Answer".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Jan 2015 23:47:14 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2015-01-15T23:47:14Z</dc:date>
    <item>
      <title>Help GIS Tutorial for Python Scripting ex 2.3</title>
      <link>https://community.esri.com/t5/python-questions/help-gis-tutorial-for-python-scripting-ex-2-3/m-p/3264#M291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I recently purchased David Allen's GIS tutorial and I'm stuck on exercise 2.3. The objective is to buffer multiple paths with variable buffer distances based on the length of the path -step 7 (I'm stuck here). The exercise uses a search cursor to go through each path and buffer accordingly. The data are available with the book &lt;A href="http://esripress.esri.com/bookresources/index.cfm?event=catalog.book&amp;amp;id=8"&gt;here&lt;/A&gt;. I know the buffer line is incorrect, it needs to call fcName and wellBuffDist. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;It would be helpful to see the full script...if anyone has already completed this exercise. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&amp;nbsp; import arcpy&lt;/P&gt;&lt;P&gt;&amp;nbsp; from arcpy import env&lt;/P&gt;&lt;P&gt;&amp;nbsp; env.workspace = r"C:\EsriPress\GISTPython\Data\City of Oleander.gdb\Well_Data"&lt;/P&gt;&lt;P&gt;&amp;nbsp; env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;&amp;nbsp; fcName = "BC_South_3H_Path"&lt;/P&gt;&lt;P&gt;&amp;nbsp; wellCursor = arcpy.da.SearchCursor(fcName,["Shape_Length"])&lt;/P&gt;&lt;P&gt;&amp;nbsp; for row in wellCursor:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; drillLength = row[0]&lt;/P&gt;&lt;P&gt;&amp;nbsp; def wellBuffDist(drillLenght, wellBuffDist):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if drillLenght &amp;lt; 3000:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wellBuffDist = 75&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif drillLenght &amp;gt;= 3000 and drillLenght &amp;lt; 4000:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wellBuffDist = 175&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wellBuffDist = 300&lt;/P&gt;&lt;P&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script&lt;/P&gt;&lt;P&gt;# The following inputs are layers or table views: "BC_South_3H_Path"&lt;/P&gt;&lt;P&gt;&amp;nbsp; arcpy.Buffer_analysis(in_features="BC_South_3H_Path",out_feature_class="C:/EsriPress/GISTPython/MyExercises/Scratch/Temporary Storage.gdb/SelectionBuffer",buffer_distance_or_field="300 feet",line_side="FULL",line_end_type="ROUND",dissolve_option="NONE",dissolve_field="#")&lt;/P&gt;&lt;P&gt;&amp;nbsp; print "great job!"&lt;/P&gt;&lt;P&gt;except:&lt;/P&gt;&lt;P&gt;&amp;nbsp; print "do over"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 17:58:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-gis-tutorial-for-python-scripting-ex-2-3/m-p/3264#M291</guid>
      <dc:creator>ChantellKrider</dc:creator>
      <dc:date>2015-01-14T17:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help GIS Tutorial for Python Scripting ex 2.3</title>
      <link>https://community.esri.com/t5/python-questions/help-gis-tutorial-for-python-scripting-ex-2-3/m-p/3265#M292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this should work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&amp;nbsp; import arcpy&lt;/P&gt;&lt;P&gt;&amp;nbsp; from arcpy import env&lt;/P&gt;&lt;P&gt;&amp;nbsp; env.workspace = r"C:\EsriPress\GISTPython\Data\City of Oleander.gdb\Well_Data"&lt;/P&gt;&lt;P&gt;&amp;nbsp; env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;&amp;nbsp; fcName = "BC_South_3H_Path"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; def wellBuffDist(drillLenght):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if drillLenght &amp;lt; 3000:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BuffDist = 75&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif drillLenght &amp;gt;= 3000 and drillLenght &amp;lt; 4000:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BuffDist = 175&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BuffDist = 300&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return str(BuffDist) + " feet"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; wellCursor = arcpy.da.SearchCursor(fcName,["Shape_Length"])&lt;/P&gt;&lt;P&gt;&amp;nbsp; for row in wellCursor:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; drillLength = row[0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wBuffDist = wellBuffDist(row[0])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Buffer_analysis(in_features=fcName, out_feature_class="C:/EsriPress/GISTPython/MyExercises/Scratch/Temporary Storage.gdb/SelectionBuffer", buffer_distance_or_field=wBuffDist, line_side="FULL", line_end_type="ROUND", dissolve_option="NONE", dissolve_field="#")&lt;/P&gt;&lt;P&gt;&amp;nbsp; print "great job!"&lt;/P&gt;&lt;P&gt;except:&lt;/P&gt;&lt;P&gt;&amp;nbsp; print "do over"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 18:01:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-gis-tutorial-for-python-scripting-ex-2-3/m-p/3265#M292</guid>
      <dc:creator>DallasShearer</dc:creator>
      <dc:date>2015-01-15T18:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help GIS Tutorial for Python Scripting ex 2.3</title>
      <link>https://community.esri.com/t5/python-questions/help-gis-tutorial-for-python-scripting-ex-2-3/m-p/3266#M293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dallas-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wow! thank you sooo much. I really appreciate your response. I did run the code you suggested and it almost works. I commented bits out until I discovered the source of the error. It gets hung up in the buffer statement where it calls the wBuffDist. I'll do a little more work to try and figure it out. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 21:18:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-gis-tutorial-for-python-scripting-ex-2-3/m-p/3266#M293</guid>
      <dc:creator>ChantellKrider</dc:creator>
      <dc:date>2015-01-15T21:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help GIS Tutorial for Python Scripting ex 2.3</title>
      <link>https://community.esri.com/t5/python-questions/help-gis-tutorial-for-python-scripting-ex-2-3/m-p/3267#M294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/40997"&gt;Chantell Krider&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you post code, could you please use the syntax highlighting?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/1070"&gt;Posting Code blocks in the new GeoNet&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case Dallas answer was helpful you can mark it as Helpfull (below the post you'll find "Helpful Yes | No").&lt;/P&gt;&lt;P&gt;In case Dallas answered your question you can mark his post using the button "Correct Answer".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 23:47:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-gis-tutorial-for-python-scripting-ex-2-3/m-p/3267#M294</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-01-15T23:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help GIS Tutorial for Python Scripting ex 2.3</title>
      <link>https://community.esri.com/t5/python-questions/help-gis-tutorial-for-python-scripting-ex-2-3/m-p/3268#M295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay. Thanks. I'm new to this. Thanks for the tip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 23:49:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-gis-tutorial-for-python-scripting-ex-2-3/m-p/3268#M295</guid>
      <dc:creator>ChantellKrider</dc:creator>
      <dc:date>2015-01-15T23:49:57Z</dc:date>
    </item>
  </channel>
</rss>

