<?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: Can't get cutoffs to work in script tool for service area in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/can-t-get-cutoffs-to-work-in-script-tool-for/m-p/1142762#M63712</link>
    <description>&lt;P&gt;When calculating a service area with time as the factor, are you saying the field with the time for each line segment needs to be a double? I'm struggling to get it to calculate time accurately. I currently have that field as a float.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Feb 2022 18:23:12 GMT</pubDate>
    <dc:creator>RachaelMurtaugh</dc:creator>
    <dc:date>2022-02-10T18:23:12Z</dc:date>
    <item>
      <title>Can't get cutoffs to work in script tool for service area</title>
      <link>https://community.esri.com/t5/python-questions/can-t-get-cutoffs-to-work-in-script-tool-for/m-p/1111396#M62797</link>
      <description>&lt;P&gt;I was able to put together a script that geocodes a given table of addresses and generates service areas for them, and I am currently in the process of converting it for use as a script tool.&amp;nbsp; I am having trouble with the command arcpy.na.MakeServiceAreaAnalysisLayer and its cutoffs variable.&amp;nbsp; I have set it up as a parameter in the script tool so that users can enter their own drive times, but no matter how I try to set it up, the output always defaults to the [5, 10, 15] drive times.&lt;/P&gt;&lt;P&gt;I know that when entering this at the command line, the desired cutoffs are to be separated by commas and enclosed by square brackets, as in my example above.&amp;nbsp; Based on other scripts I've done in the past, I set it up as follows:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;DriveTime&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;arcpy&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;GetParameterAsText&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;9&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;DTString&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"""[{0}]"""&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;format&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;DriveTime&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;NAServArea&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;arcpy&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;na&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;MakeServiceAreaAnalysisLayer&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;AGOL&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Service&amp;nbsp;Area"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Driving&amp;nbsp;Time&amp;nbsp;(Miles)"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"FROM_FACILITIES"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;DTString&lt;/SPAN&gt;&lt;SPAN class=""&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;None&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"LOCAL_TIME_AT_LOCATIONS"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"POLYGONS"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"STANDARD"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"OVERLAP"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"DISKS"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"0.1&amp;nbsp;Miles"&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;So if I enter 30, 60 into the script tool, it should pass [30, 60] into the command to set up the service area layer.&amp;nbsp; I am guessing it will come down to some kind of syntax quirk; hopefully it will be that simple.&amp;nbsp; Any help is appreciated.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 18:51:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-t-get-cutoffs-to-work-in-script-tool-for/m-p/1111396#M62797</guid>
      <dc:creator>StephenRhone</dc:creator>
      <dc:date>2021-10-26T18:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get cutoffs to work in script tool for service area</title>
      <link>https://community.esri.com/t5/python-questions/can-t-get-cutoffs-to-work-in-script-tool-for/m-p/1111453#M62803</link>
      <description>&lt;P&gt;Following additional research, I was able to solve my own problem.&amp;nbsp; I figured that even though the drive time string [30, 60] fit the correct format to be entered into the tool, it was still a string nonetheless, and the variable is required to be a double (i.e. numeric).&amp;nbsp; I figured out how to parse the string into actual numbers so that it would fit the format and return drive time polygons based on the given numbers.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;DriveTime&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;arcpy&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;GetParameterAsText&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;9&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;DriveTimeIntegers&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;int&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;i&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;for&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;i&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;in&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;DriveTime&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;split&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;",&amp;nbsp;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;)]&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;To give credit where credit is due, I found the solution at the site below.&lt;/P&gt;&lt;P&gt;stackoverflow.com/questions/15314421/in-python-how-do-i-split-a-string-into-multiple-integers&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 21:23:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-t-get-cutoffs-to-work-in-script-tool-for/m-p/1111453#M62803</guid>
      <dc:creator>StephenRhone</dc:creator>
      <dc:date>2021-10-26T21:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get cutoffs to work in script tool for service area</title>
      <link>https://community.esri.com/t5/python-questions/can-t-get-cutoffs-to-work-in-script-tool-for/m-p/1142762#M63712</link>
      <description>&lt;P&gt;When calculating a service area with time as the factor, are you saying the field with the time for each line segment needs to be a double? I'm struggling to get it to calculate time accurately. I currently have that field as a float.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 18:23:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-t-get-cutoffs-to-work-in-script-tool-for/m-p/1142762#M63712</guid>
      <dc:creator>RachaelMurtaugh</dc:creator>
      <dc:date>2022-02-10T18:23:12Z</dc:date>
    </item>
  </channel>
</rss>

