<?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: Creating an expanding square for search and rescue in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/creating-an-expanding-square-for-search-and-rescue/m-p/438525#M34422</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The spatial reference is set in the line: &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;sr = arcpy.SpatialReference(&lt;/SPAN&gt;&lt;SPAN class="number" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: green; background-color: #f6f6f6;"&gt;3005&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;3005 is the factory code/authority code/EPSG code for BC Albers. Change it to the CRS of your choosing, but keep in mind that the units of 'step' will be determined by the CRS. If you input a geographic CRS, then the 'step' will be in units of degrees.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jan 2016 21:15:08 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2016-01-28T21:15:08Z</dc:date>
    <item>
      <title>Creating an expanding square for search and rescue</title>
      <link>https://community.esri.com/t5/python-questions/creating-an-expanding-square-for-search-and-rescue/m-p/438522#M34419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's something to think about for fun:&amp;nbsp; &lt;A href="http://excelribbon.tips.net/T005645_Calculating_an_Expanding_Square.html" title="http://excelribbon.tips.net/T005645_Calculating_an_Expanding_Square.html"&gt;Calculating an Expanding Square (Microsoft Excel)&lt;/A&gt; The link provides a download for a spreadsheet that will calculate the points for a search and rescue effort that starts at a center point and then expands from that location in a spiraling rectangle. (It says that it creates an expanding square, but that only sort of works near the equator; for other areas it is a rectangle.) Once you download the spreadsheet, you can "unprotect" the worksheet (there is no password) so that you can format the table array to bring the data into ArcMap.&amp;nbsp; If you add a column for "Line" and calculate all of the rows to be "1", you can use the Data Management Tools--&amp;gt;Features--&amp;gt;Point to Line script to convert the points into a line using the "Seg" column as the sort order.&amp;nbsp; The spreadsheet formulas have some obvious issues, but it is a quick approximation of what someone might need.&amp;nbsp; If you were going to improve the solution in ArcGIS so that it was a more accurate expanding square, how would you do it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 16:00:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-an-expanding-square-for-search-and-rescue/m-p/438522#M34419</guid>
      <dc:creator>SusanZwillinger</dc:creator>
      <dc:date>2016-01-28T16:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an expanding square for search and rescue</title>
      <link>https://community.esri.com/t5/python-questions/creating-an-expanding-square-for-search-and-rescue/m-p/438523#M34420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The example uses an approximation of geographic coordinates. It's kind of cool how they set up the even/odd routine. You can (perhaps) do better letting ArcGIS handle the coordinates through a projection (spatial reference).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Python:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; x = 0 # start x coord
... y = 0 # start y coord
... step = 10 # distance between lines
... points = [] # points list container
... line_array = arcpy.Array() # line vertices container
... sr = arcpy.SpatialReference(3005) # spatial ref
... for i in range(100): # we're going to make 100 points
...&amp;nbsp;&amp;nbsp;&amp;nbsp; if i%2: # check even/odd
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i/2%2: # check 1/2 even/odd
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x += step * int(i/2) # increase x
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x -= step * int(i/2) # decrease x
...&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i/2%2: # check 1/2 even/odd
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y += step * int(i/2) # increase y
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y -= step * int(i/2) # decrease y
...&amp;nbsp;&amp;nbsp;&amp;nbsp; point = arcpy.Point(x,y) # create point
...&amp;nbsp;&amp;nbsp;&amp;nbsp; points.append(arcpy.PointGeometry(point,sr)) # add point to list
...&amp;nbsp;&amp;nbsp;&amp;nbsp; line_array.add(point) # add location to line vertices
... line = arcpy.Polyline(line_array,sr) # create line
... arcpy.CopyFeatures_management(points, r'in_memory\points') # write points
... arcpy.CopyFeatures_management(line, r'in_memory\line') # write line&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="174731" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/174731_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:37:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-an-expanding-square-for-search-and-rescue/m-p/438523#M34420</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T19:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an expanding square for search and rescue</title>
      <link>https://community.esri.com/t5/python-questions/creating-an-expanding-square-for-search-and-rescue/m-p/438524#M34421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, that was fast!&amp;nbsp; The code runs fine, but I'll have to play around with the spatial references. 3005 is for NAD_1983_BC_Environment_Albers so if you use latitude and longitude coordinates as the x,y input, it is not going to work.&amp;nbsp; What did you use as your inputs?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 20:47:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-an-expanding-square-for-search-and-rescue/m-p/438524#M34421</guid>
      <dc:creator>SusanZwillinger</dc:creator>
      <dc:date>2016-01-28T20:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an expanding square for search and rescue</title>
      <link>https://community.esri.com/t5/python-questions/creating-an-expanding-square-for-search-and-rescue/m-p/438525#M34422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The spatial reference is set in the line: &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;sr = arcpy.SpatialReference(&lt;/SPAN&gt;&lt;SPAN class="number" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: green; background-color: #f6f6f6;"&gt;3005&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;3005 is the factory code/authority code/EPSG code for BC Albers. Change it to the CRS of your choosing, but keep in mind that the units of 'step' will be determined by the CRS. If you input a geographic CRS, then the 'step' will be in units of degrees.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 21:15:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-an-expanding-square-for-search-and-rescue/m-p/438525#M34422</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-01-28T21:15:08Z</dc:date>
    </item>
  </channel>
</rss>

